diff --git a/application.yml b/application.yml deleted file mode 100644 index 12d9becd..00000000 --- a/application.yml +++ /dev/null @@ -1,392 +0,0 @@ -# 项目相关配置 -ruoyi: - # 名称 - name: "xmzs" - # 版本 - version: ${revision} - # 版权年份 - copyrightYear: 2023 - # 实例演示开关 - 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: - com.xmzs: @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: 10MB - # 设置总上传的文件大小 - max-request-size: 20MB - 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: - # 修改用户头像 - - /system/user/edit/avatar - - /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: com.xmzs.**.mapper - # 对应的 XML 文件位置 - mapperLocations: classpath*:mapper/**/*Mapper.xml - # 实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.xmzs.**.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: com.xmzs.demo - - group: 2.通用模块 - packages-to-scan: com.xmzs.web - - group: 3.系统模块 - packages-to-scan: com.xmzs.system - - group: 4.代码生成模块 - packages-to-scan: com.xmzs.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: false - # 路径 - path: '' - # 设置访问源地址 - allowedOrigins: '*' - -# 微信小程序配置信息 -wx: - miniapp: - configs: - - appid: # 你的appid - secret: # 你的secret - token: #微信小程序消息服务器配置的token - aesKey: #微信小程序消息服务器配置的EncodingAESKey - msgDataFormat: JSON -baidu: - # 是否开启文本审核 - enabled: false - # 文本审核 - textReview: - apiKey: '' # apiKey - secretKey: '' # secretKey - appKey: xxxxxxxxxxxxxxxxx - secretKey: xxxxxxxxxxxxxxxxxxxxxxx - -wechat: - # 是否使用微信 true/false - enable: true - # 生成的登录二维码路径 默认与项目同级 - qrPath: "./" - -keyword: - # 重置会话指令 - reset: "重置会话" - # ai画图指令(DALL·E模型 https://platform.openai.com/docs/models/dall-e) - # generation 根据关键词生成图片(https://platform.openai.com/docs/guides/images/generations) - image: "ai画图" - # ai语音指令(TTS模型 https://platform.openai.com/docs/api-reference/audio) - audio: "ai语音" - -mj: - api-secret: 'sk-xx' - task-store: - type: in_memory - timeout: 30d - translate-way: gpt - # proxy: - # host: 127.0.0.1 - # port: 10809 - ng-discord: - server: 'https://xxx.pandarobot.chat/' - cdn: 'https://xxx.pandarobot.chat/' - wss: 'https://xxx.pandarobot.chat/' - openai: - gpt-api-url: 'https://api.pandarobot.chat/' - gpt-api-key: 'sk-xx' - accounts: - - guild-id: 'xx' - channel-id: 'xx' - user-token: 'xx' - ---- # mail 邮件发送 -mail: - enabled: true - host: smtp.163.com - port: 465 - # 是否需要用户名密码验证 - auth: true - # 发送方,遵循RFC-822标准 - from: ageerle@163.com - # 用户名(注意:如果使用foxmail邮箱,此处user为qq号) - user: ageerle@163.com - # 密码(填写授权码) - pass: TOGXBVPYFVPFRQMQ - # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。 - starttlsEnable: true - # 使用SSL安全连接 - sslEnable: true - # SMTP超时时长,单位毫秒,缺省值不超时 - timeout: 0 - # Socket连接超时值,单位毫秒,缺省值不超时 - connectionTimeout: 0 - -# chatgpt配置信息 -chat: - apiKey: 'sk-xxx' - apiHost: 'https://api.pandarobot.chat/' - -# 支付配置信息 -pay: - pid: 'xxx' - key: 'xxx' - payUrl: 'https://pay.pandarobot.chat/mapi.php' - notify_url: 'https://www.pandarobot.chat/pay/returnUrl' - return_url: 'https://www.pandarobot.chat/pay/notifyUrl' - type: 'wxpay' - device: 'pc' - sign_type: 'MD5' diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index acec2196..a8276a4c 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -57,7 +57,10 @@ ruoyi-fusion - + + org.ruoyi + ruoyi-knowledge + @@ -78,6 +81,12 @@ thumbnailator 0.4.11 + + io.github.ollama4j + ollama4j + 1.0.79 + compile + diff --git a/ruoyi-admin/src/main/java/com/xmzs/PandaApplication.java b/ruoyi-admin/src/main/java/com/xmzs/PandaApplication.java deleted file mode 100644 index d043c88b..00000000 --- a/ruoyi-admin/src/main/java/com/xmzs/PandaApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs; - -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 PandaApplication { - - - public static void main(String[] args) { - SpringApplication application = new SpringApplication(PandaApplication.class); - application.setApplicationStartup(new BufferingApplicationStartup(2048)); - application.run(args); - System.out.println("(♥◠‿◠)ノ゙ panda智能助手启动成功 ლ(´ڡ`ლ)゙"); - } -} diff --git a/ruoyi-admin/src/main/java/com/xmzs/PandaServletInitializer.java b/ruoyi-admin/src/main/java/com/xmzs/PandaServletInitializer.java deleted file mode 100644 index fef0656d..00000000 --- a/ruoyi-admin/src/main/java/com/xmzs/PandaServletInitializer.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs; - -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -/** - * web容器中进行部署 - * - * @author Lion Li - */ -public class PandaServletInitializer extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(PandaApplication.class); - } - -} diff --git a/ruoyi-admin/src/main/java/com/xmzs/controller/AuthController.java b/ruoyi-admin/src/main/java/com/xmzs/controller/AuthController.java deleted file mode 100644 index 0405b11d..00000000 --- a/ruoyi-admin/src/main/java/com/xmzs/controller/AuthController.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.xmzs.controller; - -import cn.dev33.satoken.annotation.SaIgnore; -import cn.hutool.core.collection.CollUtil; -import com.xmzs.common.core.constant.Constants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.domain.model.*; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.common.tenant.helper.TenantHelper; -import com.xmzs.system.domain.bo.SysTenantBo; -import com.xmzs.system.domain.vo.LoginTenantVo; -import com.xmzs.system.domain.vo.SysTenantVo; -import com.xmzs.system.domain.vo.TenantListVo; -import com.xmzs.system.service.ISysTenantService; - - -import com.xmzs.system.service.SysLoginService; -import com.xmzs.system.service.SysRegisterService; -import com.xmzs.web.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; - - /** - * 登录方法 - * - * @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 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); - } - - /** - * 游客登录 - * - * @param loginBody - * @return 结果 - */ - @PostMapping("/visitorLogin") - public R xcxLogin(@RequestBody VisitorLoginBody loginBody) { - return R.ok(loginService.visitorLogin(loginBody)); - } - - /** - * 退出登录 - */ - @PostMapping("/logout") - public R logout() { - loginService.logout(); - return R.ok("退出成功"); - } - - /** - * 用户注册 - */ - @PostMapping("/register") - public R register(@Validated @RequestBody RegisterBody user) { - 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/ruoyi-admin/src/main/java/com/xmzs/controller/CaptchaController.java b/ruoyi-admin/src/main/java/com/xmzs/controller/CaptchaController.java deleted file mode 100644 index de7d90bf..00000000 --- a/ruoyi-admin/src/main/java/com/xmzs/controller/CaptchaController.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.Constants; -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.reflect.ReflectUtils; -import com.xmzs.common.mail.config.properties.MailProperties; -import com.xmzs.common.mail.utils.MailUtils; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.common.sms.config.properties.SmsProperties; -import com.xmzs.common.sms.core.SmsTemplate; -import com.xmzs.common.sms.entity.SmsResult; -import com.xmzs.common.web.config.properties.CaptchaProperties; -import com.xmzs.common.web.enums.CaptchaType; -import com.xmzs.web.domain.request.EmailRequest; -import com.xmzs.web.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.HashMap; -import java.util.Map; - -/** - * 验证码操作处理 - * - * @author Lion Li - */ -@SaIgnore -@Slf4j -@Validated -@RequiredArgsConstructor -@RestController -public class CaptchaController { - - private final CaptchaProperties captchaProperties; - private final SmsProperties smsProperties; - private final MailProperties mailProperties; - - /** - * 短信验证码 - * - * @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") - @PostMapping("/resource/email/code") - public R emailCode(@RequestBody @Valid EmailRequest emailRequest) { - if (!mailProperties.getEnabled()) { - return R.fail("当前系统没有开启邮箱功能!"); - } - String key = GlobalConstants.CAPTCHA_CODE_KEY + emailRequest.getUsername(); - String code = RandomUtil.randomNumbers(4); - RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); - try { - MailUtils.sendText(emailRequest.getUsername(), "【熊猫助手】登录验证码", "您本次验证码为:" + code + ",有效性为" + Constants.CAPTCHA_EXPIRATION + "分钟,请尽快填写。"); - } catch (Exception e) { - log.error("验证码短信发送异常 => {}", e.getMessage()); - return R.fail(e.getMessage()); - } - return R.ok(); - } - - /** - * 生成验证码 - */ - @GetMapping("/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/ruoyi-admin/src/main/java/com/xmzs/controller/ChatController.java b/ruoyi-admin/src/main/java/com/xmzs/controller/ChatController.java deleted file mode 100644 index 80b5dde2..00000000 --- a/ruoyi-admin/src/main/java/com/xmzs/controller/ChatController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.xmzs.controller; - - -import com.xmzs.common.chat.domain.request.ChatRequest; -import com.xmzs.common.chat.domain.request.Dall3Request; -import com.xmzs.common.chat.entity.Tts.TextToSpeech; -import com.xmzs.common.chat.entity.files.UploadFileResponse; -import com.xmzs.common.chat.entity.images.Item; -import com.xmzs.common.chat.entity.whisper.WhisperResponse; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.bo.ChatMessageBo; -import com.xmzs.system.domain.vo.ChatMessageVo; -import com.xmzs.system.service.IChatMessageService; -import com.xmzs.system.service.ISseService; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.Valid; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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 https:www.unfbx.com - * @date 2023-03-01 - */ -@Controller -@Slf4j -@RequiredArgsConstructor -public class ChatController { - - private final ISseService ISseService; - - private final IChatMessageService chatMessageService; - - /** - * 聊天接口 - */ - @PostMapping("/chat") - @ResponseBody - public SseEmitter sseChat(@RequestBody @Valid ChatRequest chatRequest, HttpServletResponse response) { - return ISseService.sseChat(chatRequest); - } - - /** - * 上传文件 - */ - @PostMapping("/v1/upload") - @ResponseBody - public UploadFileResponse upload(@RequestPart("file") MultipartFile file) { - return ISseService.upload(file); - } - - - /** - * 语音转文本 - * - * @param file - */ - @PostMapping("/audio") - @ResponseBody - public WhisperResponse audio(@RequestParam("file") MultipartFile file) { - WhisperResponse whisperResponse = ISseService.speechToTextTranscriptionsV2(file); - return whisperResponse; - } - - /** - * 文本转语音 - * - * @param textToSpeech - */ - @PostMapping("/speech") - @ResponseBody - public ResponseEntity speech(@RequestBody TextToSpeech textToSpeech) { - return ISseService.textToSpeed(textToSpeech); - } - - - @PostMapping("/dall3") - @ResponseBody - public R> dall3(@RequestBody @Valid Dall3Request request) { - return R.ok(ISseService.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/ruoyi-admin/src/main/java/com/xmzs/controller/IndexController.java b/ruoyi-admin/src/main/java/com/xmzs/controller/IndexController.java deleted file mode 100644 index f37d1e42..00000000 --- a/ruoyi-admin/src/main/java/com/xmzs/controller/IndexController.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.controller; - -import cn.dev33.satoken.annotation.SaIgnore; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -/** - * 首页 - * - * @author Lion Li - */ -@SaIgnore -@RequiredArgsConstructor -@Controller -public class IndexController { - - /** - * 访问首页,提示语 - */ - @GetMapping("/") - public String index() { - return "index.html"; - } -} diff --git a/ruoyi-admin/src/main/java/com/xmzs/controller/PayController.java b/ruoyi-admin/src/main/java/com/xmzs/controller/PayController.java deleted file mode 100644 index e2c43cb7..00000000 --- a/ruoyi-admin/src/main/java/com/xmzs/controller/PayController.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.xmzs.controller; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.extra.qrcode.QrCodeUtil; -import com.xmzs.common.config.PayConfig; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.oss.core.OssClient; -import com.xmzs.common.oss.entity.UploadResult; -import com.xmzs.common.oss.factory.OssFactory; -import com.xmzs.common.response.PayResponse; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.common.service.PayService; -import com.xmzs.common.utils.MD5Util; -import com.xmzs.system.domain.bo.PaymentOrdersBo; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.system.domain.request.OrderRequest; -import com.xmzs.system.domain.vo.PaymentOrdersVo; -import com.xmzs.system.domain.vo.SysUserVo; -import com.xmzs.system.service.IPaymentOrdersService; -import com.xmzs.system.service.ISysUserService; -import com.xmzs.system.util.OrderNumberGenerator; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import java.math.BigDecimal; -import java.util.List; - -@RequiredArgsConstructor -@RestController -@RequestMapping("/pay") -@Slf4j -public class PayController { - - private final PayService payService; - - private final ISysUserService userService; - - private final IPaymentOrdersService paymentOrdersService; - - private final PayConfig payConfig; - - /** - * 获取支付二维码 - * - * @Date 2023/7/3 - * @return void - **/ - @PostMapping("/payUrl") - public R payUrl(@RequestBody OrderRequest orderRequest) { - LoginUser loginUser = LoginHelper.getLoginUser(); - // 创建订单 - PaymentOrdersBo paymentOrders = new PaymentOrdersBo(); - paymentOrders.setOrderName(orderRequest.getName()); - paymentOrders.setAmount(new BigDecimal(orderRequest.getMoney())); - String orderNo = OrderNumberGenerator.generate(); - paymentOrders.setOrderNo(orderNo); - paymentOrders.setUserId(loginUser.getUserId()); - // TODO 支付状态默认待支付 - 添加枚举 - paymentOrders.setPaymentStatus("1"); - paymentOrdersService.insertByBo(paymentOrders); - String payUrl = payService.getPayUrl(orderNo, 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"); - PaymentOrdersVo paymentOrdersVo = new PaymentOrdersVo(); - BeanUtil.copyProperties(paymentOrders,paymentOrdersVo); - paymentOrdersVo.setUrl(upload.getUrl()); - return R.ok(paymentOrdersVo); - } - - /** - * 跳转通知地址 - * - * @Date 2023/7/3 - * @param - * @return void - **/ - @PostMapping("/notifyUrl") - public void notifyUrl() { - log.info("notifyUrl==========="); - } - - /** - * 获取订单信息 - * - */ - @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); - } - - /** - * 跳转通知地址 - * - * @Date 2023/7/3 - * @param payResponse - * @return void - **/ - @GetMapping("/returnUrl") - public String returnUrl(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"; - } - -} - diff --git a/ruoyi-admin/src/main/java/com/xmzs/controller/WeChatController.java b/ruoyi-admin/src/main/java/com/xmzs/controller/WeChatController.java deleted file mode 100644 index 09ba22b0..00000000 --- a/ruoyi-admin/src/main/java/com/xmzs/controller/WeChatController.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xmzs.controller; - -import cn.dev33.satoken.annotation.SaIgnore; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.wechat.Wechat; -import com.xmzs.common.wechat.controller.LoginController; -import com.xmzs.common.wechat.core.MsgCenter; -import com.xmzs.system.cofing.KeywordConfig; -import com.xmzs.system.cofing.WechatConfig; -import com.xmzs.system.handler.WechatMessageHandler; -import com.xmzs.system.service.ISseService; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 个人微信扩展控制器 - * - * @author WangLe - */ -@SaIgnore -@Slf4j -@Validated -@RequiredArgsConstructor -@RestController -public class WeChatController { - - @Getter - private Wechat wechatBot; - - private final WechatConfig wechatConfig; - - private final ISseService sseService; - - private final KeywordConfig keywordConfig; - - /** - * 获取微信登录二维码 - * - */ - @GetMapping("/getQr") - public R getQr() { - //微信 - if (wechatConfig.getEnable()){ - log.info("正在登录微信,请按提示操作:"); - wechatBot = new Wechat(new WechatMessageHandler(sseService, keywordConfig)); - // 登陆 - LoginController login = new LoginController(); - String qrCode = login.login_1(); - new Thread(login::login_2).start(); - wechatBot.start(); - return R.ok(qrCode); - }else { - return R.fail(); - } - } - -} diff --git a/ruoyi-admin/src/main/java/org/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/org/ruoyi/RuoYiAIApplication.java similarity index 81% rename from ruoyi-admin/src/main/java/org/ruoyi/RuoYiApplication.java rename to ruoyi-admin/src/main/java/org/ruoyi/RuoYiAIApplication.java index 9c7d56ed..2d0693c3 100644 --- a/ruoyi-admin/src/main/java/org/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/org/ruoyi/RuoYiAIApplication.java @@ -10,12 +10,12 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt * @author Lion Li */ @SpringBootApplication -public class RuoYiApplication { +public class RuoYiAIApplication { public static void main(String[] args) { - SpringApplication application = new SpringApplication(RuoYiApplication.class); + SpringApplication application = new SpringApplication(RuoYiAIApplication.class); application.setApplicationStartup(new BufferingApplicationStartup(2048)); application.run(args); - System.out.println("(♥◠‿◠)ノ゙ RuoYiAi启动成功 ლ(´ڡ`ლ)゙"); + System.out.println("(♥◠‿◠)ノ゙ RuoYiAI启动成功 ლ(´ڡ`ლ)゙"); } } diff --git a/ruoyi-admin/src/main/java/org/ruoyi/RuoYiServletInitializer.java b/ruoyi-admin/src/main/java/org/ruoyi/RuoYiAIServletInitializer.java similarity index 70% rename from ruoyi-admin/src/main/java/org/ruoyi/RuoYiServletInitializer.java rename to ruoyi-admin/src/main/java/org/ruoyi/RuoYiAIServletInitializer.java index 082315fc..626d7a31 100644 --- a/ruoyi-admin/src/main/java/org/ruoyi/RuoYiServletInitializer.java +++ b/ruoyi-admin/src/main/java/org/ruoyi/RuoYiAIServletInitializer.java @@ -8,11 +8,11 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer * * @author Lion Li */ -public class RuoYiServletInitializer extends SpringBootServletInitializer { +public class RuoYiAIServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(RuoYiApplication.class); + return application.sources(RuoYiAIApplication.class); } } diff --git a/ruoyi-admin/src/main/java/org/ruoyi/controller/KnowledgeController.java b/ruoyi-admin/src/main/java/org/ruoyi/controller/KnowledgeController.java new file mode 100644 index 00000000..76e59963 --- /dev/null +++ b/ruoyi-admin/src/main/java/org/ruoyi/controller/KnowledgeController.java @@ -0,0 +1,210 @@ +package org.ruoyi.controller; + +import cn.dev33.satoken.stp.StpUtil; +import com.theokanning.openai.completion.chat.ChatMessageRole; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.ruoyi.common.chat.config.ChatConfig; +import org.ruoyi.common.chat.domain.request.ChatRequest; +import org.ruoyi.common.chat.entity.chat.ChatCompletion; +import org.ruoyi.common.chat.entity.chat.Message; +import org.ruoyi.common.chat.openai.OpenAiStreamClient; +import org.ruoyi.common.core.domain.R; +import org.ruoyi.common.core.validate.AddGroup; +import org.ruoyi.common.excel.utils.ExcelUtil; +import org.ruoyi.common.log.annotation.Log; +import org.ruoyi.common.log.enums.BusinessType; +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.common.satoken.utils.LoginHelper; +import org.ruoyi.common.web.core.BaseController; +import org.ruoyi.knowledge.domain.bo.KnowledgeAttachBo; +import org.ruoyi.knowledge.domain.bo.KnowledgeFragmentBo; +import org.ruoyi.knowledge.domain.bo.KnowledgeInfoBo; +import org.ruoyi.knowledge.domain.req.KnowledgeInfoUploadRequest; +import org.ruoyi.knowledge.domain.vo.KnowledgeAttachVo; +import org.ruoyi.knowledge.domain.vo.KnowledgeFragmentVo; +import org.ruoyi.knowledge.domain.vo.KnowledgeInfoVo; +import org.ruoyi.knowledge.service.EmbeddingService; +import org.ruoyi.knowledge.service.IKnowledgeAttachService; +import org.ruoyi.knowledge.service.IKnowledgeFragmentService; +import org.ruoyi.knowledge.service.IKnowledgeInfoService; +import org.ruoyi.system.listener.SSEEventSourceListener; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.ruoyi.knowledge.chain.vectorstore.VectorStore; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import java.util.ArrayList; +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; + + /** + * 知识库对话 + */ + @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); + 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); + + + 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()){ + throw new SecurityException("请先去登录!"); + } + 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/{kid}") + public R removeAttach(@NotEmpty(message = "主键不能为空") + @PathVariable String kid) { + attachService.removeKnowledgeAttach(kid); + 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/ruoyi-admin/src/main/java/org/ruoyi/controller/OllamaController.java b/ruoyi-admin/src/main/java/org/ruoyi/controller/OllamaController.java new file mode 100644 index 00000000..647eb475 --- /dev/null +++ b/ruoyi-admin/src/main/java/org/ruoyi/controller/OllamaController.java @@ -0,0 +1,67 @@ +package org.ruoyi.controller; + + +import io.github.ollama4j.OllamaAPI; +import io.github.ollama4j.exceptions.OllamaBaseException; +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.chat.OllamaChatResult; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.io.IOException; + +/** + * 描述:Ollama API调用 + * + * @author ageerle@163.com + * date 2024/11/6 + */ +@RestController +public class OllamaController { + + + @RequestMapping(value = "/qianwen-ai2") + private void ollama2(@RequestParam(value = "msg") String msg) { + + } + + public static void main(String[] args) throws OllamaBaseException, IOException, InterruptedException { + + String host = "http://localhost:11434/"; + + OllamaAPI ollama = new OllamaAPI(host); + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance("qwen2.5:7b"); + // 设置超时时间 + ollama.setRequestTimeoutSeconds(100); + // create first user question + String text = ""; + + String json = "{\"instruction\": \"解答以下数学问题。\",\"input\": \"计算 2 + 3 的结果。\",\"output\": \"2 + 3 = 5\"}"; + + OllamaChatRequestModel requestModel = builder.withMessage + (OllamaChatMessageRole.USER, "###文本:"+text+"###,理解文本内容,并且将文本内容转换为:"+json+"输出JSON格式,不要包含其他无关内容,内部使用无需脱敏") + .withGetJsonResponse() + .withStreaming() + .build(); + + // start conversation with model + OllamaChatResult chatResult = ollama.chat(requestModel); + + System.out.println("First answer: " + chatResult.getResponse()); + + // create next userQuestion + // requestModel = builder.withMessages(chatResult.getChatHistory()).withMessage(OllamaChatMessageRole.USER, "And what is the second largest city?").build(); + + // "continue" conversation with model + // chatResult = ollamaAPI.chat(requestModel); + + //System.out.println("Second answer: " + chatResult.getResponse()); + + // 历史记录 + //System.out.println("Chat History: " + chatResult.getChatHistory()); + } + +} diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 06e1b90b..6608a60f 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -8,28 +8,6 @@ spring.boot.admin.client: username: ruoyi 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: @@ -49,7 +27,8 @@ spring: driverClassName: com.mysql.cj.jdbc.Driver url: jdbc:mysql://43.139.70.230:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true username: ruoyi-ai - password: TZ7yaGtSRWeeBaBJ + password: eCaZ278N62k6fhYj + hikari: # 最大连接池数量 maxPoolSize: 20 @@ -78,7 +57,7 @@ spring.data: # 数据库索引 database: 0 # 密码(如没有密码请注释掉) - #password: + # password: 123456 # 连接超时时间 timeout: 10S # 是否开启ssl diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 491dea56..bbaec244 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -6,7 +6,7 @@ ruoyi: # 版本 version: ${revision} # 版权年份 - copyrightYear: 2023 + copyrightYear: 2025 # 实例演示开关 demoEnabled: true # 获取ip地址开关 @@ -294,7 +294,7 @@ management: websocket: enabled: true # 路径 - path: '' + path: '/resource/websocket' # 设置访问源地址 allowedOrigins: '*' @@ -308,28 +308,34 @@ wx: aesKey: #微信小程序消息服务器配置的EncodingAESKey msgDataFormat: JSON + # 企业微信应用 +wechat: + # 是否使用微信 true/false + enable: true + # 生成的登录二维码路径 默认与项目同级 + qrPath: "./" + # 企业微信应用 + cp: + corpId: + appConfigs: + - agentId: + secret: '' + token: '' + aesKey: '' + # 知识库配置 chain: split: chunk: endspliter: "" # 分块文本大小 - size: 500 - overlay: 0 - qaspliter: "######" + size: 200 + overlay: 30 + qaspliter: "###" # 知识库中检索的条数 limits: 5 - vectorization: - type: openai - openai: - model: 'text-embedding-3-small' - baidu: - model: bge-large-zh - zhipu: - model: embedding-2 - # 智普API KEY - token: xx vector: + model: 'text-embedding-3-small' store: type: weaviate weaviate: @@ -341,38 +347,4 @@ chain: port: 19530 dimension: 1536 collection: LocalKnowledge - llm: - openai: - token: sk-xx - model: gpt-4-1106-preview - chatglm: - baseurl: http://127.0.0.1:8000/ - model: chatglm2-6b - baidu: - appKey: xx - secretKey: xx - model: ernie_bot - zhipu: - model: glm-4 - audio: - type: openai - text: - type: openai - function: - type: baidu - vision: - type: openai - image: - type: openai - -upload: - path: /data/upload - -proxy: - socket: - host: 127.0.0.1 - port: 7890 - -resource: - domain: http://127.0.0.1:${server.port}/resources diff --git a/ruoyi-admin/src/main/resources/static/1.jpg b/ruoyi-admin/src/main/resources/static/1.jpg deleted file mode 100644 index 0a21dea6..00000000 Binary files a/ruoyi-admin/src/main/resources/static/1.jpg and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/css/iconfont.css b/ruoyi-admin/src/main/resources/static/assets/css/iconfont.css deleted file mode 100644 index f429cec1..00000000 --- a/ruoyi-admin/src/main/resources/static/assets/css/iconfont.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:"iconfont";src:url('iconfont.eot?t=1538765677655');src:url('iconfont.eot?t=1538765677655#iefix') format('embedded-opentype'),url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABD4AAsAAAAAGEwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8dkrQY21hcAAAAYAAAACyAAACYAVmbC5nbHlmAAACNAAADFkAABC4LpbxRWhlYWQAAA6QAAAAMQAAADYS3OzPaGhlYQAADsQAAAAgAAAAJAfhA4xobXR4AAAO5AAAABYAAAA4OAH//mxvY2EAAA78AAAAHgAAAB4kriBobWF4cAAADxwAAAAfAAAAIAE6AdRuYW1lAAAPPAAAAUUAAAJtPlT+fXBvc3QAABCEAAAAcQAAAJd6PSu0eJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMby4x9zwv4EhhrmBoQEozAiSAwDtxwzDeJzlksENgzAMRX8I0JKC1FNPvXKibMUKLNB5qp46DxKXL7aAb9xb2aCOXqR8xXb0YwAFgCgeIgfCBwEWb6lh1yPSrud46nzDVUrJyIKJLTv2HDhyXqZ1BYhj/SCCat1/FnDCRR1rnNWx1K2ITK9sUCmlPKz0X1Hv++t7asxzR86BwZGHYObY/zE6ls3CkcNgcuzv2TpyHewcmwH2js0JBwdWe3Rshjg79p5lclBttmI/0AAAeJyFN1uMXddVZ+3ned3zuPc87sx9zb1n7jme8Xhmch/neMb2PDL2jJuXPWnsaVQb4zQOCXEIbUzdRhQ1bgLTOhWto5Bg1LilVVUFRClqi0ol5H4gxCdYhY8gBZBQUfgolBAKsu+wzhnbSvjh3v1Ye6211z57rbXXXlsRirJzk/4n+QdlWTmqfFq5pFxWXlUU6DWJZ5GoEyfYdWbJ0IIIu8ES6SMpXKIZliYNm5CXJcrTWbCgCSn0lsghGETDQTwHcTJLo45F5O1O2MjkdxrgNQkdxB3hBb20ewfIliDZlULfdOqernt1Ry2rS0+//LUv/vKSWlHvIn3HFE5v5dh0Na6XCSnXk+r0AxNRz2GWU775FrODgJlVHz6/+quP3EME0RgzO/Fs1eu0m6bZnJgsV+fijsmYyhiZf+Tjz+mWqlo6XNJNHctbpkmYF1jCgz+0qhNxu2oJtvjYkTg+8tgiE1a1HU8gyrT0ycMHZi11vBN7XtwZV63ZVv3wpG6Z4oLuqWrZ09XR/7QG6zP4kapX8nRRrnumapZ1vYydVy8LHdEq8WbWBy0QOuINQ93tBMPpqup5qqIoBKtCf0i+oJjKmKJ0OwnEg7QXQuCJdiceZJD2Ak+CoF+sWKNfsepdC65Y9Zt/VamV4BWrWyuNnrGuIs6erOdgt55zvFKqT9rIrSgS/WBE3yW3lKZyQNlQHlXOKc8qn0JPiHeNhlbO0iwNwgDHaK5+kGb3pDGNl0gSCyniLI2lBVhyh0BiGoOIkyXI51gAaN4hcuSW7qeB9AKOnCLY5cTpg1y4JzIxC0voAYJOTB8tcdMG3zYNw35+zheUUd8ueTS5dHmMiXJj7pKYBEmzX3ziZbrfYf5bn/z1W+me06MrF9+g9I2LF69Reg1aeomwlwzDsozNErdHJ59tCzBb65+Juweuho1aMN5orqu2xhxH5eRdTVLCKiXHB0KYbBwZrArDaJTB8F+7Ovqm8Oi9nWiSG7VGvNaY/l3t+JPkxV8S2tknzp0afZc9dvzYeclOPrR5EX7L1MnzNWn7tnFKNezHg5c0Mu9Fzbn0SzdI0G1RUu3W7xek5JpYFaWzs6MojJK+4ih15SHU/ovKl5RvKD9Q/l75J+VflP8GAA4alMAFHxKYgWU4Bh+GLXgWLsBnYRt+B67CG/BH8H34y9xqhVFk0C+O1WxulyQLCtOIRMg46eSHMUQMQ74OnrthivQeMg/w1EKSN1lhPS5klBspyT0hysVhCYNuEEqUgibPrdjPelkuGiWRnIVKJMe4UpJmsj+MhkX1I/92Rfb/g8x8iQ5WIPsFIgjTLNwV43t7Ien3DoHMNyHjZcjbML0zH+f60VBmCA8jPwoR72MNscsQkgXc98X7PipO+hGugGugiKxY8TYxu/0BuaS84jjqo5Ssn+D3IOGDYqJCTlZsYndDYTER+2JJhAvOfHKI1e+/b4+5Jm73y5DvV0jUam6fNCPf7w87DtW0Ya8+CMcq+uQ+b65Wao2Xq5zp1ynduyf0GZMYw8rRZIOMe9NbM5QTMug5Npc6N8bMajBGQ3cqaBwlDS5XhaRBve2Q0rKmg2Tttfbxmz/2fN6rhs1J3FY9CGZUlYDTSQeNRB+rdR85CUaFlk3DY77RaASBt88LgvrSE5yrqhZqGKCCUNNcV1QqQDnjptCYITSJ4m3COGM8QDRlPcrUw5NS8jF1nsec2MVvKs5/Xp0JoVFNCJWqnNOKRTjv1UmjAbzV4jUeSFF9qsZrwue+EL4/5/vzbc4FnyhRU/O4p2keq+gmK803qGE+yLmL5X5b2t04xE9gnBioEI4forKK4/By2ZvZOjBMDxqsLAWX0mWurhNq6KShA3EmPvwosVxveCj+gq2yzwElXtmLtgOfUUG4rjIiNCPYV1ddAyNQ2eFUJbqmEiaoNJ2ZioVBh58+tHRgf70GpNT+jY+dpagSzs0yYfsAaD1oxJwCkMgBU8QrA2/cHv2U2FJotmVww17EhmMxhAEedzgWjwiqc+lx0+RCMNyNoQum2oHKWcloErSuOk4pZawP44yFwEBT6cEAwOS2sJjoMY0jQRWccIp6ZpQLHHDbHEeN8LoqtNA3B7bdYuPjDI06phOdcM+QuJ4qkVUtlV1Dr05zPi3k7Ky0OJciajAmNNOhOqlSjdod7nm8ww/yeb6POapGddXhri4JkXp+jeV3zdv0BRrhXTOjLCibykeVi8rvYdQKgzwqLQNehZEM8PCIYZzIvEuzBahQhJJsmIS90IasoGOcikMk5aAbt3Bu2PNlWFDmQGbSz3pehAev0pFJNwu9fmCj+CC/sHDqoB8kVFbydYs/Tg8+uDIGxyxfHKY/InXXLz03c4gx+uoMq9Wotbh5Sl7oM0nnS9g8hJrXOx+TVVev+VQ/r9csSvW5r9QOU4/S2NWpbly59vXLUt+mXxUrU1XQOhuMyhrWZ6SgtEXphmDb5ARmBThVyiszh6T84WHRqVMv072pppT0cItWF6SUnivn+hJnN+uCuYsuvf8haX15e/TS6NtzfV3/+fbzLSqb32xWpyzdvw8XHz3d8gwXJg3Zkt2ubF7pzJdKuuWJv2UnZEmekTClV0vxDB7Wzo+2z2wwKeeq6NBd+LKEfh8/x6NSR2RfGN1W06XeRo3q1X6Tyd8+l9tVFDnK18lfK4YSKpEyV2QSCrSLO6VtgRckUd6G/RwDBSYsqN0P4Iskod1LB3E7yuEDkMPwPXizEceN0Ulsv3U8B/OGPFwgGgXx1oX/H38fxAsx5M1v3oVG/3EXhPch48X4bilysJ136HdooCTKuqJkTciToNk8acU8J+wFoS8R7Ah/NyvGKxfz5yEfLKMjhjlLihxxFAs/TA+AjDpJ0IBXahvd+izA2txwg5ALH5k71d0XHopaERyaW1kH8snTi2f3kg6QdThM4Mx9yysT9Xq1DvVohsx06uTl6iTUWu1m2T+8cuIYXozWVtmDsWqz7gRH7t16GCbapQerr78HH4dzv7AJMO4+asPEzCM4PvPaHyt3c8sb5F8VVfEVpdLGnfDuEkgXN4HmyVwuksvknWQIo9kRPgJSGCa7wwXDIO/041u34t4PRitxH6Afw/V/F7uugPr6L3qN9pQTmEu+iJLTTMg+Sg9klAOYfgQhQlneY06I117+F7cPY55NYOKRJxy7aQcqLUuTTnSHAYnLkPJB2m9jSul6UuyFDmanSEoizGgqnu+F/TBnOgBBmrgDpP9No+s7O1InklwB+apkklD4E1aeumdOFTpoFWe+rxvensqYZrQ65UpJr40Nu7UW/3OqUkPl8iojsHdGSK6FXcelbGIsVOFFwWFNqBjixaekNPdNc+kPuFgXgSXFhyhb4gLkdZWOhWT/oiHGx598khslzzu40Blmmh5U2y3PXzpomg+stcZVXsK7AbOM/vLsuWHF1fB+OZvtd12M8joHVR750Gr1PpZfKLeuqRSoqDY4XQeM6+2f/pskKWGzBASDt9U7drhCX6eninP5MJ7Iwjll4bYZAvkLDtCRK4UvY9jMNZgndthExTMuToLdp17u8YXPL+1mhy0ahHFCFoZHAY4OU/TgjXTzPCHnNzefJuTpEQWmT3jJaam5/tRTq+1Je8VSjUo4Nr9abjuTPvOthU8sfuK55Z8v3/MHydSjHdvZa7utLt5NdTia3hZ7dBUFHs/FHt88f/Mf91Q7Z149/uZ1227U0q0Jx8QIPt5bXHjumc98+uDFA6ZDgLHAcjnt2uX9DXP+0tT0sQf3Tue62NnZ+WcGtKpw1IaNPik1TKep5N0Eg2mYrawSQpTV0cp7GItguPYzePKpx+E7w9FT8Npw9FVCh+++17sOL20+vJnrFgoFb5G/w2in5BFN5oc/93Ef4TYqykU1tfPXD8I5/c6hwjHdP/r9kgvgln6cd4Nk9PZuD2/uokcnz75AsYcfbf0awcz/LxB+AEluyU4GOQO0sd/F0RfOjk5ijyHk2/mLovi2ndfpz+gTyhoOhCKLh9kwEUWCj+l9Ps4z/tyeg9yq2QBT2R46gwwEcvu7voGPtZwpxkBxY/QTTv/stbIDH93gvOHaVqOxR06eqFLXOLnNalWuVe7dOPjZgxtrUFFFtca2t6wKgFO++qeEj35Cz2Fz41s3h8TRT1vz1dKcoYaETJbSUrWtiXOX96zV9CMDqs667qxKB0f08bWplx8Xxmz0ed2h6egbNwCfv8r/AgxxVFsAAAB4nGNgZGBgAOIdr4pmxvPbfGXgZmEAget3r+TC6P///09iYWZOA3I5GJhAogCNrQ5RAAAAeJxjYGRgYG7438AQw8Lw////vyzMDEARFMAHAKDJBnR4nGNhYGBgQcH//7NgiGHKAQBkagQ1AAAAAAAAANQBBAHEBDoFJgWWBgIGLgbyB3gHoAfuCFwAAHicY2BkYGDgYzzBoMQAAkxAzAWEDAz/wXwGACB0AhAAeJxlj01OwzAQhV/6B6QSqqhgh+QFYgEo/RGrblhUavdddN+mTpsqiSPHrdQDcB6OwAk4AtyAO/BIJ5s2lsffvHljTwDc4Acejt8t95E9XDI7cg0XuBeuU38QbpBfhJto41W4Rf1N2MczpsJtdGF5g9e4YvaEd2EPHXwI13CNT+E69S/hBvlbuIk7/Aq30PHqwj7mXle4jUcv9sdWL5xeqeVBxaHJIpM5v4KZXu+Sha3S6pxrW8QmU4OgX0lTnWlb3VPs10PnIhVZk6oJqzpJjMqt2erQBRvn8lGvF4kehCblWGP+tsYCjnEFhSUOjDFCGGSIyujoO1Vm9K+xQ8Jee1Y9zed0WxTU/3OFAQL0z1xTurLSeTpPgT1fG1J1dCtuy56UNJFezUkSskJe1rZUQuoBNmVXjhF6XNGJPyhnSP8ACVpuyAAAAHicbcHLDsIgEAVQbuWhVdtvBIowhA4mdGL061249Rw1qZ9Z/bdgwgkaBhYOZ1ww44ob7liwKhv7Rpyd59ySPM0rUeg6jo1dJc+jiG40Dkux83iYtHtq5lOoiIscWs/DVkmV2Oz+LWwzHUWCUl+qjh+BAAAA') format('woff'),url('iconfont.ttf?t=1538765677655') format('truetype'),url('iconfont.svg?t=1538765677655#iconfont') format('svg')}.iconfont{font-family:"iconfont"!important;font-size:21px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-coding:before{content:"\e62b"}.icon-angleup:before{content:"\e664"}.icon-weibo:before{content:"\e62d"}.icon-csdn:before{content:"\e60a"}.icon-jianshu:before{content:"\e675"}.icon-list:before{content:"\e625"}.icon-iconsf:before{content:"\e600"}.icon-email:before{content:"\e605"}.icon-zhihu:before{content:"\e8de"}.icon-cnblogs:before{content:"\e602"}.icon-juejin:before{content:"\e601"}.icon-mayun:before{content:"\e603"}.icon-github:before{content:"\e6e1"} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/assets/css/onlinewebfonts.css b/ruoyi-admin/src/main/resources/static/assets/css/onlinewebfonts.css deleted file mode 100644 index 8e97c002..00000000 --- a/ruoyi-admin/src/main/resources/static/assets/css/onlinewebfonts.css +++ /dev/null @@ -1,8 +0,0 @@ -@font-face {font-family: "Engravers' Old English BT"; - src: url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.eot"); /* IE9*/ - src: url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ - url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff2") format("woff2"), /* chrome firefox */ - url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff") format("woff"), /* chrome firefox */ - url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.ttf") format("truetype"), /* chrome firefox opera Safari, Android, iOS 4.2+*/ - url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.svg#Engravers' Old English BT") format("svg"); /* iOS 4.1- */ -} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/assets/css/vno.css b/ruoyi-admin/src/main/resources/static/assets/css/vno.css deleted file mode 100644 index b99730c1..00000000 --- a/ruoyi-admin/src/main/resources/static/assets/css/vno.css +++ /dev/null @@ -1,25 +0,0 @@ -html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}.ih-item.circle.effect{margin:0 auto;-webkit-perspective:900px;-moz-perspective:900px;perspective:900px}.ih-item.circle.effect .img{z-index:11;-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.ih-item.circle.effect .info{-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;-ms-transform-style:preserve-3d;-o-transform-style:preserve-3d;transform-style:preserve-3d}.ih-item.circle.effect .info .info-back{opacity:1;border-radius:50%;width:100%;height:100%;background:#333}.ih-item.circle.effect .info h2{color:#fff;position:relative;font-size:18px;margin:0 auto;padding-top:40px;height:35px;text-shadow:0 0 1px white,0 1px 2px rgba(0,0,0,0.3)}.ih-item.circle.effect .info p{color:#bbb;padding:0;font-style:italic;padding-left:0;font-size:10px}.ih-item.circle.effect.bottom_to_top .img{-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-ms-transform-origin:50% 0;-o-transform-origin:50% 0;transform-origin:50% 0}.ih-item.circle.effect.bottom_to_top a:hover .img{-webkit-transform:rotate3d(1,0,0,180deg);-moz-transform:rotate3d(1,0,0,180deg);-ms-transform:rotate3d(1,0,0,180deg);-o-transform:rotate3d(1,0,0,180deg);transform:rotate3d(1,0,0,180deg)}.ih-item.circle.effect.top_to_bottom .img{-webkit-transform-origin:50% 100%;-moz-transform-origin:50% 100%;-ms-transform-origin:50% 100%;-o-transform-origin:50% 100%;transform-origin:50% 100%}.ih-item.circle.effect.top_to_bottom a:hover .img{-webkit-transform:rotate3d(1,0,0,-180deg);-moz-transform:rotate3d(1,0,0,-180deg);-ms-transform:rotate3d(1,0,0,-180deg);-o-transform:rotate3d(1,0,0,-180deg);transform:rotate3d(1,0,0,-180deg)}.ih-item.circle.effect.left_to_right .img{-webkit-transform-origin:100% 50%;-moz-transform-origin:100% 50%;-ms-transform-origin:100% 50%;-o-transform-origin:100% 50%;transform-origin:100% 50%}.ih-item.circle.effect.left_to_right a:hover .img{-webkit-transform:rotate3d(0,1,0,180deg);-moz-transform:rotate3d(0,1,0,180deg);-ms-transform:rotate3d(0,1,0,180deg);-o-transform:rotate3d(0,1,0,180deg);transform:rotate3d(0,1,0,180deg)}.ih-item.circle.effect.right_to_left .img{-webkit-transform-origin:0 50%;-moz-transform-origin:0 50%;-ms-transform-origin:0 50%;-o-transform-origin:0 50%;transform-origin:0 50%}.ih-item.circle.effect.right_to_left a:hover .img{-webkit-transform:rotate3d(0,1,0,-180deg);-moz-transform:rotate3d(0,1,0,-180deg);-ms-transform:rotate3d(0,1,0,-180deg);-o-transform:rotate3d(0,1,0,-180deg);transform:rotate3d(0,1,0,-180deg)}.ih-item a{color:#333}.ih-item a:hover{text-decoration:none}.ih-item img{width:100%;height:100%}.ih-item.circle{position:relative;width:120px;height:120px;border-radius:50%}.ih-item.circle .img{position:relative;width:120px;height:120px;border-radius:50%}.ih-item.circle .img:before{position:absolute;display:block;content:"";width:100%;height:100%;border-radius:50%;-webkit-transition:all .35s ease-in-out;-moz-transition:all .35s ease-in-out;transition:all .35s ease-in-out}.ih-item.circle .img img{border-radius:50%}.ih-item.circle .info{position:absolute;top:0;bottom:0;left:0;right:0;text-align:center;border-radius:50%;-webkit-backface-visibility:hidden;backface-visibility:hidden}@media all and (max-width:780px){.ih-item.circle .img{position:relative;width:100px;height:100px;border-radius:50%}.ih-item.circle{position:relative;width:100px;height:100px;border-radius:50%}.ih-item.circle .info .info-back h2{font-size:.9em}}.profilepic{text-align:center;display:block;-webkit-box-shadow:0 0 0 2px rgba(255,255,255,0.5),0px 2px 20px 3px rgba(0,0,0,0.25);box-shadow:0 0 0 2px rgba(255,255,255,0.5),0px 2px 20px 3px rgba(0,0,0,0.25);border-radius:300px;width:128px;height:128px;margin:0 auto;position:relative;overflow:hidden;background:#88acdb;-webkit-transition:all .2s ease-in;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-pack:center;-webkit-box-align:center;text-align:center}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s}.animated.hinge{-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s}@-webkit-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-moz-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-o-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}.flash{-webkit-animation-name:flash;-moz-animation-name:flash;-o-animation-name:flash;animation-name:flash}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px)}}@-moz-keyframes shake{0%,100%{-moz-transform:translateX(0)}10%,30%,50%,70%,90%{-moz-transform:translateX(-10px)} -20%,40%,60%,80%{-moz-transform:translateX(10px)}}@-o-keyframes shake{0%,100%{-o-transform:translateX(0)}10%,30%,50%,70%,90%{-o-transform:translateX(-10px)}20%,40%,60%,80%{-o-transform:translateX(10px)}}.shake{-webkit-animation-name:shake;-moz-animation-name:shake;-o-animation-name:shake;animation-name:shake}@-webkit-keyframes bounce{0%,20%,50%,80%,100%{-webkit-transform:translateY(0)}40%{-webkit-transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px)}}@-moz-keyframes bounce{0%,20%,50%,80%,100%{-moz-transform:translateY(0)}40%{-moz-transform:translateY(-30px)}60%{-moz-transform:translateY(-15px)}}@-o-keyframes bounce{0%,20%,50%,80%,100%{-o-transform:translateY(0)}40%{-o-transform:translateY(-30px)}60%{-o-transform:translateY(-15px)}}.bounce{-webkit-animation-name:bounce;-moz-animation-name:bounce;-o-animation-name:bounce;animation-name:bounce}@-webkit-keyframes tada{0%{-webkit-transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0)}}@-moz-keyframes tada{0%{-moz-transform:scale(1)}10%,20%{-moz-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-moz-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-moz-transform:scale(1.1) rotate(-3deg)}100%{-moz-transform:scale(1) rotate(0)}}@-o-keyframes tada{0%{-o-transform:scale(1)}10%,20%{-o-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-o-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-o-transform:scale(1.1) rotate(-3deg)}100%{-o-transform:scale(1) rotate(0)}}.tada{-webkit-animation-name:tada;-moz-animation-name:tada;-o-animation-name:tada;animation-name:tada}@-webkit-keyframes swing{20%,40%,60%,80%,100%{-webkit-transform-origin:top center}20%{-webkit-transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg)}100%{-webkit-transform:rotate(0deg)}}@-moz-keyframes swing{20%{-moz-transform:rotate(15deg)}40%{-moz-transform:rotate(-10deg)}60%{-moz-transform:rotate(5deg)}80%{-moz-transform:rotate(-5deg)}100%{-moz-transform:rotate(0deg)}}@-o-keyframes swing{20%{-o-transform:rotate(15deg)}40%{-o-transform:rotate(-10deg)}60%{-o-transform:rotate(5deg)}80%{-o-transform:rotate(-5deg)}100%{-o-transform:rotate(0deg)}}.swing{-webkit-transform-origin:top center;-moz-transform-origin:top center;-o-transform-origin:top center;transform-origin:top center;-webkit-animation-name:swing;-moz-animation-name:swing;-o-animation-name:swing;animation-name:swing}@-webkit-keyframes wobble{0%{-webkit-transform:translateX(0%)}15%{-webkit-transform:translateX(-25%) rotate(-5deg)}30%{-webkit-transform:translateX(20%) rotate(3deg)}45%{-webkit-transform:translateX(-15%) rotate(-3deg)}60%{-webkit-transform:translateX(10%) rotate(2deg)}75%{-webkit-transform:translateX(-5%) rotate(-1deg)}100%{-webkit-transform:translateX(0%)}}@-moz-keyframes wobble{0%{-moz-transform:translateX(0%)}15%{-moz-transform:translateX(-25%) rotate(-5deg)}30%{-moz-transform:translateX(20%) rotate(3deg)}45%{-moz-transform:translateX(-15%) rotate(-3deg)}60%{-moz-transform:translateX(10%) rotate(2deg)}75%{-moz-transform:translateX(-5%) rotate(-1deg)}100%{-moz-transform:translateX(0%)}}@-o-keyframes wobble{0%{-o-transform:translateX(0%)}15%{-o-transform:translateX(-25%) rotate(-5deg)}30%{-o-transform:translateX(20%) rotate(3deg)}45%{-o-transform:translateX(-15%) rotate(-3deg)}60%{-o-transform:translateX(10%) rotate(2deg)}75%{-o-transform:translateX(-5%) rotate(-1deg)}100%{-o-transform:translateX(0%)}}.wobble{-webkit-animation-name:wobble;-moz-animation-name:wobble;-o-animation-name:wobble;animation-name:wobble}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.1)}100%{-webkit-transform:scale(1)}}@-moz-keyframes pulse{0%{-moz-transform:scale(1)}50%{-moz-transform:scale(1.1)}100%{-moz-transform:scale(1)}}@-o-keyframes pulse{0%{-o-transform:scale(1)}50%{-o-transform:scale(1.1)}100%{-o-transform:scale(1)}}.pulse{-webkit-animation-name:pulse;-moz-animation-name:pulse;-o-animation-name:pulse;animation-name:pulse}@-webkit-keyframes flip{0%{-webkit-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-webkit-animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-webkit-animation-timing-function:ease-out}50%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-webkit-animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-webkit-animation-timing-function:ease-in}100%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-webkit-animation-timing-function:ease-in}}@-moz-keyframes flip{0%{-moz-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-moz-animation-timing-function:ease-out}40%{-moz-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-moz-animation-timing-function:ease-out} -50%{-moz-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-moz-animation-timing-function:ease-in}80%{-moz-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-moz-animation-timing-function:ease-in}100%{-moz-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-moz-animation-timing-function:ease-in}}@-o-keyframes flip{0%{-o-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-o-animation-timing-function:ease-out}40%{-o-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-o-animation-timing-function:ease-out}50%{-o-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-o-animation-timing-function:ease-in}80%{-o-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-o-animation-timing-function:ease-in}100%{-o-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-o-animation-timing-function:ease-in}}.animated.flip{-webkit-backface-visibility:visible!important;-webkit-animation-name:flip;-moz-backface-visibility:visible!important;-moz-animation-name:flip;-o-backface-visibility:visible!important;-o-animation-name:flip;backface-visibility:visible!important;animation-name:flip}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px) rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateX(-10deg)}70%{-webkit-transform:perspective(400px) rotateX(10deg)}100%{-webkit-transform:perspective(400px) rotateX(0deg);opacity:1}}@-moz-keyframes flipInX{0%{-moz-transform:perspective(400px) rotateX(90deg);opacity:0}40%{-moz-transform:perspective(400px) rotateX(-10deg)}70%{-moz-transform:perspective(400px) rotateX(10deg)}100%{-moz-transform:perspective(400px) rotateX(0deg);opacity:1}}@-o-keyframes flipInX{0%{-o-transform:perspective(400px) rotateX(90deg);opacity:0}40%{-o-transform:perspective(400px) rotateX(-10deg)}70%{-o-transform:perspective(400px) rotateX(10deg)}100%{-o-transform:perspective(400px) rotateX(0deg);opacity:1}}.flipInX{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipInX;-moz-backface-visibility:visible!important;-moz-animation-name:flipInX;-o-backface-visibility:visible!important;-o-animation-name:flipInX;backface-visibility:visible!important;animation-name:flipInX}@-webkit-keyframes flipOutX{0%{-webkit-transform:perspective(400px) rotateX(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateX(90deg);opacity:0}}@-moz-keyframes flipOutX{0%{-moz-transform:perspective(400px) rotateX(0deg);opacity:1}100%{-moz-transform:perspective(400px) rotateX(90deg);opacity:0}}@-o-keyframes flipOutX{0%{-o-transform:perspective(400px) rotateX(0deg);opacity:1}100%{-o-transform:perspective(400px) rotateX(90deg);opacity:0}}.flipOutX{-webkit-animation-name:flipOutX;-webkit-backface-visibility:visible!important;-moz-animation-name:flipOutX;-moz-backface-visibility:visible!important;-o-animation-name:flipOutX;-o-backface-visibility:visible!important;animation-name:flipOutX;backface-visibility:visible!important}@-webkit-keyframes flipInY{0%{-webkit-transform:perspective(400px) rotateY(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateY(-10deg)}70%{-webkit-transform:perspective(400px) rotateY(10deg)}100%{-webkit-transform:perspective(400px) rotateY(0deg);opacity:1}}@-moz-keyframes flipInY{0%{-moz-transform:perspective(400px) rotateY(90deg);opacity:0}40%{-moz-transform:perspective(400px) rotateY(-10deg)}70%{-moz-transform:perspective(400px) rotateY(10deg)}100%{-moz-transform:perspective(400px) rotateY(0deg);opacity:1}}@-o-keyframes flipInY{0%{-o-transform:perspective(400px) rotateY(90deg);opacity:0}40%{-o-transform:perspective(400px) rotateY(-10deg)}70%{-o-transform:perspective(400px) rotateY(10deg)}100%{-o-transform:perspective(400px) rotateY(0deg);opacity:1}}.flipInY{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipInY;-moz-backface-visibility:visible!important;-moz-animation-name:flipInY;-o-backface-visibility:visible!important;-o-animation-name:flipInY;backface-visibility:visible!important;animation-name:flipInY}@-webkit-keyframes flipOutY{0%{-webkit-transform:perspective(400px) rotateY(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateY(90deg);opacity:0}}@-moz-keyframes flipOutY{0%{-moz-transform:perspective(400px) rotateY(0deg);opacity:1}100%{-moz-transform:perspective(400px) rotateY(90deg);opacity:0}}@-o-keyframes flipOutY{0%{-o-transform:perspective(400px) rotateY(0deg);opacity:1}100%{-o-transform:perspective(400px) rotateY(90deg);opacity:0}}.flipOutY{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipOutY;-moz-backface-visibility:visible!important;-moz-animation-name:flipOutY;-o-backface-visibility:visible!important;-o-animation-name:flipOutY;backface-visibility:visible!important;animation-name:flipOutY}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn} -@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}@-webkit-keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInDown{0%{opacity:0;-moz-transform:translateY(-20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInDown{0%{opacity:0;-o-transform:translateY(-20px)}100%{opacity:1;-o-transform:translateY(0)}}.fadeInDown{-webkit-animation-name:fadeInDown;-moz-animation-name:fadeInDown;-o-animation-name:fadeInDown;animation-name:fadeInDown}@-webkit-keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(-20px)}100%{opacity:1;-webkit-transform:translateX(0)}}@-moz-keyframes fadeInLeft{0%{opacity:0;-moz-transform:translateX(-20px)}100%{opacity:1;-moz-transform:translateX(0)}}@-o-keyframes fadeInLeft{0%{opacity:0;-o-transform:translateX(-20px)}100%{opacity:1;-o-transform:translateX(0)}}.fadeInLeft{-webkit-animation-name:fadeInLeft;-moz-animation-name:fadeInLeft;-o-animation-name:fadeInLeft;animation-name:fadeInLeft}@-webkit-keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(20px)}100%{opacity:1;-webkit-transform:translateX(0)}}@-moz-keyframes fadeInRight{0%{opacity:0;-moz-transform:translateX(20px)}100%{opacity:1;-moz-transform:translateX(0)}}@-o-keyframes fadeInRight{0%{opacity:0;-o-transform:translateX(20px)}100%{opacity:1;-o-transform:translateX(0)}}.fadeInRight{-webkit-animation-name:fadeInRight;-moz-animation-name:fadeInRight;-o-animation-name:fadeInRight;animation-name:fadeInRight}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUpBig{0%{opacity:0;-moz-transform:translateY(2000px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUpBig{0%{opacity:0;-o-transform:translateY(2000px)}100%{opacity:1;-o-transform:translateY(0)}}.fadeInUpBig{-webkit-animation-name:fadeInUpBig;-moz-animation-name:fadeInUpBig;-o-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translateY(-2000px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInDownBig{0%{opacity:0;-moz-transform:translateY(-2000px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInDownBig{0%{opacity:0;-o-transform:translateY(-2000px)}100%{opacity:1;-o-transform:translateY(0)}}.fadeInDownBig{-webkit-animation-name:fadeInDownBig;-moz-animation-name:fadeInDownBig;-o-animation-name:fadeInDownBig;animation-name:fadeInDownBig}@-webkit-keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translateX(-2000px)}100%{opacity:1;-webkit-transform:translateX(0)}}@-moz-keyframes fadeInLeftBig{0%{opacity:0;-moz-transform:translateX(-2000px)}100%{opacity:1;-moz-transform:translateX(0)}}@-o-keyframes fadeInLeftBig{0%{opacity:0;-o-transform:translateX(-2000px)}100%{opacity:1;-o-transform:translateX(0)}}.fadeInLeftBig{-webkit-animation-name:fadeInLeftBig;-moz-animation-name:fadeInLeftBig;-o-animation-name:fadeInLeftBig;animation-name:fadeInLeftBig}@-webkit-keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translateX(2000px)}100%{opacity:1;-webkit-transform:translateX(0)}}@-moz-keyframes fadeInRightBig{0%{opacity:0;-moz-transform:translateX(2000px)}100%{opacity:1;-moz-transform:translateX(0)}}@-o-keyframes fadeInRightBig{0%{opacity:0;-o-transform:translateX(2000px)}100%{opacity:1;-o-transform:translateX(0)}}.fadeInRightBig{-webkit-animation-name:fadeInRightBig;-moz-animation-name:fadeInRightBig;-o-animation-name:fadeInRightBig;animation-name:fadeInRightBig}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-moz-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-o-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fadeOut{-webkit-animation-name:fadeOut;-moz-animation-name:fadeOut;-o-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-20px)}}@-moz-keyframes fadeOutUp{0%{opacity:1;-moz-transform:translateY(0)}100%{opacity:0;-moz-transform:translateY(-20px)}}@-o-keyframes fadeOutUp{0%{opacity:1;-o-transform:translateY(0)}100%{opacity:0;-o-transform:translateY(-20px)}}.fadeOutUp{-webkit-animation-name:fadeOutUp;-moz-animation-name:fadeOutUp;-o-animation-name:fadeOutUp;animation-name:fadeOutUp}@-webkit-keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(20px)}}@-moz-keyframes fadeOutDown{0%{opacity:1;-moz-transform:translateY(0)}100%{opacity:0;-moz-transform:translateY(20px)} -}@-o-keyframes fadeOutDown{0%{opacity:1;-o-transform:translateY(0)}100%{opacity:0;-o-transform:translateY(20px)}}.fadeOutDown{-webkit-animation-name:fadeOutDown;-moz-animation-name:fadeOutDown;-o-animation-name:fadeOutDown;animation-name:fadeOutDown}@-webkit-keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-20px)}}@-moz-keyframes fadeOutLeft{0%{opacity:1;-moz-transform:translateX(0)}100%{opacity:0;-moz-transform:translateX(-20px)}}@-o-keyframes fadeOutLeft{0%{opacity:1;-o-transform:translateX(0)}100%{opacity:0;-o-transform:translateX(-20px)}}.fadeOutLeft{-webkit-animation-name:fadeOutLeft;-moz-animation-name:fadeOutLeft;-o-animation-name:fadeOutLeft;animation-name:fadeOutLeft}@-webkit-keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(20px)}}@-moz-keyframes fadeOutRight{0%{opacity:1;-moz-transform:translateX(0)}100%{opacity:0;-moz-transform:translateX(20px)}}@-o-keyframes fadeOutRight{0%{opacity:1;-o-transform:translateX(0)}100%{opacity:0;-o-transform:translateX(20px)}}.fadeOutRight{-webkit-animation-name:fadeOutRight;-moz-animation-name:fadeOutRight;-o-animation-name:fadeOutRight;animation-name:fadeOutRight}@-webkit-keyframes fadeOutUpBig{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@-moz-keyframes fadeOutUpBig{0%{opacity:1;-moz-transform:translateY(0)}100%{opacity:0;-moz-transform:translateY(-2000px)}}@-o-keyframes fadeOutUpBig{0%{opacity:1;-o-transform:translateY(0)}100%{opacity:0;-o-transform:translateY(-2000px)}}.fadeOutUpBig{-webkit-animation-name:fadeOutUpBig;-moz-animation-name:fadeOutUpBig;-o-animation-name:fadeOutUpBig;animation-name:fadeOutUpBig}@-webkit-keyframes fadeOutDownBig{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(2000px)}}@-moz-keyframes fadeOutDownBig{0%{opacity:1;-moz-transform:translateY(0)}100%{opacity:0;-moz-transform:translateY(2000px)}}@-o-keyframes fadeOutDownBig{0%{opacity:1;-o-transform:translateY(0)}100%{opacity:0;-o-transform:translateY(2000px)}}.fadeOutDownBig{-webkit-animation-name:fadeOutDownBig;-moz-animation-name:fadeOutDownBig;-o-animation-name:fadeOutDownBig;animation-name:fadeOutDownBig}@-webkit-keyframes fadeOutLeftBig{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@-moz-keyframes fadeOutLeftBig{0%{opacity:1;-moz-transform:translateX(0)}100%{opacity:0;-moz-transform:translateX(-2000px)}}@-o-keyframes fadeOutLeftBig{0%{opacity:1;-o-transform:translateX(0)}100%{opacity:0;-o-transform:translateX(-2000px)}}.fadeOutLeftBig{-webkit-animation-name:fadeOutLeftBig;-moz-animation-name:fadeOutLeftBig;-o-animation-name:fadeOutLeftBig;animation-name:fadeOutLeftBig}@-webkit-keyframes fadeOutRightBig{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@-moz-keyframes fadeOutRightBig{0%{opacity:1;-moz-transform:translateX(0)}100%{opacity:0;-moz-transform:translateX(2000px)}}@-o-keyframes fadeOutRightBig{0%{opacity:1;-o-transform:translateX(0)}100%{opacity:0;-o-transform:translateX(2000px)}}.fadeOutRightBig{-webkit-animation-name:fadeOutRightBig;-moz-animation-name:fadeOutRightBig;-o-animation-name:fadeOutRightBig;animation-name:fadeOutRightBig}@-webkit-keyframes slideInDown{0%{opacity:0;-webkit-transform:translateY(-2000px)}100%{-webkit-transform:translateY(0)}}@-moz-keyframes slideInDown{0%{opacity:0;-moz-transform:translateY(-2000px)}100%{-moz-transform:translateY(0)}}@-o-keyframes slideInDown{0%{opacity:0;-o-transform:translateY(-2000px)}100%{-o-transform:translateY(0)}}.slideInDown{-webkit-animation-name:slideInDown;-moz-animation-name:slideInDown;-o-animation-name:slideInDown;animation-name:slideInDown}@-webkit-keyframes slideInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px)}100%{-webkit-transform:translateX(0)}}@-moz-keyframes slideInLeft{0%{opacity:0;-moz-transform:translateX(-2000px)}100%{-moz-transform:translateX(0)}}@-o-keyframes slideInLeft{0%{opacity:0;-o-transform:translateX(-2000px)}100%{-o-transform:translateX(0)}}.slideInLeft{-webkit-animation-name:slideInLeft;-moz-animation-name:slideInLeft;-o-animation-name:slideInLeft;animation-name:slideInLeft}@-webkit-keyframes slideInRight{0%{opacity:0;-webkit-transform:translateX(2000px)}100%{-webkit-transform:translateX(0)}}@-moz-keyframes slideInRight{0%{opacity:0;-moz-transform:translateX(2000px)}100%{-moz-transform:translateX(0)}}@-o-keyframes slideInRight{0%{opacity:0;-o-transform:translateX(2000px)}100%{-o-transform:translateX(0)}}.slideInRight{-webkit-animation-name:slideInRight;-moz-animation-name:slideInRight;-o-animation-name:slideInRight;animation-name:slideInRight}@-webkit-keyframes slideOutUp{0%{-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@-moz-keyframes slideOutUp{0%{-moz-transform:translateY(0)}100%{opacity:0;-moz-transform:translateY(-2000px)}}@-o-keyframes slideOutUp{0%{-o-transform:translateY(0)} -100%{opacity:0;-o-transform:translateY(-2000px)}}.slideOutUp{-webkit-animation-name:slideOutUp;-moz-animation-name:slideOutUp;-o-animation-name:slideOutUp;animation-name:slideOutUp}@-webkit-keyframes slideOutLeft{0%{-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@-moz-keyframes slideOutLeft{0%{-moz-transform:translateX(0)}100%{opacity:0;-moz-transform:translateX(-2000px)}}@-o-keyframes slideOutLeft{0%{-o-transform:translateX(0)}100%{opacity:0;-o-transform:translateX(-2000px)}}.slideOutLeft{-webkit-animation-name:slideOutLeft;-moz-animation-name:slideOutLeft;-o-animation-name:slideOutLeft;animation-name:slideOutLeft}@-webkit-keyframes slideOutRight{0%{-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@-moz-keyframes slideOutRight{0%{-moz-transform:translateX(0)}100%{opacity:0;-moz-transform:translateX(2000px)}}@-o-keyframes slideOutRight{0%{-o-transform:translateX(0)}100%{opacity:0;-o-transform:translateX(2000px)}}.slideOutRight{-webkit-animation-name:slideOutRight;-moz-animation-name:slideOutRight;-o-animation-name:slideOutRight;animation-name:slideOutRight}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(0.3)}50%{opacity:1;-webkit-transform:scale(1.05)}70%{-webkit-transform:scale(0.9)}100%{-webkit-transform:scale(1)}}@-moz-keyframes bounceIn{0%{opacity:0;-moz-transform:scale(0.3)}50%{opacity:1;-moz-transform:scale(1.05)}70%{-moz-transform:scale(0.9)}100%{-moz-transform:scale(1)}}@-o-keyframes bounceIn{0%{opacity:0;-o-transform:scale(0.3)}50%{opacity:1;-o-transform:scale(1.05)}70%{-o-transform:scale(0.9)}100%{-o-transform:scale(1)}}.bounceIn{-webkit-animation-name:bounceIn;-moz-animation-name:bounceIn;-o-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes bounceInUp{0%{opacity:0;-webkit-transform:translateY(2000px)}60%{opacity:1;-webkit-transform:translateY(-30px)}80%{-webkit-transform:translateY(10px)}100%{-webkit-transform:translateY(0)}}@-moz-keyframes bounceInUp{0%{opacity:0;-moz-transform:translateY(2000px)}60%{opacity:1;-moz-transform:translateY(-30px)}80%{-moz-transform:translateY(10px)}100%{-moz-transform:translateY(0)}}@-o-keyframes bounceInUp{0%{opacity:0;-o-transform:translateY(2000px)}60%{opacity:1;-o-transform:translateY(-30px)}80%{-o-transform:translateY(10px)}100%{-o-transform:translateY(0)}}.bounceInUp{-webkit-animation-name:bounceInUp;-moz-animation-name:bounceInUp;-o-animation-name:bounceInUp;animation-name:bounceInUp}@-webkit-keyframes bounceInDown{0%{opacity:0;-webkit-transform:translateY(-2000px)}60%{opacity:1;-webkit-transform:translateY(30px)}80%{-webkit-transform:translateY(-10px)}100%{-webkit-transform:translateY(0)}}@-moz-keyframes bounceInDown{0%{opacity:0;-moz-transform:translateY(-2000px)}60%{opacity:1;-moz-transform:translateY(30px)}80%{-moz-transform:translateY(-10px)}100%{-moz-transform:translateY(0)}}@-o-keyframes bounceInDown{0%{opacity:0;-o-transform:translateY(-2000px)}60%{opacity:1;-o-transform:translateY(30px)}80%{-o-transform:translateY(-10px)}100%{-o-transform:translateY(0)}}.bounceInDown{-webkit-animation-name:bounceInDown;-moz-animation-name:bounceInDown;-o-animation-name:bounceInDown;animation-name:bounceInDown}@-webkit-keyframes bounceInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px)}60%{opacity:1;-webkit-transform:translateX(30px)}80%{-webkit-transform:translateX(-10px)}100%{-webkit-transform:translateX(0)}}@-moz-keyframes bounceInLeft{0%{opacity:0;-moz-transform:translateX(-2000px)}60%{opacity:1;-moz-transform:translateX(30px)}80%{-moz-transform:translateX(-10px)}100%{-moz-transform:translateX(0)}}@-o-keyframes bounceInLeft{0%{opacity:0;-o-transform:translateX(-2000px)}60%{opacity:1;-o-transform:translateX(30px)}80%{-o-transform:translateX(-10px)}100%{-o-transform:translateX(0)}}.bounceInLeft{-webkit-animation-name:bounceInLeft;-moz-animation-name:bounceInLeft;-o-animation-name:bounceInLeft;animation-name:bounceInLeft}@-webkit-keyframes bounceInRight{0%{opacity:0;-webkit-transform:translateX(2000px)}60%{opacity:1;-webkit-transform:translateX(-30px)}80%{-webkit-transform:translateX(10px)}100%{-webkit-transform:translateX(0)}}@-moz-keyframes bounceInRight{0%{opacity:0;-moz-transform:translateX(2000px)}60%{opacity:1;-moz-transform:translateX(-30px)}80%{-moz-transform:translateX(10px)}100%{-moz-transform:translateX(0)}}@-o-keyframes bounceInRight{0%{opacity:0;-o-transform:translateX(2000px)}60%{opacity:1;-o-transform:translateX(-30px)}80%{-o-transform:translateX(10px)}100%{-o-transform:translateX(0)}}.bounceInRight{-webkit-animation-name:bounceInRight;-moz-animation-name:bounceInRight;-o-animation-name:bounceInRight;animation-name:bounceInRight}@-webkit-keyframes bounceOut{0%{-webkit-transform:scale(1)}25%{-webkit-transform:scale(0.95)}50%{opacity:1;-webkit-transform:scale(1.1)}100%{opacity:0;-webkit-transform:scale(0.3)}}@-moz-keyframes bounceOut{0%{-moz-transform:scale(1)}25%{-moz-transform:scale(0.95)}50%{opacity:1;-moz-transform:scale(1.1)}100%{opacity:0;-moz-transform:scale(0.3)} -}@-o-keyframes bounceOut{0%{-o-transform:scale(1)}25%{-o-transform:scale(0.95)}50%{opacity:1;-o-transform:scale(1.1)}100%{opacity:0;-o-transform:scale(0.3)}}.bounceOut{-webkit-animation-name:bounceOut;-moz-animation-name:bounceOut;-o-animation-name:bounceOut;animation-name:bounceOut}@-webkit-keyframes bounceOutUp{0%{-webkit-transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(20px)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@-moz-keyframes bounceOutUp{0%{-moz-transform:translateY(0)}20%{opacity:1;-moz-transform:translateY(20px)}100%{opacity:0;-moz-transform:translateY(-2000px)}}@-o-keyframes bounceOutUp{0%{-o-transform:translateY(0)}20%{opacity:1;-o-transform:translateY(20px)}100%{opacity:0;-o-transform:translateY(-2000px)}}.bounceOutUp{-webkit-animation-name:bounceOutUp;-moz-animation-name:bounceOutUp;-o-animation-name:bounceOutUp;animation-name:bounceOutUp}@-webkit-keyframes bounceOutDown{0%{-webkit-transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(-20px)}100%{opacity:0;-webkit-transform:translateY(2000px)}}@-moz-keyframes bounceOutDown{0%{-moz-transform:translateY(0)}20%{opacity:1;-moz-transform:translateY(-20px)}100%{opacity:0;-moz-transform:translateY(2000px)}}@-o-keyframes bounceOutDown{0%{-o-transform:translateY(0)}20%{opacity:1;-o-transform:translateY(-20px)}100%{opacity:0;-o-transform:translateY(2000px)}}.bounceOutDown{-webkit-animation-name:bounceOutDown;-moz-animation-name:bounceOutDown;-o-animation-name:bounceOutDown;animation-name:bounceOutDown}@-webkit-keyframes bounceOutLeft{0%{-webkit-transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(20px)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@-moz-keyframes bounceOutLeft{0%{-moz-transform:translateX(0)}20%{opacity:1;-moz-transform:translateX(20px)}100%{opacity:0;-moz-transform:translateX(-2000px)}}@-o-keyframes bounceOutLeft{0%{-o-transform:translateX(0)}20%{opacity:1;-o-transform:translateX(20px)}100%{opacity:0;-o-transform:translateX(-2000px)}}.bounceOutLeft{-webkit-animation-name:bounceOutLeft;-moz-animation-name:bounceOutLeft;-o-animation-name:bounceOutLeft;animation-name:bounceOutLeft}@-webkit-keyframes bounceOutRight{0%{-webkit-transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(-20px)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@-moz-keyframes bounceOutRight{0%{-moz-transform:translateX(0)}20%{opacity:1;-moz-transform:translateX(-20px)}100%{opacity:0;-moz-transform:translateX(2000px)}}@-o-keyframes bounceOutRight{0%{-o-transform:translateX(0)}20%{opacity:1;-o-transform:translateX(-20px)}100%{opacity:0;-o-transform:translateX(2000px)}}.bounceOutRight{-webkit-animation-name:bounceOutRight;-moz-animation-name:bounceOutRight;-o-animation-name:bounceOutRight;animation-name:bounceOutRight}@-webkit-keyframes rotateIn{0%{-webkit-transform-origin:center center;-webkit-transform:rotate(-200deg);opacity:0}100%{-webkit-transform-origin:center center;-webkit-transform:rotate(0);opacity:1}}@-moz-keyframes rotateIn{0%{-moz-transform-origin:center center;-moz-transform:rotate(-200deg);opacity:0}100%{-moz-transform-origin:center center;-moz-transform:rotate(0);opacity:1}}@-o-keyframes rotateIn{0%{-o-transform-origin:center center;-o-transform:rotate(-200deg);opacity:0}100%{-o-transform-origin:center center;-o-transform:rotate(0);opacity:1}}.rotateIn{-webkit-animation-name:rotateIn;-moz-animation-name:rotateIn;-o-animation-name:rotateIn;animation-name:rotateIn}@-webkit-keyframes rotateInUpLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}}@-moz-keyframes rotateInUpLeft{0%{-moz-transform-origin:left bottom;-moz-transform:rotate(90deg);opacity:0}100%{-moz-transform-origin:left bottom;-moz-transform:rotate(0);opacity:1}}@-o-keyframes rotateInUpLeft{0%{-o-transform-origin:left bottom;-o-transform:rotate(90deg);opacity:0}100%{-o-transform-origin:left bottom;-o-transform:rotate(0);opacity:1}}.rotateInUpLeft{-webkit-animation-name:rotateInUpLeft;-moz-animation-name:rotateInUpLeft;-o-animation-name:rotateInUpLeft;animation-name:rotateInUpLeft}@-webkit-keyframes rotateInDownLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}}@-moz-keyframes rotateInDownLeft{0%{-moz-transform-origin:left bottom;-moz-transform:rotate(-90deg);opacity:0}100%{-moz-transform-origin:left bottom;-moz-transform:rotate(0);opacity:1}}@-o-keyframes rotateInDownLeft{0%{-o-transform-origin:left bottom;-o-transform:rotate(-90deg);opacity:0}100%{-o-transform-origin:left bottom;-o-transform:rotate(0);opacity:1}}.rotateInDownLeft{-webkit-animation-name:rotateInDownLeft;-moz-animation-name:rotateInDownLeft;-o-animation-name:rotateInDownLeft;animation-name:rotateInDownLeft}@-webkit-keyframes rotateInUpRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(-90deg);opacity:0} -100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}}@-moz-keyframes rotateInUpRight{0%{-moz-transform-origin:right bottom;-moz-transform:rotate(-90deg);opacity:0}100%{-moz-transform-origin:right bottom;-moz-transform:rotate(0);opacity:1}}@-o-keyframes rotateInUpRight{0%{-o-transform-origin:right bottom;-o-transform:rotate(-90deg);opacity:0}100%{-o-transform-origin:right bottom;-o-transform:rotate(0);opacity:1}}.rotateInUpRight{-webkit-animation-name:rotateInUpRight;-moz-animation-name:rotateInUpRight;-o-animation-name:rotateInUpRight;animation-name:rotateInUpRight}@-webkit-keyframes rotateInDownRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}}@-moz-keyframes rotateInDownRight{0%{-moz-transform-origin:right bottom;-moz-transform:rotate(90deg);opacity:0}100%{-moz-transform-origin:right bottom;-moz-transform:rotate(0);opacity:1}}@-o-keyframes rotateInDownRight{0%{-o-transform-origin:right bottom;-o-transform:rotate(90deg);opacity:0}100%{-o-transform-origin:right bottom;-o-transform:rotate(0);opacity:1}}.rotateInDownRight{-webkit-animation-name:rotateInDownRight;-moz-animation-name:rotateInDownRight;-o-animation-name:rotateInDownRight;animation-name:rotateInDownRight}@-webkit-keyframes rotateOut{0%{-webkit-transform-origin:center center;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:center center;-webkit-transform:rotate(200deg);opacity:0}}@-moz-keyframes rotateOut{0%{-moz-transform-origin:center center;-moz-transform:rotate(0);opacity:1}100%{-moz-transform-origin:center center;-moz-transform:rotate(200deg);opacity:0}}@-o-keyframes rotateOut{0%{-o-transform-origin:center center;-o-transform:rotate(0);opacity:1}100%{-o-transform-origin:center center;-o-transform:rotate(200deg);opacity:0}}.rotateOut{-webkit-animation-name:rotateOut;-moz-animation-name:rotateOut;-o-animation-name:rotateOut;animation-name:rotateOut}@-webkit-keyframes rotateOutUpLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(-90deg);opacity:0}}@-moz-keyframes rotateOutUpLeft{0%{-moz-transform-origin:left bottom;-moz-transform:rotate(0);opacity:1}100%{-moz-transform-origin:left bottom;-moz-transform:rotate(-90deg);opacity:0}}@-o-keyframes rotateOutUpLeft{0%{-o-transform-origin:left bottom;-o-transform:rotate(0);opacity:1}100%{-o-transform-origin:left bottom;-o-transform:rotate(-90deg);opacity:0}}.rotateOutUpLeft{-webkit-animation-name:rotateOutUpLeft;-moz-animation-name:rotateOutUpLeft;-o-animation-name:rotateOutUpLeft;animation-name:rotateOutUpLeft}@-webkit-keyframes rotateOutDownLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(90deg);opacity:0}}@-moz-keyframes rotateOutDownLeft{0%{-moz-transform-origin:left bottom;-moz-transform:rotate(0);opacity:1}100%{-moz-transform-origin:left bottom;-moz-transform:rotate(90deg);opacity:0}}@-o-keyframes rotateOutDownLeft{0%{-o-transform-origin:left bottom;-o-transform:rotate(0);opacity:1}100%{-o-transform-origin:left bottom;-o-transform:rotate(90deg);opacity:0}}.rotateOutDownLeft{-webkit-animation-name:rotateOutDownLeft;-moz-animation-name:rotateOutDownLeft;-o-animation-name:rotateOutDownLeft;animation-name:rotateOutDownLeft}@-webkit-keyframes rotateOutUpRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(90deg);opacity:0}}@-moz-keyframes rotateOutUpRight{0%{-moz-transform-origin:right bottom;-moz-transform:rotate(0);opacity:1}100%{-moz-transform-origin:right bottom;-moz-transform:rotate(90deg);opacity:0}}@-o-keyframes rotateOutUpRight{0%{-o-transform-origin:right bottom;-o-transform:rotate(0);opacity:1}100%{-o-transform-origin:right bottom;-o-transform:rotate(90deg);opacity:0}}.rotateOutUpRight{-webkit-animation-name:rotateOutUpRight;-moz-animation-name:rotateOutUpRight;-o-animation-name:rotateOutUpRight;animation-name:rotateOutUpRight}@-webkit-keyframes rotateOutDownRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(-90deg);opacity:0}}@-moz-keyframes rotateOutDownRight{0%{-moz-transform-origin:right bottom;-moz-transform:rotate(0);opacity:1}100%{-moz-transform-origin:right bottom;-moz-transform:rotate(-90deg);opacity:0}}@-o-keyframes rotateOutDownRight{0%{-o-transform-origin:right bottom;-o-transform:rotate(0);opacity:1}100%{-o-transform-origin:right bottom;-o-transform:rotate(-90deg);opacity:0}}.rotateOutDownRight{-webkit-animation-name:rotateOutDownRight;-moz-animation-name:rotateOutDownRight;-o-animation-name:rotateOutDownRight;animation-name:rotateOutDownRight}@-webkit-keyframes lightSpeedIn{0%{-webkit-transform:translateX(100%) skewX(-30deg);opacity:0} -60%{-webkit-transform:translateX(-20%) skewX(30deg);opacity:1}80%{-webkit-transform:translateX(0%) skewX(-15deg);opacity:1}100%{-webkit-transform:translateX(0%) skewX(0deg);opacity:1}}@-moz-keyframes lightSpeedIn{0%{-moz-transform:translateX(100%) skewX(-30deg);opacity:0}60%{-moz-transform:translateX(-20%) skewX(30deg);opacity:1}80%{-moz-transform:translateX(0%) skewX(-15deg);opacity:1}100%{-moz-transform:translateX(0%) skewX(0deg);opacity:1}}@-o-keyframes lightSpeedIn{0%{-o-transform:translateX(100%) skewX(-30deg);opacity:0}60%{-o-transform:translateX(-20%) skewX(30deg);opacity:1}80%{-o-transform:translateX(0%) skewX(-15deg);opacity:1}100%{-o-transform:translateX(0%) skewX(0deg);opacity:1}}.lightSpeedIn{-webkit-animation-name:lightSpeedIn;-moz-animation-name:lightSpeedIn;-o-animation-name:lightSpeedIn;animation-name:lightSpeedIn;-webkit-animation-timing-function:ease-out;-moz-animation-timing-function:ease-out;-o-animation-timing-function:ease-out;animation-timing-function:ease-out}@-webkit-keyframes lightSpeedOut{0%{-webkit-transform:translateX(0%) skewX(0deg);opacity:1}100%{-webkit-transform:translateX(100%) skewX(-30deg);opacity:0}}@-moz-keyframes lightSpeedOut{0%{-moz-transform:translateX(0%) skewX(0deg);opacity:1}100%{-moz-transform:translateX(100%) skewX(-30deg);opacity:0}}@-o-keyframes lightSpeedOut{0%{-o-transform:translateX(0%) skewX(0deg);opacity:1}100%{-o-transform:translateX(100%) skewX(-30deg);opacity:0}}.lightSpeedOut{-webkit-animation-name:lightSpeedOut;-moz-animation-name:lightSpeedOut;-o-animation-name:lightSpeedOut;animation-name:lightSpeedOut;-webkit-animation-timing-function:ease-in;-moz-animation-timing-function:ease-in;-o-animation-timing-function:ease-in;animation-timing-function:ease-in}@-webkit-keyframes hinge{0%{-webkit-transform:rotate(0);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}40%{-webkit-transform:rotate(60deg);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}80%{-webkit-transform:rotate(60deg) translateY(0);opacity:1;-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}100%{-webkit-transform:translateY(700px);opacity:0}}@-moz-keyframes hinge{0%{-moz-transform:rotate(0);-moz-transform-origin:top left;-moz-animation-timing-function:ease-in-out}20%,60%{-moz-transform:rotate(80deg);-moz-transform-origin:top left;-moz-animation-timing-function:ease-in-out}40%{-moz-transform:rotate(60deg);-moz-transform-origin:top left;-moz-animation-timing-function:ease-in-out}80%{-moz-transform:rotate(60deg) translateY(0);opacity:1;-moz-transform-origin:top left;-moz-animation-timing-function:ease-in-out}100%{-moz-transform:translateY(700px);opacity:0}}@-o-keyframes hinge{0%{-o-transform:rotate(0);-o-transform-origin:top left;-o-animation-timing-function:ease-in-out}20%,60%{-o-transform:rotate(80deg);-o-transform-origin:top left;-o-animation-timing-function:ease-in-out}40%{-o-transform:rotate(60deg);-o-transform-origin:top left;-o-animation-timing-function:ease-in-out}80%{-o-transform:rotate(60deg) translateY(0);opacity:1;-o-transform-origin:top left;-o-animation-timing-function:ease-in-out}100%{-o-transform:translateY(700px);opacity:0}}.hinge{-webkit-animation-name:hinge;-moz-animation-name:hinge;-o-animation-name:hinge;animation-name:hinge}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0px) rotate(0deg)}}@-moz-keyframes rollIn{0%{opacity:0;-moz-transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-moz-transform:translateX(0px) rotate(0deg)}}@-o-keyframes rollIn{0%{opacity:0;-o-transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-o-transform:translateX(0px) rotate(0deg)}}.rollIn{-webkit-animation-name:rollIn;-moz-animation-name:rollIn;-o-animation-name:rollIn;animation-name:rollIn}@-webkit-keyframes rollOut{0%{opacity:1;-webkit-transform:translateX(0px) rotate(0deg)}100%{opacity:0;-webkit-transform:translateX(100%) rotate(120deg)}}@-moz-keyframes rollOut{0%{opacity:1;-moz-transform:translateX(0px) rotate(0deg)}100%{opacity:0;-moz-transform:translateX(100%) rotate(120deg)}}@-o-keyframes rollOut{0%{opacity:1;-o-transform:translateX(0px) rotate(0deg)}100%{opacity:0;-o-transform:translateX(100%) rotate(120deg)}}.rollOut{-webkit-animation-name:rollOut;-moz-animation-name:rollOut;-o-animation-name:rollOut;animation-name:rollOut}@-moz-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-o-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-moz-keyframes shake{0%,100%{transform:translateX(0)}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}@-webkit-keyframes shake{0%,100%{transform:translateX(0)}10%,30%,50%,70%,90%{transform:translateX(-10px)} -20%,40%,60%,80%{transform:translateX(10px)}}@-o-keyframes shake{0%,100%{transform:translateX(0)}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}@keyframes shake{0%,100%{transform:translateX(0)}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}@-moz-keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0)}40%{transform:translateY(-30px)}60%{transform:translateY(-15px)}}@-webkit-keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0)}40%{transform:translateY(-30px)}60%{transform:translateY(-15px)}}@-o-keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0)}40%{transform:translateY(-30px)}60%{transform:translateY(-15px)}}@keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0)}40%{transform:translateY(-30px)}60%{transform:translateY(-15px)}}@-moz-keyframes tada{0%{transform:scale(1)}10%,20%{transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(3deg)}40%,60%,80%{transform:scale(1.1) rotate(-3deg)}100%{transform:scale(1) rotate(0)}}@-webkit-keyframes tada{0%{transform:scale(1)}10%,20%{transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(3deg)}40%,60%,80%{transform:scale(1.1) rotate(-3deg)}100%{transform:scale(1) rotate(0)}}@-o-keyframes tada{0%{transform:scale(1)}10%,20%{transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(3deg)}40%,60%,80%{transform:scale(1.1) rotate(-3deg)}100%{transform:scale(1) rotate(0)}}@keyframes tada{0%{transform:scale(1)}10%,20%{transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(3deg)}40%,60%,80%{transform:scale(1.1) rotate(-3deg)}100%{transform:scale(1) rotate(0)}}@-moz-keyframes swing{20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}100%{transform:rotate(0deg)}}@-webkit-keyframes swing{20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}100%{transform:rotate(0deg)}}@-o-keyframes swing{20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}100%{transform:rotate(0deg)}}@keyframes swing{20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}100%{transform:rotate(0deg)}}@-moz-keyframes wobble{0%{transform:translateX(0%)}15%{transform:translateX(-25%) rotate(-5deg)}30%{transform:translateX(20%) rotate(3deg)}45%{transform:translateX(-15%) rotate(-3deg)}60%{transform:translateX(10%) rotate(2deg)}75%{transform:translateX(-5%) rotate(-1deg)}100%{transform:translateX(0%)}}@-webkit-keyframes wobble{0%{transform:translateX(0%)}15%{transform:translateX(-25%) rotate(-5deg)}30%{transform:translateX(20%) rotate(3deg)}45%{transform:translateX(-15%) rotate(-3deg)}60%{transform:translateX(10%) rotate(2deg)}75%{transform:translateX(-5%) rotate(-1deg)}100%{transform:translateX(0%)}}@-o-keyframes wobble{0%{transform:translateX(0%)}15%{transform:translateX(-25%) rotate(-5deg)}30%{transform:translateX(20%) rotate(3deg)}45%{transform:translateX(-15%) rotate(-3deg)}60%{transform:translateX(10%) rotate(2deg)}75%{transform:translateX(-5%) rotate(-1deg)}100%{transform:translateX(0%)}}@keyframes wobble{0%{transform:translateX(0%)}15%{transform:translateX(-25%) rotate(-5deg)}30%{transform:translateX(20%) rotate(3deg)}45%{transform:translateX(-15%) rotate(-3deg)}60%{transform:translateX(10%) rotate(2deg)}75%{transform:translateX(-5%) rotate(-1deg)}100%{transform:translateX(0%)}}@-moz-keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@-webkit-keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@-o-keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@-moz-keyframes flip{0%{transform:perspective(400px) translateZ(0) rotateY(0) scale(1);animation-timing-function:ease-out}40%{transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);animation-timing-function:ease-out}50%{transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);animation-timing-function:ease-in}80%{transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);animation-timing-function:ease-in}100%{transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);animation-timing-function:ease-in}}@-webkit-keyframes flip{0%{transform:perspective(400px) translateZ(0) rotateY(0) scale(1);animation-timing-function:ease-out}40%{transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);animation-timing-function:ease-out}50%{transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);animation-timing-function:ease-in}80%{transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);animation-timing-function:ease-in}100%{transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);animation-timing-function:ease-in} -}@-o-keyframes flip{0%{transform:perspective(400px) translateZ(0) rotateY(0) scale(1);animation-timing-function:ease-out}40%{transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);animation-timing-function:ease-out}50%{transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);animation-timing-function:ease-in}80%{transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);animation-timing-function:ease-in}100%{transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);animation-timing-function:ease-in}}@keyframes flip{0%{transform:perspective(400px) translateZ(0) rotateY(0) scale(1);animation-timing-function:ease-out}40%{transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);animation-timing-function:ease-out}50%{transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);animation-timing-function:ease-in}80%{transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);animation-timing-function:ease-in}100%{transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);animation-timing-function:ease-in}}@-moz-keyframes flipInX{0%{transform:perspective(400px) rotateX(90deg);opacity:0}40%{transform:perspective(400px) rotateX(-10deg)}70%{transform:perspective(400px) rotateX(10deg)}100%{transform:perspective(400px) rotateX(0deg);opacity:1}}@-webkit-keyframes flipInX{0%{transform:perspective(400px) rotateX(90deg);opacity:0}40%{transform:perspective(400px) rotateX(-10deg)}70%{transform:perspective(400px) rotateX(10deg)}100%{transform:perspective(400px) rotateX(0deg);opacity:1}}@-o-keyframes flipInX{0%{transform:perspective(400px) rotateX(90deg);opacity:0}40%{transform:perspective(400px) rotateX(-10deg)}70%{transform:perspective(400px) rotateX(10deg)}100%{transform:perspective(400px) rotateX(0deg);opacity:1}}@keyframes flipInX{0%{transform:perspective(400px) rotateX(90deg);opacity:0}40%{transform:perspective(400px) rotateX(-10deg)}70%{transform:perspective(400px) rotateX(10deg)}100%{transform:perspective(400px) rotateX(0deg);opacity:1}}@-moz-keyframes flipOutX{0%{transform:perspective(400px) rotateX(0deg);opacity:1}100%{transform:perspective(400px) rotateX(90deg);opacity:0}}@-webkit-keyframes flipOutX{0%{transform:perspective(400px) rotateX(0deg);opacity:1}100%{transform:perspective(400px) rotateX(90deg);opacity:0}}@-o-keyframes flipOutX{0%{transform:perspective(400px) rotateX(0deg);opacity:1}100%{transform:perspective(400px) rotateX(90deg);opacity:0}}@keyframes flipOutX{0%{transform:perspective(400px) rotateX(0deg);opacity:1}100%{transform:perspective(400px) rotateX(90deg);opacity:0}}@-moz-keyframes flipInY{0%{transform:perspective(400px) rotateY(90deg);opacity:0}40%{transform:perspective(400px) rotateY(-10deg)}70%{transform:perspective(400px) rotateY(10deg)}100%{transform:perspective(400px) rotateY(0deg);opacity:1}}@-webkit-keyframes flipInY{0%{transform:perspective(400px) rotateY(90deg);opacity:0}40%{transform:perspective(400px) rotateY(-10deg)}70%{transform:perspective(400px) rotateY(10deg)}100%{transform:perspective(400px) rotateY(0deg);opacity:1}}@-o-keyframes flipInY{0%{transform:perspective(400px) rotateY(90deg);opacity:0}40%{transform:perspective(400px) rotateY(-10deg)}70%{transform:perspective(400px) rotateY(10deg)}100%{transform:perspective(400px) rotateY(0deg);opacity:1}}@keyframes flipInY{0%{transform:perspective(400px) rotateY(90deg);opacity:0}40%{transform:perspective(400px) rotateY(-10deg)}70%{transform:perspective(400px) rotateY(10deg)}100%{transform:perspective(400px) rotateY(0deg);opacity:1}}@-moz-keyframes flipOutY{0%{transform:perspective(400px) rotateY(0deg);opacity:1}100%{transform:perspective(400px) rotateY(90deg);opacity:0}}@-webkit-keyframes flipOutY{0%{transform:perspective(400px) rotateY(0deg);opacity:1}100%{transform:perspective(400px) rotateY(90deg);opacity:0}}@-o-keyframes flipOutY{0%{transform:perspective(400px) rotateY(0deg);opacity:1}100%{transform:perspective(400px) rotateY(90deg);opacity:0}}@keyframes flipOutY{0%{transform:perspective(400px) rotateY(0deg);opacity:1}100%{transform:perspective(400px) rotateY(90deg);opacity:0}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@-webkit-keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@-moz-keyframes fadeInDown{0%{opacity:0;transform:translateY(-20px)}100%{opacity:1;transform:translateY(0)}}@-webkit-keyframes fadeInDown{0%{opacity:0;transform:translateY(-20px)}100%{opacity:1;transform:translateY(0)}}@-o-keyframes fadeInDown{0%{opacity:0;transform:translateY(-20px)} -100%{opacity:1;transform:translateY(0)}}@keyframes fadeInDown{0%{opacity:0;transform:translateY(-20px)}100%{opacity:1;transform:translateY(0)}}@-moz-keyframes fadeInLeft{0%{opacity:0;transform:translateX(-20px)}100%{opacity:1;transform:translateX(0)}}@-webkit-keyframes fadeInLeft{0%{opacity:0;transform:translateX(-20px)}100%{opacity:1;transform:translateX(0)}}@-o-keyframes fadeInLeft{0%{opacity:0;transform:translateX(-20px)}100%{opacity:1;transform:translateX(0)}}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-20px)}100%{opacity:1;transform:translateX(0)}}@-moz-keyframes fadeInRight{0%{opacity:0;transform:translateX(20px)}100%{opacity:1;transform:translateX(0)}}@-webkit-keyframes fadeInRight{0%{opacity:0;transform:translateX(20px)}100%{opacity:1;transform:translateX(0)}}@-o-keyframes fadeInRight{0%{opacity:0;transform:translateX(20px)}100%{opacity:1;transform:translateX(0)}}@keyframes fadeInRight{0%{opacity:0;transform:translateX(20px)}100%{opacity:1;transform:translateX(0)}}@-moz-keyframes fadeInUpBig{0%{opacity:0;transform:translateY(2000px)}100%{opacity:1;transform:translateY(0)}}@-webkit-keyframes fadeInUpBig{0%{opacity:0;transform:translateY(2000px)}100%{opacity:1;transform:translateY(0)}}@-o-keyframes fadeInUpBig{0%{opacity:0;transform:translateY(2000px)}100%{opacity:1;transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;transform:translateY(2000px)}100%{opacity:1;transform:translateY(0)}}@-moz-keyframes fadeInDownBig{0%{opacity:0;transform:translateY(-2000px)}100%{opacity:1;transform:translateY(0)}}@-webkit-keyframes fadeInDownBig{0%{opacity:0;transform:translateY(-2000px)}100%{opacity:1;transform:translateY(0)}}@-o-keyframes fadeInDownBig{0%{opacity:0;transform:translateY(-2000px)}100%{opacity:1;transform:translateY(0)}}@keyframes fadeInDownBig{0%{opacity:0;transform:translateY(-2000px)}100%{opacity:1;transform:translateY(0)}}@-moz-keyframes fadeInLeftBig{0%{opacity:0;transform:translateX(-2000px)}100%{opacity:1;transform:translateX(0)}}@-webkit-keyframes fadeInLeftBig{0%{opacity:0;transform:translateX(-2000px)}100%{opacity:1;transform:translateX(0)}}@-o-keyframes fadeInLeftBig{0%{opacity:0;transform:translateX(-2000px)}100%{opacity:1;transform:translateX(0)}}@keyframes fadeInLeftBig{0%{opacity:0;transform:translateX(-2000px)}100%{opacity:1;transform:translateX(0)}}@-moz-keyframes fadeInRightBig{0%{opacity:0;transform:translateX(2000px)}100%{opacity:1;transform:translateX(0)}}@-webkit-keyframes fadeInRightBig{0%{opacity:0;transform:translateX(2000px)}100%{opacity:1;transform:translateX(0)}}@-o-keyframes fadeInRightBig{0%{opacity:0;transform:translateX(2000px)}100%{opacity:1;transform:translateX(0)}}@keyframes fadeInRightBig{0%{opacity:0;transform:translateX(2000px)}100%{opacity:1;transform:translateX(0)}}@-moz-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-o-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-moz-keyframes fadeOutUp{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-20px)}}@-webkit-keyframes fadeOutUp{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-20px)}}@-o-keyframes fadeOutUp{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-20px)}}@keyframes fadeOutUp{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-20px)}}@-moz-keyframes fadeOutDown{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(20px)}}@-webkit-keyframes fadeOutDown{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(20px)}}@-o-keyframes fadeOutDown{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(20px)}}@keyframes fadeOutDown{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(20px)}}@-moz-keyframes fadeOutLeft{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-20px)}}@-webkit-keyframes fadeOutLeft{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-20px)}}@-o-keyframes fadeOutLeft{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-20px)}}@keyframes fadeOutLeft{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-20px)}}@-moz-keyframes fadeOutRight{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(20px)}}@-webkit-keyframes fadeOutRight{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(20px)}}@-o-keyframes fadeOutRight{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(20px)}}@keyframes fadeOutRight{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(20px)}}@-moz-keyframes fadeOutUpBig{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-2000px)}}@-webkit-keyframes fadeOutUpBig{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-2000px)}}@-o-keyframes fadeOutUpBig{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-2000px)} -}@keyframes fadeOutUpBig{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-2000px)}}@-moz-keyframes fadeOutDownBig{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(2000px)}}@-webkit-keyframes fadeOutDownBig{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(2000px)}}@-o-keyframes fadeOutDownBig{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(2000px)}}@keyframes fadeOutDownBig{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(2000px)}}@-moz-keyframes fadeOutLeftBig{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-2000px)}}@-webkit-keyframes fadeOutLeftBig{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-2000px)}}@-o-keyframes fadeOutLeftBig{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-2000px)}}@keyframes fadeOutLeftBig{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-2000px)}}@-moz-keyframes fadeOutRightBig{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(2000px)}}@-webkit-keyframes fadeOutRightBig{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(2000px)}}@-o-keyframes fadeOutRightBig{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(2000px)}}@keyframes fadeOutRightBig{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(2000px)}}@-moz-keyframes slideInDown{0%{opacity:0;transform:translateY(-2000px)}100%{transform:translateY(0)}}@-webkit-keyframes slideInDown{0%{opacity:0;transform:translateY(-2000px)}100%{transform:translateY(0)}}@-o-keyframes slideInDown{0%{opacity:0;transform:translateY(-2000px)}100%{transform:translateY(0)}}@keyframes slideInDown{0%{opacity:0;transform:translateY(-2000px)}100%{transform:translateY(0)}}@-moz-keyframes slideInLeft{0%{opacity:0;transform:translateX(-2000px)}100%{transform:translateX(0)}}@-webkit-keyframes slideInLeft{0%{opacity:0;transform:translateX(-2000px)}100%{transform:translateX(0)}}@-o-keyframes slideInLeft{0%{opacity:0;transform:translateX(-2000px)}100%{transform:translateX(0)}}@keyframes slideInLeft{0%{opacity:0;transform:translateX(-2000px)}100%{transform:translateX(0)}}@-moz-keyframes slideInRight{0%{opacity:0;transform:translateX(2000px)}100%{transform:translateX(0)}}@-webkit-keyframes slideInRight{0%{opacity:0;transform:translateX(2000px)}100%{transform:translateX(0)}}@-o-keyframes slideInRight{0%{opacity:0;transform:translateX(2000px)}100%{transform:translateX(0)}}@keyframes slideInRight{0%{opacity:0;transform:translateX(2000px)}100%{transform:translateX(0)}}@-moz-keyframes slideOutUp{0%{transform:translateY(0)}100%{opacity:0;transform:translateY(-2000px)}}@-webkit-keyframes slideOutUp{0%{transform:translateY(0)}100%{opacity:0;transform:translateY(-2000px)}}@-o-keyframes slideOutUp{0%{transform:translateY(0)}100%{opacity:0;transform:translateY(-2000px)}}@keyframes slideOutUp{0%{transform:translateY(0)}100%{opacity:0;transform:translateY(-2000px)}}@-moz-keyframes slideOutLeft{0%{transform:translateX(0)}100%{opacity:0;transform:translateX(-2000px)}}@-webkit-keyframes slideOutLeft{0%{transform:translateX(0)}100%{opacity:0;transform:translateX(-2000px)}}@-o-keyframes slideOutLeft{0%{transform:translateX(0)}100%{opacity:0;transform:translateX(-2000px)}}@keyframes slideOutLeft{0%{transform:translateX(0)}100%{opacity:0;transform:translateX(-2000px)}}@-moz-keyframes slideOutRight{0%{transform:translateX(0)}100%{opacity:0;transform:translateX(2000px)}}@-webkit-keyframes slideOutRight{0%{transform:translateX(0)}100%{opacity:0;transform:translateX(2000px)}}@-o-keyframes slideOutRight{0%{transform:translateX(0)}100%{opacity:0;transform:translateX(2000px)}}@keyframes slideOutRight{0%{transform:translateX(0)}100%{opacity:0;transform:translateX(2000px)}}@-moz-keyframes bounceIn{0%{opacity:0;transform:scale(0.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(0.9)}100%{transform:scale(1)}}@-webkit-keyframes bounceIn{0%{opacity:0;transform:scale(0.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(0.9)}100%{transform:scale(1)}}@-o-keyframes bounceIn{0%{opacity:0;transform:scale(0.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(0.9)}100%{transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;transform:scale(0.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(0.9)}100%{transform:scale(1)}}@-moz-keyframes bounceInUp{0%{opacity:0;transform:translateY(2000px)}60%{opacity:1;transform:translateY(-30px)}80%{transform:translateY(10px)}100%{transform:translateY(0)}}@-webkit-keyframes bounceInUp{0%{opacity:0;transform:translateY(2000px)}60%{opacity:1;transform:translateY(-30px)}80%{transform:translateY(10px)}100%{transform:translateY(0)}}@-o-keyframes bounceInUp{0%{opacity:0;transform:translateY(2000px)}60%{opacity:1;transform:translateY(-30px)}80%{transform:translateY(10px)}100%{transform:translateY(0)}}@keyframes bounceInUp{0%{opacity:0;transform:translateY(2000px)} -60%{opacity:1;transform:translateY(-30px)}80%{transform:translateY(10px)}100%{transform:translateY(0)}}@-moz-keyframes bounceInDown{0%{opacity:0;transform:translateY(-2000px)}60%{opacity:1;transform:translateY(30px)}80%{transform:translateY(-10px)}100%{transform:translateY(0)}}@-webkit-keyframes bounceInDown{0%{opacity:0;transform:translateY(-2000px)}60%{opacity:1;transform:translateY(30px)}80%{transform:translateY(-10px)}100%{transform:translateY(0)}}@-o-keyframes bounceInDown{0%{opacity:0;transform:translateY(-2000px)}60%{opacity:1;transform:translateY(30px)}80%{transform:translateY(-10px)}100%{transform:translateY(0)}}@keyframes bounceInDown{0%{opacity:0;transform:translateY(-2000px)}60%{opacity:1;transform:translateY(30px)}80%{transform:translateY(-10px)}100%{transform:translateY(0)}}@-moz-keyframes bounceInLeft{0%{opacity:0;transform:translateX(-2000px)}60%{opacity:1;transform:translateX(30px)}80%{transform:translateX(-10px)}100%{transform:translateX(0)}}@-webkit-keyframes bounceInLeft{0%{opacity:0;transform:translateX(-2000px)}60%{opacity:1;transform:translateX(30px)}80%{transform:translateX(-10px)}100%{transform:translateX(0)}}@-o-keyframes bounceInLeft{0%{opacity:0;transform:translateX(-2000px)}60%{opacity:1;transform:translateX(30px)}80%{transform:translateX(-10px)}100%{transform:translateX(0)}}@keyframes bounceInLeft{0%{opacity:0;transform:translateX(-2000px)}60%{opacity:1;transform:translateX(30px)}80%{transform:translateX(-10px)}100%{transform:translateX(0)}}@-moz-keyframes bounceInRight{0%{opacity:0;transform:translateX(2000px)}60%{opacity:1;transform:translateX(-30px)}80%{transform:translateX(10px)}100%{transform:translateX(0)}}@-webkit-keyframes bounceInRight{0%{opacity:0;transform:translateX(2000px)}60%{opacity:1;transform:translateX(-30px)}80%{transform:translateX(10px)}100%{transform:translateX(0)}}@-o-keyframes bounceInRight{0%{opacity:0;transform:translateX(2000px)}60%{opacity:1;transform:translateX(-30px)}80%{transform:translateX(10px)}100%{transform:translateX(0)}}@keyframes bounceInRight{0%{opacity:0;transform:translateX(2000px)}60%{opacity:1;transform:translateX(-30px)}80%{transform:translateX(10px)}100%{transform:translateX(0)}}@-moz-keyframes bounceOut{0%{transform:scale(1)}25%{transform:scale(0.95)}50%{opacity:1;transform:scale(1.1)}100%{opacity:0;transform:scale(0.3)}}@-webkit-keyframes bounceOut{0%{transform:scale(1)}25%{transform:scale(0.95)}50%{opacity:1;transform:scale(1.1)}100%{opacity:0;transform:scale(0.3)}}@-o-keyframes bounceOut{0%{transform:scale(1)}25%{transform:scale(0.95)}50%{opacity:1;transform:scale(1.1)}100%{opacity:0;transform:scale(0.3)}}@keyframes bounceOut{0%{transform:scale(1)}25%{transform:scale(0.95)}50%{opacity:1;transform:scale(1.1)}100%{opacity:0;transform:scale(0.3)}}@-moz-keyframes bounceOutUp{0%{transform:translateY(0)}20%{opacity:1;transform:translateY(20px)}100%{opacity:0;transform:translateY(-2000px)}}@-webkit-keyframes bounceOutUp{0%{transform:translateY(0)}20%{opacity:1;transform:translateY(20px)}100%{opacity:0;transform:translateY(-2000px)}}@-o-keyframes bounceOutUp{0%{transform:translateY(0)}20%{opacity:1;transform:translateY(20px)}100%{opacity:0;transform:translateY(-2000px)}}@keyframes bounceOutUp{0%{transform:translateY(0)}20%{opacity:1;transform:translateY(20px)}100%{opacity:0;transform:translateY(-2000px)}}@-moz-keyframes bounceOutDown{0%{transform:translateY(0)}20%{opacity:1;transform:translateY(-20px)}100%{opacity:0;transform:translateY(2000px)}}@-webkit-keyframes bounceOutDown{0%{transform:translateY(0)}20%{opacity:1;transform:translateY(-20px)}100%{opacity:0;transform:translateY(2000px)}}@-o-keyframes bounceOutDown{0%{transform:translateY(0)}20%{opacity:1;transform:translateY(-20px)}100%{opacity:0;transform:translateY(2000px)}}@keyframes bounceOutDown{0%{transform:translateY(0)}20%{opacity:1;transform:translateY(-20px)}100%{opacity:0;transform:translateY(2000px)}}@-moz-keyframes bounceOutLeft{0%{transform:translateX(0)}20%{opacity:1;transform:translateX(20px)}100%{opacity:0;transform:translateX(-2000px)}}@-webkit-keyframes bounceOutLeft{0%{transform:translateX(0)}20%{opacity:1;transform:translateX(20px)}100%{opacity:0;transform:translateX(-2000px)}}@-o-keyframes bounceOutLeft{0%{transform:translateX(0)}20%{opacity:1;transform:translateX(20px)}100%{opacity:0;transform:translateX(-2000px)}}@keyframes bounceOutLeft{0%{transform:translateX(0)}20%{opacity:1;transform:translateX(20px)}100%{opacity:0;transform:translateX(-2000px)}}@-moz-keyframes bounceOutRight{0%{transform:translateX(0)}20%{opacity:1;transform:translateX(-20px)}100%{opacity:0;transform:translateX(2000px)}}@-webkit-keyframes bounceOutRight{0%{transform:translateX(0)}20%{opacity:1;transform:translateX(-20px)}100%{opacity:0;transform:translateX(2000px)}}@-o-keyframes bounceOutRight{0%{transform:translateX(0)}20%{opacity:1;transform:translateX(-20px)}100%{opacity:0;transform:translateX(2000px)}}@keyframes bounceOutRight{0%{transform:translateX(0)}20%{opacity:1;transform:translateX(-20px)} -100%{opacity:0;transform:translateX(2000px)}}@-moz-keyframes rotateIn{0%{transform-origin:center center;transform:rotate(-200deg);opacity:0}100%{transform-origin:center center;transform:rotate(0);opacity:1}}@-webkit-keyframes rotateIn{0%{transform-origin:center center;transform:rotate(-200deg);opacity:0}100%{transform-origin:center center;transform:rotate(0);opacity:1}}@-o-keyframes rotateIn{0%{transform-origin:center center;transform:rotate(-200deg);opacity:0}100%{transform-origin:center center;transform:rotate(0);opacity:1}}@keyframes rotateIn{0%{transform-origin:center center;transform:rotate(-200deg);opacity:0}100%{transform-origin:center center;transform:rotate(0);opacity:1}}@-moz-keyframes rotateInUpLeft{0%{transform-origin:left bottom;transform:rotate(90deg);opacity:0}100%{transform-origin:left bottom;transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInUpLeft{0%{transform-origin:left bottom;transform:rotate(90deg);opacity:0}100%{transform-origin:left bottom;transform:rotate(0);opacity:1}}@-o-keyframes rotateInUpLeft{0%{transform-origin:left bottom;transform:rotate(90deg);opacity:0}100%{transform-origin:left bottom;transform:rotate(0);opacity:1}}@keyframes rotateInUpLeft{0%{transform-origin:left bottom;transform:rotate(90deg);opacity:0}100%{transform-origin:left bottom;transform:rotate(0);opacity:1}}@-moz-keyframes rotateInDownLeft{0%{transform-origin:left bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:left bottom;transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInDownLeft{0%{transform-origin:left bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:left bottom;transform:rotate(0);opacity:1}}@-o-keyframes rotateInDownLeft{0%{transform-origin:left bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:left bottom;transform:rotate(0);opacity:1}}@keyframes rotateInDownLeft{0%{transform-origin:left bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:left bottom;transform:rotate(0);opacity:1}}@-moz-keyframes rotateInUpRight{0%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInUpRight{0%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}@-o-keyframes rotateInUpRight{0%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}@keyframes rotateInUpRight{0%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}@-moz-keyframes rotateInDownRight{0%{transform-origin:right bottom;transform:rotate(90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInDownRight{0%{transform-origin:right bottom;transform:rotate(90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}@-o-keyframes rotateInDownRight{0%{transform-origin:right bottom;transform:rotate(90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}@keyframes rotateInDownRight{0%{transform-origin:right bottom;transform:rotate(90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}@-moz-keyframes rotateOut{0%{transform-origin:center center;transform:rotate(0);opacity:1}100%{transform-origin:center center;transform:rotate(200deg);opacity:0}}@-webkit-keyframes rotateOut{0%{transform-origin:center center;transform:rotate(0);opacity:1}100%{transform-origin:center center;transform:rotate(200deg);opacity:0}}@-o-keyframes rotateOut{0%{transform-origin:center center;transform:rotate(0);opacity:1}100%{transform-origin:center center;transform:rotate(200deg);opacity:0}}@keyframes rotateOut{0%{transform-origin:center center;transform:rotate(0);opacity:1}100%{transform-origin:center center;transform:rotate(200deg);opacity:0}}@-moz-keyframes rotateOutUpLeft{0%{transform-origin:left bottom;transform:rotate(0);opacity:1}100%{-transform-origin:left bottom;-transform:rotate(-90deg);opacity:0}}@-webkit-keyframes rotateOutUpLeft{0%{transform-origin:left bottom;transform:rotate(0);opacity:1}100%{-transform-origin:left bottom;-transform:rotate(-90deg);opacity:0}}@-o-keyframes rotateOutUpLeft{0%{transform-origin:left bottom;transform:rotate(0);opacity:1}100%{-transform-origin:left bottom;-transform:rotate(-90deg);opacity:0}}@keyframes rotateOutUpLeft{0%{transform-origin:left bottom;transform:rotate(0);opacity:1}100%{-transform-origin:left bottom;-transform:rotate(-90deg);opacity:0}}@-moz-keyframes rotateOutDownLeft{0%{transform-origin:left bottom;transform:rotate(0);opacity:1}100%{transform-origin:left bottom;transform:rotate(90deg);opacity:0}}@-webkit-keyframes rotateOutDownLeft{0%{transform-origin:left bottom;transform:rotate(0);opacity:1}100%{transform-origin:left bottom;transform:rotate(90deg);opacity:0}}@-o-keyframes rotateOutDownLeft{0%{transform-origin:left bottom;transform:rotate(0);opacity:1} -100%{transform-origin:left bottom;transform:rotate(90deg);opacity:0}}@keyframes rotateOutDownLeft{0%{transform-origin:left bottom;transform:rotate(0);opacity:1}100%{transform-origin:left bottom;transform:rotate(90deg);opacity:0}}@-moz-keyframes rotateOutUpRight{0%{transform-origin:right bottom;transform:rotate(0);opacity:1}100%{transform-origin:right bottom;transform:rotate(90deg);opacity:0}}@-webkit-keyframes rotateOutUpRight{0%{transform-origin:right bottom;transform:rotate(0);opacity:1}100%{transform-origin:right bottom;transform:rotate(90deg);opacity:0}}@-o-keyframes rotateOutUpRight{0%{transform-origin:right bottom;transform:rotate(0);opacity:1}100%{transform-origin:right bottom;transform:rotate(90deg);opacity:0}}@keyframes rotateOutUpRight{0%{transform-origin:right bottom;transform:rotate(0);opacity:1}100%{transform-origin:right bottom;transform:rotate(90deg);opacity:0}}@-moz-keyframes rotateOutDownRight{0%{transform-origin:right bottom;transform:rotate(0);opacity:1}100%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}}@-webkit-keyframes rotateOutDownRight{0%{transform-origin:right bottom;transform:rotate(0);opacity:1}100%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}}@-o-keyframes rotateOutDownRight{0%{transform-origin:right bottom;transform:rotate(0);opacity:1}100%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}}@keyframes rotateOutDownRight{0%{transform-origin:right bottom;transform:rotate(0);opacity:1}100%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}}@-moz-keyframes lightSpeedIn{0%{transform:translateX(100%) skewX(-30deg);opacity:0}60%{transform:translateX(-20%) skewX(30deg);opacity:1}80%{transform:translateX(0%) skewX(-15deg);opacity:1}100%{transform:translateX(0%) skewX(0deg);opacity:1}}@-webkit-keyframes lightSpeedIn{0%{transform:translateX(100%) skewX(-30deg);opacity:0}60%{transform:translateX(-20%) skewX(30deg);opacity:1}80%{transform:translateX(0%) skewX(-15deg);opacity:1}100%{transform:translateX(0%) skewX(0deg);opacity:1}}@-o-keyframes lightSpeedIn{0%{transform:translateX(100%) skewX(-30deg);opacity:0}60%{transform:translateX(-20%) skewX(30deg);opacity:1}80%{transform:translateX(0%) skewX(-15deg);opacity:1}100%{transform:translateX(0%) skewX(0deg);opacity:1}}@keyframes lightSpeedIn{0%{transform:translateX(100%) skewX(-30deg);opacity:0}60%{transform:translateX(-20%) skewX(30deg);opacity:1}80%{transform:translateX(0%) skewX(-15deg);opacity:1}100%{transform:translateX(0%) skewX(0deg);opacity:1}}@-moz-keyframes lightSpeedOut{0%{transform:translateX(0%) skewX(0deg);opacity:1}100%{transform:translateX(100%) skewX(-30deg);opacity:0}}@-webkit-keyframes lightSpeedOut{0%{transform:translateX(0%) skewX(0deg);opacity:1}100%{transform:translateX(100%) skewX(-30deg);opacity:0}}@-o-keyframes lightSpeedOut{0%{transform:translateX(0%) skewX(0deg);opacity:1}100%{transform:translateX(100%) skewX(-30deg);opacity:0}}@keyframes lightSpeedOut{0%{transform:translateX(0%) skewX(0deg);opacity:1}100%{transform:translateX(100%) skewX(-30deg);opacity:0}}@-moz-keyframes hinge{0%{transform:rotate(0);transform-origin:top left;animation-timing-function:ease-in-out}20%,60%{transform:rotate(80deg);transform-origin:top left;animation-timing-function:ease-in-out}40%{transform:rotate(60deg);transform-origin:top left;animation-timing-function:ease-in-out}80%{transform:rotate(60deg) translateY(0);opacity:1;transform-origin:top left;animation-timing-function:ease-in-out}100%{transform:translateY(700px);opacity:0}}@-webkit-keyframes hinge{0%{transform:rotate(0);transform-origin:top left;animation-timing-function:ease-in-out}20%,60%{transform:rotate(80deg);transform-origin:top left;animation-timing-function:ease-in-out}40%{transform:rotate(60deg);transform-origin:top left;animation-timing-function:ease-in-out}80%{transform:rotate(60deg) translateY(0);opacity:1;transform-origin:top left;animation-timing-function:ease-in-out}100%{transform:translateY(700px);opacity:0}}@-o-keyframes hinge{0%{transform:rotate(0);transform-origin:top left;animation-timing-function:ease-in-out}20%,60%{transform:rotate(80deg);transform-origin:top left;animation-timing-function:ease-in-out}40%{transform:rotate(60deg);transform-origin:top left;animation-timing-function:ease-in-out}80%{transform:rotate(60deg) translateY(0);opacity:1;transform-origin:top left;animation-timing-function:ease-in-out}100%{transform:translateY(700px);opacity:0}}@keyframes hinge{0%{transform:rotate(0);transform-origin:top left;animation-timing-function:ease-in-out}20%,60%{transform:rotate(80deg);transform-origin:top left;animation-timing-function:ease-in-out}40%{transform:rotate(60deg);transform-origin:top left;animation-timing-function:ease-in-out}80%{transform:rotate(60deg) translateY(0);opacity:1;transform-origin:top left;animation-timing-function:ease-in-out}100%{transform:translateY(700px);opacity:0}}@-moz-keyframes rollIn{0%{opacity:0;transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;transform:translateX(0px) rotate(0deg)} -}@-webkit-keyframes rollIn{0%{opacity:0;transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;transform:translateX(0px) rotate(0deg)}}@-o-keyframes rollIn{0%{opacity:0;transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;transform:translateX(0px) rotate(0deg)}}@keyframes rollIn{0%{opacity:0;transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;transform:translateX(0px) rotate(0deg)}}@-moz-keyframes rollOut{0%{opacity:1;transform:translateX(0px) rotate(0deg)}100%{opacity:0;transform:translateX(100%) rotate(120deg)}}@-webkit-keyframes rollOut{0%{opacity:1;transform:translateX(0px) rotate(0deg)}100%{opacity:0;transform:translateX(100%) rotate(120deg)}}@-o-keyframes rollOut{0%{opacity:1;transform:translateX(0px) rotate(0deg)}100%{opacity:0;transform:translateX(100%) rotate(120deg)}}@keyframes rollOut{0%{opacity:1;transform:translateX(0px) rotate(0deg)}100%{opacity:0;transform:translateX(100%) rotate(120deg)}}.article-entry pre,.article-entry .highlight{background:#2d2d2d;padding:15px 20px;border-style:solid;border-color:#ddd;border-width:1px 0;overflow:auto;color:#ccc;line-height:22.400000000000002px}.article-entry .highlight .gutter pre,.article-entry .gist .gist-file .gist-data .line-numbers{color:#666;font-size:.85em}.article-entry pre,.article-entry code{font-family:"Source Code Pro",Consolas,Monaco,Menlo,Consolas,monospace}.article-entry code{background:#eee;text-shadow:0 1px #fff;padding:0 .3em}.article-entry pre code{background:0;text-shadow:none;padding:0}.article-entry .highlight pre{border:0;margin:10;padding:0}.article-entry .highlight table{margin:0;width:auto}.article-entry .highlight td{border:0;padding:0}.article-entry .highlight figcaption{font-size:.85em;color:#999;line-height:1em;margin-bottom:1em}.article-entry .highlight figcaption a{float:right}.article-entry .highlight .gutter pre{text-align:right;padding-right:20px}.article-entry .highlight .line{height:22.400000000000002px}.article-entry .gist{margin:0 -20px;border-style:solid;border-color:#ddd;border-width:1px 0;background:#2d2d2d;padding:15px 20px 15px 0}.article-entry .gist .gist-file{border:0;font-family:"Source Code Pro",Consolas,Monaco,Menlo,Consolas,monospace;margin:0}.article-entry .gist .gist-file .gist-data{background:0;border:0}.article-entry .gist .gist-file .gist-data .line-numbers{background:0;border:0;padding:0 20px 0 0}.article-entry .gist .gist-file .gist-data .line-data{padding:0!important}.article-entry .gist .gist-file .highlight{margin:0;padding:0;border:0}.article-entry .gist .gist-file .gist-meta{background:#2d2d2d;color:#999;font:.85em "Helvetica Neue",Helvetica,Arial,sans-serif;text-shadow:0;padding:0;margin-top:1em;margin-left:20px}.article-entry .gist .gist-file .gist-meta a{color:#258fb8;font-weight:normal}.article-entry .gist .gist-file .gist-meta a:hover{text-decoration:underline}pre .comment,pre .title{color:#999}pre .variable,pre .attribute,pre .tag,pre .regexp,pre .ruby .constant,pre .xml .tag .title,pre .xml .pi,pre .xml .doctype,pre .html .doctype,pre .css .id,pre .css .class,pre .css .pseudo{color:#f2777a}pre .number,pre .preprocessor,pre .built_in,pre .literal,pre .params,pre .constant{color:#f99157}pre .class,pre .ruby .class .title,pre .css .rules .attribute{color:#9c9}pre .string,pre .value,pre .inheritance,pre .header,pre .ruby .symbol,pre .xml .cdata{color:#9c9}pre .css .hexcolor{color:#6cc}pre .function,pre .python .decorator,pre .python .title,pre .ruby .function .title,pre .ruby .title .keyword,pre .perl .sub,pre .javascript .title,pre .coffeescript .title{color:#69c}pre .keyword,pre .javascript .function{color:#c9c}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after{content:"";content:none}q:before,q:after{content:"";content:none}figure table{border-collapse:collapse;border-spacing:0;width:100%;table-layout:fixed;text-align:left;border-width:0;margin:auto}figure th,figure td{padding:0}body{width:100%;*zoom:1}body:before,body:after{content:"";display:table}body:after{clear:both}html,body{height:100%}html{height:100%;max-height:100%}body{font-family:"ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;font-size:1em;color:#666;-webkit-font-smoothing:antialiased} -::selection{background:rgba(37,104,163,0.2)}::-moz-selection{background:rgba(37,104,163,0.2)}a{text-decoration:none;color:#4e97d8}a:hover{color:#4e97d8;-o-transition:.5s;-ms-transition:.5s;-moz-transition:.5s;-webkit-transition:.5s}h1,h2,h3,h4,h5{margin-top:1em;margin-bottom:.5em;font-family:"ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;font-weight:lighter;color:#333;-webkit-font-smoothing:antialiased}h1{margin-top:0;font-size:2.5em;line-height:1.2em;letter-spacing:.05em}h2{font-size:2em}h3{font-size:1.6em}h4{font-size:1.2em}h4{font-size:1.1em}h5{font-size:1em}p{margin-bottom:1.3em;line-height:1.7em}strong{font-weight:bold}em{font-style:italic}blockquote{padding:10px 20px;margin:0 0 20px;font-family:"ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;font-weight:lighter;font-size:1em;border-left:3px solid #4e97d8}blockquote p:last-child{margin-bottom:0}ol,ul{margin:0 0 1.3em 2.5em}ol li,ul li{margin:0 0 .2em 0;line-height:1.6em}ol ol,ol ul,ul ol,ul ul{margin:.1em 0 .2em 2em}ol{list-style-type:decimal}ul{list-style-type:disc}code{padding:.1em .4em;background:#e8f2fb;border:1px solid #c9e1f6;border-radius:3px;font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;font-size:.9em;vertical-align:bottom;word-wrap:break-word}pre{margin-bottom:1.3em;padding:1em 2.5%;background:#e8f2fb;border:1px solid #c9e1f6;border-radius:3px;font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;font-size:.9em;font-weight:normal;line-height:1.7em;overflow:scroll}pre code{padding:0;background:0;border:0;word-wrap:normal}table{color:#333;font-size:.9em;text-align:center;line-height:40px;border-spacing:0;border:2px solid #4e97d8;width:90%;margin:50px auto}thead tr:first-child{background-color:#4e97d8;color:#f8f8f8;border:0}th{font-weight:bold}th,td{padding:0 8px 0 8px}thead tr:last-child th{border-bottom:1px solid #ddd}tbody tr:last-child td{border:0}tbody td{border-bottom:1px solid #ddd;font-size:.9em}.date,.time,.author,.tags{font-size:.8em;color:#c7c7c7}.date a,.time a,.author a,.tags a{color:#666}.date a:hover,.time a:hover,.author a:hover,.tags a:hover{color:#4e97d8}.excerpt{margin:0;font-size:.9em;color:#999}.intro{font-family:"ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;font-size:1.2em;font-weight:lighter;color:#999}.block-heading{display:inline;float:left;width:940px;margin:0 10px;position:relative;bottom:-15px;font-size:.8em;font-weight:bold;text-align:center;text-transform:uppercase;letter-spacing:1px}.label{position:relative;display:inline-block;padding:8px 18px 9px 18px;background:#4e97d8;border-radius:3px;text-align:center;color:#fff}.container{position:relative;z-index:500;width:940px;margin:0 auto}.content-wrapper{z-index:800;width:70%;margin-left:30%}.content-wrapper__inner{margin:0 10%;padding:50px 0}.footer{display:block;padding:2em 0 0 0;border-top:2px solid #ddd;font-size:.7em;color:#b3b3b3}.footer__copyright{display:block;margin-bottom:.7em}.footer__copyright a{color:#a6a6a6;text-decoration:underline}.footer__copyright a:hover{color:#4e97d8}.avatar,.logo{border-radius:50%;border:3px solid #fff;box-shadow:0 0 1px 1px rgba(0,0,0,0.3)}hr{border:0}.section-title__divider{width:30%;margin:2.2em 0 2.1em 0;border-top:1px solid #ddd}.hidden{display:none!important}.panel{display:table;width:100%;height:100%}.panel__vertical{display:table-cell;vertical-align:middle}.panel-title{font-family:"Old English Text MT","Engravers' Old English BT","Lato","PingFang SC","Microsoft YaHei",sans-serif;margin:0 0 5px 0;font-size:2.5em;color:#fff}.panel-subtitle{font-family:"ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;font-size:1.2em;font-weight:lighter;letter-spacing:3px;color:#ccc;-webkit-font-smoothing:antialiased}.iUp{opacity:0;-webkit-transform:translate3d(0,80px,0);-moz-transform:translate3d(0,80px,0);-ms-transform:translate3d(0,80px,0);-o-transform:translate3d(0,80px,0);transform:translate3d(0,80px,0);-webkit-transition:all 2s cubic-bezier(0.19,1,0.22,1);-moz-transition:all 2s cubic-bezier(0.19,1,0.22,1);transition:all 2s cubic-bezier(0.19,1,0.22,1)} -.iUp.up{opacity:1;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.panel-cover{display:block;position:fixed;z-index:900;width:100%;max-width:none;height:100%;background:center center no-repeat #666;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition:width .6s ease;-moz-transition:width .6s ease;transition:width .6s ease}.panel-cover--collapsed{width:30%}.panel-cover--collapsed .iUp{-webkit-transition:all 0 cubic-bezier(0.19,1,0.22,1);-moz-transition:all 0 cubic-bezier(0.19,1,0.22,1);transition:all 0 cubic-bezier(0.19,1,0.22,1)}.panel-cover--overlay{display:block;position:absolute;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1;-moz-opacity:.55;opacity:.55}.panel-cover__logo{margin-bottom:.2em}.panel-cover__description{margin:0 30px}.panel-cover__divider{width:50%;margin:20px auto;border-top:1px solid rgba(255,255,255,0.14)}.panel-cover__divider--secondary{width:15%}.panel-main{display:table;width:100%;height:100%}.panel-main__inner{display:table-cell;vertical-align:middle;position:relative;z-index:800;padding:0 60px}.panel-main__content{max-width:620px;margin:0 auto}.panel-main__content--fixed{width:480px;transition:width 1s;-webkit-transition:width 1s}.panel-inverted{font-weight:100;text-align:center;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,0.4)}.panel-inverted a{color:#fff}.cover-navigation{margin-top:42px}.cover-navigation--social{margin-left:30px}.btn,.navigation__item a{padding:10px 20px;border:1px solid #4e97d8;border-radius:20px;font-size:.9em;font-weight:bold;letter-spacing:1px;text-shadow:none;color:#4e97d8;-webkit-font-smoothing:antialiased}.btn:hover,.navigation__item a:hover{color:#4e97d8;border-color:#4e97d8}.btn-border-small{border:1px solid #4e97d8;border-radius:20px;padding:6px 8px;font-size:.8em;margin-left:10px}.btn-secondary{border-color:#5ba4e5;color:#5ba4e5}.btn-secondary:hover{color:#217fd2;border-color:#217fd2}.btn-tertiary{border-color:#999;color:#999}.btn-tertiary:hover{color:#737373;border-color:#737373}.btn-large{padding:10px 24px;font-size:1.1em}.btn-small{padding:8px 12px;font-size:.7em}.btn-mobile-menu{display:none;position:fixed;z-index:9999;top:0;right:0;left:0;width:100%;height:35px;background:rgba(51,51,51,0.98);border-bottom:1px solid rgba(255,255,255,0.1);text-align:center}.btn-mobile-menu__icon,.btn-mobile-close__icon{position:relative;top:10px;color:#fff}nav{display:inline-block;position:relative}.navigation{display:inline-block;float:left;position:relative;margin:0;list-style-type:none}.navigation__item{display:inline-block;margin:5px 1px 0 0;line-height:1em}.navigation__item a{display:block;position:relative;border-color:#fff;color:#fff;opacity:.8}.navigation__item a:hover{color:#fff;border-color:#fff;opacity:1}.navigation--social a{border:0;padding:6px 8px 6px 9px}.navigation--social a .label{display:none}.navigation--social a .icon{display:block;font-size:1.7em}.pagination{display:block;margin:0 0 4em 0}.pagination__page-number{margin:0;font-size:.8em;color:#999}.pagination__newer{margin-right:1em}.pagination__older{margin-left:1em}i{font-family:"entypo";font-weight:normal;font-style:normal;font-size:18px}.social{font-size:22px}.icon-social{font-family:"entypo-social";font-size:22px;display:block;position:relative}*:focus{outline:0}@media all and (max-width:1100px){.panel-cover__logo{width:70px}.panel-title{font-size:2em}.panel-subtitle{font-size:1em}.panel-cover__description{margin:0 10px;font-size:.9em}.navigation--social{margin-top:5px;margin-left:0}}@media all and (max-width:960px){.btn-mobile-menu{display:block}.panel-main{display:table;position:relative}.panel-cover--collapsed{width:100%;max-width:none}.panel-main__inner{display:table-cell;padding:60px 10%}.panel-cover__description{display:block;max-width:600px;margin:0 auto}.panel-cover__divider--secondary{display:none}.panel-cover{width:100%;height:100%;background-position:center center}.panel-cover.panel-cover--collapsed{display:block;position:relative;height:auto;padding:0;background-position:center center}.panel-cover.panel-cover--collapsed .panel-main__inner{display:block;padding:70px 0 30px 0}.panel-cover.panel-cover--collapsed .panel-cover__logo{width:60px;border-width:2px}.panel-cover.panel-cover--collapsed .panel-cover__description{display:none}.panel-cover.panel-cover--collapsed .panel-cover__divider{display:none;margin:1em auto}.navigation-wrapper{display:none;position:fixed;top:0;right:0;left:0;width:100%;padding:20px 0;background:rgba(51,51,51,0.98);border-bottom:1px solid rgba(255,255,255,0.15)}.navigation-wrapper.visible{display:block}.cover-navigation{display:block;position:relative;float:left;clear:left;width:100%} -.cover-navigation .navigation{display:block;width:100%}.cover-navigation .navigation li{width:80%;margin-bottom:.4em}.cover-navigation.navigation--social{padding-top:5px}.cover-navigation.navigation--social .navigation li{display:inline-block;width:20%}.content-wrapper{width:80%;max-width:none;margin:0 auto}.content-wrapper__inner{margin-right:0;margin-left:0}.navigation__item{width:100%;margin:0 0 .4em 0}}@media all and (max-width:340px){.panel-main__inner{padding:0 5%}.panel-title{margin-bottom:.1em;font-size:1.5em}.panel-subtitle{font-size:.9em}.btn,.navigation__item a{display:block;margin-bottom:.4em}}.remark{position:absolute;z-index:900;bottom:0;right:5px;text-align:center;color:#fff;opacity:.6!important;padding-bottom:3px;padding-right:18px;letter-spacing:-3px;font-size:0}@media screen and (max-width:960px){.remark{display:none}}.power{display:inline-block;color:#fff!important;letter-spacing:0;font-size:10px;line-height:16px;margin:0;vertical-align:middle}.beian{position:absolute;z-index:900;bottom:0;right:5px;text-align:center;color:#fff;opacity:.25!important;padding-bottom:3px;letter-spacing:-3px;font-size:0}.gwab,.icp{display:inline-block;color:#fff!important;letter-spacing:0;font-size:10px;line-height:16px;margin:0;vertical-align:middle}.gwab{background:url(/img/beian.png) no-repeat;background-size:12px 12px;background-position:3px 2px;padding-left:18px}@-webkit-keyframes btnGroups{0%{-webkit-transform:scale(1.2,0.8)}1%{-webkit-transform:scale(1.18,0.82)}2%{-webkit-transform:scale(1.16,0.84)}3%{-webkit-transform:scale(1.13,0.87)}4%{-webkit-transform:scale(1.1,0.9)}5%{-webkit-transform:scale(1.07,0.93)}6%{-webkit-transform:scale(1.04,0.96)}7%{-webkit-transform:scale(1.01,0.99)}8%{-webkit-transform:scale(0.99,1.01)}9%{-webkit-transform:scale(0.97,1.03)}10%{-webkit-transform:scale(0.95,1.05)}11%{-webkit-transform:scale(0.94,1.06)}12%{-webkit-transform:scale(0.93,1.07)}13%{-webkit-transform:scale(0.93,1.07)}14%{-webkit-transform:scale(0.93,1.07)}15%{-webkit-transform:scale(0.93,1.07)}16%{-webkit-transform:scale(0.94,1.06)}17%{-webkit-transform:scale(0.94,1.06)}18%{-webkit-transform:scale(0.95,1.05)}19%{-webkit-transform:scale(0.96,1.04)}20%{-webkit-transform:scale(0.98,1.02)}21%{-webkit-transform:scale(0.99,1.01)}22%{-webkit-transform:scale(1,1)}23%{-webkit-transform:scale(1,1)}24%{-webkit-transform:scale(1.01,0.99)}25%{-webkit-transform:scale(1.02,0.98)}26%{-webkit-transform:scale(1.02,0.98)}27%{-webkit-transform:scale(1.02,0.98)}28%{-webkit-transform:scale(1.03,0.97)}29%{-webkit-transform:scale(1.03,0.97)}30%{-webkit-transform:scale(1.02,0.98)}31%{-webkit-transform:scale(1.02,0.98)}32%{-webkit-transform:scale(1.02,0.98)}33%{-webkit-transform:scale(1.02,0.98)}34%{-webkit-transform:scale(1.01,0.99)}35%{-webkit-transform:scale(1.01,0.99)}36%{-webkit-transform:scale(1.01,0.99)}37%{-webkit-transform:scale(1,1)}38%{-webkit-transform:scale(1,1)}39%{-webkit-transform:scale(1,1)}40%{-webkit-transform:scale(0.99,1.01)}41%{-webkit-transform:scale(0.99,1.01)}42%{-webkit-transform:scale(0.99,1.01)}43%{-webkit-transform:scale(0.99,1.01)}44%{-webkit-transform:scale(0.99,1.01)}45%{-webkit-transform:scale(0.99,1.01)}46%{-webkit-transform:scale(0.99,1.01)}47%{-webkit-transform:scale(0.99,1.01)}48%{-webkit-transform:scale(0.99,1.01)}49%{-webkit-transform:scale(1,1)}}@-moz-keyframes btnGroups{0%{-webkit-transform:scale(1.2,0.8);-moz-transform:scale(1.2,0.8);-ms-transform:scale(1.2,0.8);transform:scale(1.2,0.8)}1%{-webkit-transform:scale(1.18,0.82);-moz-transform:scale(1.18,0.82);-ms-transform:scale(1.18,0.82);transform:scale(1.18,0.82)}2%{-webkit-transform:scale(1.16,0.84);-moz-transform:scale(1.16,0.84);-ms-transform:scale(1.16,0.84);transform:scale(1.16,0.84)}3%{-webkit-transform:scale(1.13,0.87);-moz-transform:scale(1.13,0.87);-ms-transform:scale(1.13,0.87);transform:scale(1.13,0.87)}4%{-webkit-transform:scale(1.1,0.9);-moz-transform:scale(1.1,0.9);-ms-transform:scale(1.1,0.9);transform:scale(1.1,0.9)}5%{-webkit-transform:scale(1.07,0.93);-moz-transform:scale(1.07,0.93);-ms-transform:scale(1.07,0.93);transform:scale(1.07,0.93)}6%{-webkit-transform:scale(1.04,0.96);-moz-transform:scale(1.04,0.96);-ms-transform:scale(1.04,0.96);transform:scale(1.04,0.96)}7%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}8%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}9%{-webkit-transform:scale(0.97,1.03);-moz-transform:scale(0.97,1.03);-ms-transform:scale(0.97,1.03);transform:scale(0.97,1.03)}10%{-webkit-transform:scale(0.95,1.05);-moz-transform:scale(0.95,1.05);-ms-transform:scale(0.95,1.05);transform:scale(0.95,1.05)}11%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}12%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}13%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)} -14%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}15%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}16%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}17%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}18%{-webkit-transform:scale(0.95,1.05);-moz-transform:scale(0.95,1.05);-ms-transform:scale(0.95,1.05);transform:scale(0.95,1.05)}19%{-webkit-transform:scale(0.96,1.04);-moz-transform:scale(0.96,1.04);-ms-transform:scale(0.96,1.04);transform:scale(0.96,1.04)}20%{-webkit-transform:scale(0.98,1.02);-moz-transform:scale(0.98,1.02);-ms-transform:scale(0.98,1.02);transform:scale(0.98,1.02)}21%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}22%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}23%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}24%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}25%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}26%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}27%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}28%{-webkit-transform:scale(1.03,0.97);-moz-transform:scale(1.03,0.97);-ms-transform:scale(1.03,0.97);transform:scale(1.03,0.97)}29%{-webkit-transform:scale(1.03,0.97);-moz-transform:scale(1.03,0.97);-ms-transform:scale(1.03,0.97);transform:scale(1.03,0.97)}30%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}31%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}32%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}33%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}34%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}35%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}36%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}37%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}38%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}39%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}40%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}41%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}42%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}43%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}44%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}45%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}46%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}47%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}48%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}49%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}}@-webkit-keyframes btnGroups{0%{-webkit-transform:scale(1.2,0.8);-moz-transform:scale(1.2,0.8);-ms-transform:scale(1.2,0.8);transform:scale(1.2,0.8)}1%{-webkit-transform:scale(1.18,0.82);-moz-transform:scale(1.18,0.82);-ms-transform:scale(1.18,0.82);transform:scale(1.18,0.82)}2%{-webkit-transform:scale(1.16,0.84);-moz-transform:scale(1.16,0.84);-ms-transform:scale(1.16,0.84);transform:scale(1.16,0.84)}3%{-webkit-transform:scale(1.13,0.87);-moz-transform:scale(1.13,0.87);-ms-transform:scale(1.13,0.87);transform:scale(1.13,0.87)} -4%{-webkit-transform:scale(1.1,0.9);-moz-transform:scale(1.1,0.9);-ms-transform:scale(1.1,0.9);transform:scale(1.1,0.9)}5%{-webkit-transform:scale(1.07,0.93);-moz-transform:scale(1.07,0.93);-ms-transform:scale(1.07,0.93);transform:scale(1.07,0.93)}6%{-webkit-transform:scale(1.04,0.96);-moz-transform:scale(1.04,0.96);-ms-transform:scale(1.04,0.96);transform:scale(1.04,0.96)}7%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}8%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}9%{-webkit-transform:scale(0.97,1.03);-moz-transform:scale(0.97,1.03);-ms-transform:scale(0.97,1.03);transform:scale(0.97,1.03)}10%{-webkit-transform:scale(0.95,1.05);-moz-transform:scale(0.95,1.05);-ms-transform:scale(0.95,1.05);transform:scale(0.95,1.05)}11%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}12%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}13%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}14%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}15%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}16%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}17%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}18%{-webkit-transform:scale(0.95,1.05);-moz-transform:scale(0.95,1.05);-ms-transform:scale(0.95,1.05);transform:scale(0.95,1.05)}19%{-webkit-transform:scale(0.96,1.04);-moz-transform:scale(0.96,1.04);-ms-transform:scale(0.96,1.04);transform:scale(0.96,1.04)}20%{-webkit-transform:scale(0.98,1.02);-moz-transform:scale(0.98,1.02);-ms-transform:scale(0.98,1.02);transform:scale(0.98,1.02)}21%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}22%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}23%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}24%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}25%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}26%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}27%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}28%{-webkit-transform:scale(1.03,0.97);-moz-transform:scale(1.03,0.97);-ms-transform:scale(1.03,0.97);transform:scale(1.03,0.97)}29%{-webkit-transform:scale(1.03,0.97);-moz-transform:scale(1.03,0.97);-ms-transform:scale(1.03,0.97);transform:scale(1.03,0.97)}30%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}31%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}32%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}33%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}34%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}35%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}36%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}37%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}38%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}39%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}40%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}41%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}42%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}43%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)} -44%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}45%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}46%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}47%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}48%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}49%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}}@-o-keyframes btnGroups{0%{-webkit-transform:scale(1.2,0.8);-moz-transform:scale(1.2,0.8);-ms-transform:scale(1.2,0.8);transform:scale(1.2,0.8)}1%{-webkit-transform:scale(1.18,0.82);-moz-transform:scale(1.18,0.82);-ms-transform:scale(1.18,0.82);transform:scale(1.18,0.82)}2%{-webkit-transform:scale(1.16,0.84);-moz-transform:scale(1.16,0.84);-ms-transform:scale(1.16,0.84);transform:scale(1.16,0.84)}3%{-webkit-transform:scale(1.13,0.87);-moz-transform:scale(1.13,0.87);-ms-transform:scale(1.13,0.87);transform:scale(1.13,0.87)}4%{-webkit-transform:scale(1.1,0.9);-moz-transform:scale(1.1,0.9);-ms-transform:scale(1.1,0.9);transform:scale(1.1,0.9)}5%{-webkit-transform:scale(1.07,0.93);-moz-transform:scale(1.07,0.93);-ms-transform:scale(1.07,0.93);transform:scale(1.07,0.93)}6%{-webkit-transform:scale(1.04,0.96);-moz-transform:scale(1.04,0.96);-ms-transform:scale(1.04,0.96);transform:scale(1.04,0.96)}7%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}8%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}9%{-webkit-transform:scale(0.97,1.03);-moz-transform:scale(0.97,1.03);-ms-transform:scale(0.97,1.03);transform:scale(0.97,1.03)}10%{-webkit-transform:scale(0.95,1.05);-moz-transform:scale(0.95,1.05);-ms-transform:scale(0.95,1.05);transform:scale(0.95,1.05)}11%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}12%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}13%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}14%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}15%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}16%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}17%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}18%{-webkit-transform:scale(0.95,1.05);-moz-transform:scale(0.95,1.05);-ms-transform:scale(0.95,1.05);transform:scale(0.95,1.05)}19%{-webkit-transform:scale(0.96,1.04);-moz-transform:scale(0.96,1.04);-ms-transform:scale(0.96,1.04);transform:scale(0.96,1.04)}20%{-webkit-transform:scale(0.98,1.02);-moz-transform:scale(0.98,1.02);-ms-transform:scale(0.98,1.02);transform:scale(0.98,1.02)}21%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}22%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}23%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}24%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}25%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}26%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}27%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}28%{-webkit-transform:scale(1.03,0.97);-moz-transform:scale(1.03,0.97);-ms-transform:scale(1.03,0.97);transform:scale(1.03,0.97)}29%{-webkit-transform:scale(1.03,0.97);-moz-transform:scale(1.03,0.97);-ms-transform:scale(1.03,0.97);transform:scale(1.03,0.97)}30%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}31%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}32%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}33%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)} -34%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}35%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}36%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}37%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}38%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}39%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}40%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}41%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}42%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}43%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}44%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}45%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}46%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}47%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}48%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}49%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}}@keyframes btnGroups{0%{-webkit-transform:scale(1.2,0.8);-moz-transform:scale(1.2,0.8);-ms-transform:scale(1.2,0.8);transform:scale(1.2,0.8)}1%{-webkit-transform:scale(1.18,0.82);-moz-transform:scale(1.18,0.82);-ms-transform:scale(1.18,0.82);transform:scale(1.18,0.82)}2%{-webkit-transform:scale(1.16,0.84);-moz-transform:scale(1.16,0.84);-ms-transform:scale(1.16,0.84);transform:scale(1.16,0.84)}3%{-webkit-transform:scale(1.13,0.87);-moz-transform:scale(1.13,0.87);-ms-transform:scale(1.13,0.87);transform:scale(1.13,0.87)}4%{-webkit-transform:scale(1.1,0.9);-moz-transform:scale(1.1,0.9);-ms-transform:scale(1.1,0.9);transform:scale(1.1,0.9)}5%{-webkit-transform:scale(1.07,0.93);-moz-transform:scale(1.07,0.93);-ms-transform:scale(1.07,0.93);transform:scale(1.07,0.93)}6%{-webkit-transform:scale(1.04,0.96);-moz-transform:scale(1.04,0.96);-ms-transform:scale(1.04,0.96);transform:scale(1.04,0.96)}7%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}8%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}9%{-webkit-transform:scale(0.97,1.03);-moz-transform:scale(0.97,1.03);-ms-transform:scale(0.97,1.03);transform:scale(0.97,1.03)}10%{-webkit-transform:scale(0.95,1.05);-moz-transform:scale(0.95,1.05);-ms-transform:scale(0.95,1.05);transform:scale(0.95,1.05)}11%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}12%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}13%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}14%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}15%{-webkit-transform:scale(0.93,1.07);-moz-transform:scale(0.93,1.07);-ms-transform:scale(0.93,1.07);transform:scale(0.93,1.07)}16%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}17%{-webkit-transform:scale(0.94,1.06);-moz-transform:scale(0.94,1.06);-ms-transform:scale(0.94,1.06);transform:scale(0.94,1.06)}18%{-webkit-transform:scale(0.95,1.05);-moz-transform:scale(0.95,1.05);-ms-transform:scale(0.95,1.05);transform:scale(0.95,1.05)}19%{-webkit-transform:scale(0.96,1.04);-moz-transform:scale(0.96,1.04);-ms-transform:scale(0.96,1.04);transform:scale(0.96,1.04)}20%{-webkit-transform:scale(0.98,1.02);-moz-transform:scale(0.98,1.02);-ms-transform:scale(0.98,1.02);transform:scale(0.98,1.02)}21%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}22%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}23%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)} -24%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}25%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}26%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}27%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}28%{-webkit-transform:scale(1.03,0.97);-moz-transform:scale(1.03,0.97);-ms-transform:scale(1.03,0.97);transform:scale(1.03,0.97)}29%{-webkit-transform:scale(1.03,0.97);-moz-transform:scale(1.03,0.97);-ms-transform:scale(1.03,0.97);transform:scale(1.03,0.97)}30%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}31%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}32%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}33%{-webkit-transform:scale(1.02,0.98);-moz-transform:scale(1.02,0.98);-ms-transform:scale(1.02,0.98);transform:scale(1.02,0.98)}34%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}35%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}36%{-webkit-transform:scale(1.01,0.99);-moz-transform:scale(1.01,0.99);-ms-transform:scale(1.01,0.99);transform:scale(1.01,0.99)}37%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}38%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}39%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}40%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}41%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}42%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}43%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}44%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}45%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}46%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}47%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}48%{-webkit-transform:scale(0.99,1.01);-moz-transform:scale(0.99,1.01);-ms-transform:scale(0.99,1.01);transform:scale(0.99,1.01)}49%{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1)}} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.eot b/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.eot deleted file mode 100644 index 09b6df61..00000000 Binary files a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.eot and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.svg b/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.svg deleted file mode 100644 index 72f7b9d6..00000000 --- a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.svg +++ /dev/null @@ -1,963 +0,0 @@ - - - - -Created by FontForge 20120731 at Wed Jul 10 02:09:32 2019 - By www -Copyright 1990-2003 Bitstream Inc. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.ttf b/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.ttf deleted file mode 100644 index e669e665..00000000 Binary files a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.ttf and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff b/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff deleted file mode 100644 index 70f4359e..00000000 Binary files a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff2 b/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff2 deleted file mode 100644 index e8836566..00000000 Binary files a/ruoyi-admin/src/main/resources/static/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff2 and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/img/logo.jpg b/ruoyi-admin/src/main/resources/static/assets/img/logo.jpg deleted file mode 100644 index a19036b6..00000000 Binary files a/ruoyi-admin/src/main/resources/static/assets/img/logo.jpg and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/img/logo1.jpg b/ruoyi-admin/src/main/resources/static/assets/img/logo1.jpg deleted file mode 100644 index 774772fc..00000000 Binary files a/ruoyi-admin/src/main/resources/static/assets/img/logo1.jpg and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/img/logo2.jpg b/ruoyi-admin/src/main/resources/static/assets/img/logo2.jpg deleted file mode 100644 index 421bf881..00000000 Binary files a/ruoyi-admin/src/main/resources/static/assets/img/logo2.jpg and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/img/logo3.jpg b/ruoyi-admin/src/main/resources/static/assets/img/logo3.jpg deleted file mode 100644 index df545864..00000000 Binary files a/ruoyi-admin/src/main/resources/static/assets/img/logo3.jpg and /dev/null differ diff --git a/ruoyi-admin/src/main/resources/static/assets/js/bing.js b/ruoyi-admin/src/main/resources/static/assets/js/bing.js deleted file mode 100644 index 5700f389..00000000 --- a/ruoyi-admin/src/main/resources/static/assets/js/bing.js +++ /dev/null @@ -1,38 +0,0 @@ -const https = require('https') -const fs = require('fs') - -const options = { - hostname: 'www.bing.com', - port: 443, - path: '/HPImageArchive.aspx?format=js&idx=0&n=8', - method: 'GET' -} - -const req = https.request(options, bing_res => { - let bing_body = [], bing_data = {}; - bing_res.on('data', (chunk) => { - bing_body.push(chunk); - }); - bing_res.on('end', () => { - bing_body = Buffer.concat(bing_body); - bing_data = JSON.parse(bing_body.toString()); - let img_array = bing_data.images; - let img_url = []; - img_array.forEach(img => { - img_url.push(img.url); - }); - var jsonpStr = "getBingImages(" + JSON.stringify(img_url) + ")"; - fs.writeFile('./assets/json/images.json', jsonpStr, (err) => { - if (err) { - throw err; - } - console.log("JSON data is saved: " + jsonpStr); - }); - }); -}) - -req.on('error', error => { - console.error(error) -}) - -req.end() \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/assets/js/main.js b/ruoyi-admin/src/main/resources/static/assets/js/main.js deleted file mode 100644 index a5ead0ce..00000000 --- a/ruoyi-admin/src/main/resources/static/assets/js/main.js +++ /dev/null @@ -1,104 +0,0 @@ -var iUp = (function () { - var time = 0, - duration = 150, - clean = function () { - time = 0; - }, - up = function (element) { - setTimeout(function () { - element.classList.add("up"); - }, time); - time += duration; - }, - down = function (element) { - element.classList.remove("up"); - }, - toggle = function (element) { - setTimeout(function () { - element.classList.toggle("up"); - }, time); - time += duration; - }; - return { - clean: clean, - up: up, - down: down, - toggle: toggle - }; -})(); - -function getBingImages(imgUrls) { - /** - * 获取Bing壁纸 - * 先使用 GitHub Action 每天获取 Bing 壁纸 URL 并更新 images.json 文件 - * 然后读取 images.json 文件中的数据 - */ - var indexName = "bing-image-index"; - var index = sessionStorage.getItem(indexName); - var panel = document.querySelector('#panel'); - if (isNaN(index) || index == 7) index = 0; - else index++; - var imgUrl = imgUrls[index]; - var url = "https://www.cn.bing.com" + imgUrl; - panel.style.background = "url('" + url + "') center center no-repeat #666"; - panel.style.backgroundSize = "cover"; - sessionStorage.setItem(indexName, index); -} - -function decryptEmail(encoded) { - var address = atob(encoded); - window.location.href = "mailto:" + address; -} - -document.addEventListener('DOMContentLoaded', function () { - // 获取一言数据 - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (this.readyState == 4 && this.status == 200) { - var res = JSON.parse(this.responseText); - document.getElementById('description').innerHTML = res.hitokoto + "
-「" + res.from + "」"; - } - }; - xhr.open("GET", "https://v1.hitokoto.cn", true); - xhr.send(); - - var iUpElements = document.querySelectorAll(".iUp"); - iUpElements.forEach(function (element) { - iUp.up(element); - }); - - var avatarElement = document.querySelector(".js-avatar"); - avatarElement.addEventListener('load', function () { - avatarElement.classList.add("show"); - }); -}); - -var btnMobileMenu = document.querySelector('.btn-mobile-menu__icon'); -var navigationWrapper = document.querySelector('.navigation-wrapper'); - -btnMobileMenu.addEventListener('click', function () { - if (navigationWrapper.style.display == "block") { - navigationWrapper.addEventListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { - navigationWrapper.classList.toggle('visible'); - navigationWrapper.classList.toggle('animated'); - navigationWrapper.classList.toggle('bounceOutUp'); - navigationWrapper.removeEventListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', arguments.callee); - }); - navigationWrapper.classList.toggle('animated'); - navigationWrapper.classList.toggle('bounceInDown'); - navigationWrapper.classList.toggle('animated'); - navigationWrapper.classList.toggle('bounceOutUp'); - } else { - navigationWrapper.classList.toggle('visible'); - navigationWrapper.classList.toggle('animated'); - navigationWrapper.classList.toggle('bounceInDown'); - } - btnMobileMenu.classList.toggle('social'); - btnMobileMenu.classList.toggle('iconfont'); - btnMobileMenu.classList.toggle('icon-list'); - btnMobileMenu.classList.toggle('social'); - btnMobileMenu.classList.toggle('iconfont'); - btnMobileMenu.classList.toggle('icon-angleup'); - btnMobileMenu.classList.toggle('animated'); - btnMobileMenu.classList.toggle('fadeIn'); -}); diff --git a/ruoyi-admin/src/main/resources/static/assets/json/images.json b/ruoyi-admin/src/main/resources/static/assets/json/images.json deleted file mode 100644 index dd176a45..00000000 --- a/ruoyi-admin/src/main/resources/static/assets/json/images.json +++ /dev/null @@ -1 +0,0 @@ -getBingImages(["/th?id=OHR.TheRoachesPeakDistrict_EN-US9733115206_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.SanMiguelAllende_EN-US9621237021_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.JediMonastery_EN-US9398447907_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.SonoranSpring_EN-US9207877073_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.CratersOfTheMoon_EN-US6516727783_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.HawaiianLei_EN-US6290126556_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.CheetahRain_EN-US6179670004_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.TulouFujian_EN-US6009679228_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp"]) \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/assets/svg/favicon.svg b/ruoyi-admin/src/main/resources/static/assets/svg/favicon.svg deleted file mode 100644 index 700dfc45..00000000 --- a/ruoyi-admin/src/main/resources/static/assets/svg/favicon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ruoyi-admin/src/test/java/com/xmzs/test/AssertUnitTest.java b/ruoyi-admin/src/test/java/com/xmzs/test/AssertUnitTest.java deleted file mode 100644 index 6d1f14ab..00000000 --- a/ruoyi-admin/src/test/java/com/xmzs/test/AssertUnitTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.xmzs.test; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -/** - * 断言单元测试案例 - * - * @author Lion Li - */ -@DisplayName("断言单元测试案例") -public class AssertUnitTest { - - @DisplayName("测试 assertEquals 方法") - @Test - public void testAssertEquals() { - Assertions.assertEquals("666", new String("666")); - Assertions.assertNotEquals("666", new String("666")); - } - - @DisplayName("测试 assertSame 方法") - @Test - public void testAssertSame() { - Object obj = new Object(); - Object obj1 = obj; - Assertions.assertSame(obj, obj1); - Assertions.assertNotSame(obj, obj1); - } - - @DisplayName("测试 assertTrue 方法") - @Test - public void testAssertTrue() { - Assertions.assertTrue(true); - Assertions.assertFalse(true); - } - - @DisplayName("测试 assertNull 方法") - @Test - public void testAssertNull() { - Assertions.assertNull(null); - Assertions.assertNotNull(null); - } - -} diff --git a/ruoyi-admin/src/test/java/com/xmzs/test/DemoUnitTest.java b/ruoyi-admin/src/test/java/com/xmzs/test/DemoUnitTest.java deleted file mode 100644 index 6981eb8a..00000000 --- a/ruoyi-admin/src/test/java/com/xmzs/test/DemoUnitTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.xmzs.test; - -import com.xmzs.common.core.config.RuoYiConfig; -import org.junit.jupiter.api.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.concurrent.TimeUnit; - -/** - * 单元测试案例 - * - * @author Lion Li - */ -@SpringBootTest // 此注解只能在 springboot 主包下使用 需包含 main 方法与 yml 配置文件 -@DisplayName("单元测试案例") -public class DemoUnitTest { - - @Autowired - private RuoYiConfig ruoYiConfig; - - @DisplayName("测试 @SpringBootTest @Test @DisplayName 注解") - @Test - public void testTest() { - System.out.println(ruoYiConfig); - } - - @Disabled - @DisplayName("测试 @Disabled 注解") - @Test - public void testDisabled() { - System.out.println(ruoYiConfig); - } - - @Timeout(value = 2L, unit = TimeUnit.SECONDS) - @DisplayName("测试 @Timeout 注解") - @Test - public void testTimeout() throws InterruptedException { - Thread.sleep(3000); - System.out.println(ruoYiConfig); - } - - - @DisplayName("测试 @RepeatedTest 注解") - @RepeatedTest(3) - public void testRepeatedTest() { - System.out.println(666); - } - - @BeforeAll - public static void testBeforeAll() { - System.out.println("@BeforeAll =================="); - } - - @BeforeEach - public void testBeforeEach() { - System.out.println("@BeforeEach =================="); - } - - @AfterEach - public void testAfterEach() { - System.out.println("@AfterEach =================="); - } - - @AfterAll - public static void testAfterAll() { - System.out.println("@AfterAll =================="); - } - -} diff --git a/ruoyi-admin/src/test/java/com/xmzs/test/ParamUnitTest.java b/ruoyi-admin/src/test/java/com/xmzs/test/ParamUnitTest.java deleted file mode 100644 index 82b9f55c..00000000 --- a/ruoyi-admin/src/test/java/com/xmzs/test/ParamUnitTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.xmzs.test; - -import com.xmzs.common.core.enums.UserType; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; -import org.junit.jupiter.params.provider.NullSource; -import org.junit.jupiter.params.provider.ValueSource; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Stream; - -/** - * 带参数单元测试案例 - * - * @author Lion Li - */ -@DisplayName("带参数单元测试案例") -public class ParamUnitTest { - - @DisplayName("测试 @ValueSource 注解") - @ParameterizedTest - @ValueSource(strings = {"t1", "t2", "t3"}) - public void testValueSource(String str) { - System.out.println(str); - } - - @DisplayName("测试 @NullSource 注解") - @ParameterizedTest - @NullSource - public void testNullSource(String str) { - System.out.println(str); - } - - @DisplayName("测试 @EnumSource 注解") - @ParameterizedTest - @EnumSource(UserType.class) - public void testEnumSource(UserType type) { - System.out.println(type.getUserType()); - } - - @DisplayName("测试 @MethodSource 注解") - @ParameterizedTest - @MethodSource("getParam") - public void testMethodSource(String str) { - System.out.println(str); - } - - public static Stream getParam() { - List list = new ArrayList<>(); - list.add("t1"); - list.add("t2"); - list.add("t3"); - return list.stream(); - } - - @BeforeEach - public void testBeforeEach() { - System.out.println("@BeforeEach =================="); - } - - @AfterEach - public void testAfterEach() { - System.out.println("@AfterEach =================="); - } - - -} diff --git a/ruoyi-admin/src/test/java/com/xmzs/test/TagUnitTest.java b/ruoyi-admin/src/test/java/com/xmzs/test/TagUnitTest.java deleted file mode 100644 index e4513873..00000000 --- a/ruoyi-admin/src/test/java/com/xmzs/test/TagUnitTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.xmzs.test; - -import org.junit.jupiter.api.*; -import org.springframework.boot.test.context.SpringBootTest; - -/** - * 标签单元测试案例 - * - * @author Lion Li - */ -@SpringBootTest -@DisplayName("标签单元测试案例") -public class TagUnitTest { - - @Tag("dev") - @DisplayName("测试 @Tag dev") - @Test - public void testTagDev() { - System.out.println("dev"); - } - - @Tag("prod") - @DisplayName("测试 @Tag prod") - @Test - public void testTagProd() { - System.out.println("prod"); - } - - @Tag("local") - @DisplayName("测试 @Tag local") - @Test - public void testTagLocal() { - System.out.println("local"); - } - - @Tag("exclude") - @DisplayName("测试 @Tag exclude") - @Test - public void testTagExclude() { - System.out.println("exclude"); - } - - @BeforeEach - public void testBeforeEach() { - System.out.println("@BeforeEach =================="); - } - - @AfterEach - public void testAfterEach() { - System.out.println("@AfterEach =================="); - } - - -} diff --git a/ruoyi-admin/src/test/java/org/ruoyi/test/AssertUnitTest.java b/ruoyi-admin/src/test/java/org/biada/test/AssertUnitTest.java similarity index 100% rename from ruoyi-admin/src/test/java/org/ruoyi/test/AssertUnitTest.java rename to ruoyi-admin/src/test/java/org/biada/test/AssertUnitTest.java diff --git a/ruoyi-admin/src/test/java/org/ruoyi/test/DemoUnitTest.java b/ruoyi-admin/src/test/java/org/biada/test/DemoUnitTest.java similarity index 100% rename from ruoyi-admin/src/test/java/org/ruoyi/test/DemoUnitTest.java rename to ruoyi-admin/src/test/java/org/biada/test/DemoUnitTest.java diff --git a/ruoyi-admin/src/test/java/org/ruoyi/test/ParamUnitTest.java b/ruoyi-admin/src/test/java/org/biada/test/ParamUnitTest.java similarity index 100% rename from ruoyi-admin/src/test/java/org/ruoyi/test/ParamUnitTest.java rename to ruoyi-admin/src/test/java/org/biada/test/ParamUnitTest.java diff --git a/ruoyi-admin/src/test/java/org/ruoyi/test/TagUnitTest.java b/ruoyi-admin/src/test/java/org/biada/test/TagUnitTest.java similarity index 100% rename from ruoyi-admin/src/test/java/org/ruoyi/test/TagUnitTest.java rename to ruoyi-admin/src/test/java/org/biada/test/TagUnitTest.java diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 4be322a0..2d12c7b2 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -33,6 +33,7 @@ ruoyi-common-tenant ruoyi-common-chat ruoyi-common-pay + ruoyi-common-wechat ruoyi-common diff --git a/ruoyi-common/ruoyi-common-bom/pom.xml b/ruoyi-common/ruoyi-common-bom/pom.xml index b1984ea7..b48e3fc2 100644 --- a/ruoyi-common/ruoyi-common-bom/pom.xml +++ b/ruoyi-common/ruoyi-common-bom/pom.xml @@ -159,6 +159,13 @@ ${revision} + + + org.ruoyi + ruoyi-common-wechat + ${revision} + + org.ruoyi diff --git a/ruoyi-common/ruoyi-common-chat/pom.xml b/ruoyi-common/ruoyi-common-chat/pom.xml index 7bf6ef4f..8b5ac816 100644 --- a/ruoyi-common/ruoyi-common-chat/pom.xml +++ b/ruoyi-common/ruoyi-common-chat/pom.xml @@ -26,6 +26,18 @@ ruoyi-common-core + + com.azure + azure-ai-openai + 1.0.0-beta.12 + + + + io.github.ollama4j + ollama4j + 1.0.79 + + org.ruoyi @@ -42,11 +54,6 @@ ruoyi-common-satoken - - org.springframework.boot - spring-boot-starter-websocket - - com.squareup.retrofit2 retrofit @@ -74,5 +81,16 @@ hutool-all 5.8.12 + + + org.springframework.boot + spring-boot-starter-websocket + + + org.springframework.boot + spring-boot-starter-tomcat + + + diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/ChatConfig.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/ChatConfig.java deleted file mode 100644 index e10dd535..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/ChatConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.common.chat.config; - - -import okhttp3.OkHttpClient; -import okhttp3.logging.HttpLoggingInterceptor; -import com.xmzs.common.chat.openai.OpenAiStreamClient; -import com.xmzs.common.chat.openai.function.KeyRandomStrategy; -import com.xmzs.common.chat.openai.interceptor.OpenAILogger; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * chat配置类 - * - * @author: wangle - * @date: 2023/5/16 - */ -@Configuration -public class ChatConfig { - @Value("${chat.apiKey}") - private List apiKey; - @Value("${chat.apiHost}") - private String apiHost; - - @Bean(name = "openAiStreamClient") - public OpenAiStreamClient openAiStreamClient() { - 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(apiKey) - //自定义key使用策略 默认随机策略 - .keyStrategy(new KeyRandomStrategy()) - .okHttpClient(okHttpClient) - .build(); - } -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/LocalCache.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/LocalCache.java deleted file mode 100644 index e3a6b955..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/LocalCache.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/WebSocketConfig.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/WebSocketConfig.java deleted file mode 100644 index c617bfd9..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/WebSocketConfig.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xmzs.common.chat.config; - -import cn.hutool.core.util.StrUtil; -import com.xmzs.common.chat.config.properties.WebSocketProperties; -import com.xmzs.common.chat.handler.PlusWebSocketHandler; -import com.xmzs.common.chat.interceptor.PlusWebSocketInterceptor; -import com.xmzs.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) { - if (StrUtil.isBlank(webSocketProperties.getPath())) { - webSocketProperties.setPath("/websocket"); - } - - if (StrUtil.isBlank(webSocketProperties.getAllowedOrigins())) { - webSocketProperties.setAllowedOrigins("*"); - } - - return registry -> registry - .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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/properties/WebSocketProperties.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/properties/WebSocketProperties.java deleted file mode 100644 index 6fef98f8..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/config/properties/WebSocketProperties.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/constant/OpenAIConst.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/constant/OpenAIConst.java deleted file mode 100644 index 34d9fc83..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/constant/OpenAIConst.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.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; - - /** GPT3扣除费用 */ - public final static double GPT3_COST = 0.05; - - /** GPT4扣除费用 */ - public final static double GPT4_COST = 0.2; - - /** DALL普通绘图扣除费用 */ - public final static double DALL3_COST = 0.3; - - /** DALL高清绘图扣除费用 */ - public final static double DALL3_HD_COST = 0.5; - - /** MJ操作类型1(变化、变焦、文生图、图生图、局部重绘、混图)扣除费用 */ - public final static double MJ_COST_TYPE1 = 0.3; - - /** MJ操作类型2(换脸、放大、图生文、prompt分析)扣除费用 */ - public final static double MJ_COST_TYPE2 = 0.1; - - /** MJ操作类型3(查询任务进度、获取seed)扣除费用 */ - public final static double MJ_COST_TYPE3 = 0.0; - - /** 默认账户余额 */ - public final static double USER_BALANCE = 5; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/constant/WebSocketConstants.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/constant/WebSocketConstants.java deleted file mode 100644 index e0e67e09..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/constant/WebSocketConstants.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/ChatProcessRequest.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/ChatProcessRequest.java deleted file mode 100644 index 7a88cc38..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/ChatProcessRequest.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.xmzs.common.chat.domain.request; - - -import lombok.Data; - -/** - * @author hncboy - * @date 2023/3/23 13:17 - * 消息处理请求 - */ -@Data -public class ChatProcessRequest { - - private String prompt; - - private Options options; - - private String systemMessage; - - @Data - public static class Options { - - private String conversationId; - - /** - * 这里的父级消息指的是回答的父级消息 id - * 前端发送问题,需要上下文的话传回答的父级消息 id - */ - private String parentMessageId; - } -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/ChatRequest.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/ChatRequest.java deleted file mode 100644 index a7584a5e..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/ChatRequest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.xmzs.common.chat.domain.request; - -import com.xmzs.common.chat.entity.chat.Content; -import com.xmzs.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 { - - @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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/Dall3Request.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/Dall3Request.java deleted file mode 100644 index 11a7ae52..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/Dall3Request.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/MjTaskRequest.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/MjTaskRequest.java deleted file mode 100644 index b0dacf5d..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/MjTaskRequest.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.xmzs.common.chat.domain.request; - -import jakarta.validation.constraints.NotEmpty; -import lombok.Data; - -/** - * mj任务请求实体类 - * - * @author WangLe - */ -@Data -public class MjTaskRequest { - - private String prompt; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/RoleRequest.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/RoleRequest.java deleted file mode 100644 index 61844713..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/RoleRequest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.xmzs.common.chat.domain.request; - -import lombok.Data; - -/** - * @author WangLe - */ -@Data -public class RoleRequest { - - /** - * 角色名称 - */ - private String name; - - /** - * 角色描述 - */ - private String description; - - /** - * 音频地址 - */ - private String prompt; - - /** - * 头像 - */ - private String avatar; - - - private String preProcess; - -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/SaveMsgRequest.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/SaveMsgRequest.java deleted file mode 100644 index cccd824a..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/SaveMsgRequest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.common.chat.domain.request; - -import jakarta.validation.constraints.NotEmpty; -import lombok.Data; - -/** - * 描述: - * - * @author https:www.unfbx.com - * @sine 2023-04-08 - */ -@Data -public class SaveMsgRequest { - - @NotEmpty(message = "传入的模型不能为空") - private String model; - - @NotEmpty(message = "对话消息不能为空") - private String msg; - -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/SimpleGenerateRequest.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/SimpleGenerateRequest.java deleted file mode 100644 index d4beb1e0..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/request/SimpleGenerateRequest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.common.chat.domain.request; - -import lombok.Data; - -/** - * @author WangLe - */ -@Data -public class SimpleGenerateRequest { - - /** - * 要使用的模型ID (目前统一为reecho-neural-voice-001) - */ - private String model = "reecho-neural-voice-001"; - - /** - * 多样性 (0-100,默认为97) - */ - private Integer randomness; - - /** - * 稳定性过滤 (0-100,默认为0) - */ - private Integer stability_boost; - - /** - * 角色ID - */ - private String voiceId; - - /** - * 要生成的文本内容 - */ - private String text; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/ChatResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/ChatResponse.java deleted file mode 100644 index 14104542..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/ChatResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.common.chat.domain.response; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; - -/** - * 描述: - * - * @author https:www.unfbx.com - * @sine 2023-04-08 - */ -@Data -public class ChatResponse { - /** - * 问题消耗tokens - */ - @JsonProperty("question_tokens") - private long questionTokens = 0; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/MetadataResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/MetadataResponse.java deleted file mode 100644 index 2773a334..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/MetadataResponse.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.common.chat.domain.response; - -import lombok.Data; - -/** - * @author WangLe - */ -@Data -public class MetadataResponse { - private String promptMP3StorageUrl; - private String promptOriginAudioStorageUrl; - private String description; - private boolean preProcess; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/RoleDataResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/RoleDataResponse.java deleted file mode 100644 index 9470f1a6..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/RoleDataResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.common.chat.domain.response; - -import lombok.Data; - -/** - * @author WangLe - */ -@Data -public class RoleDataResponse { - private String id; - private String name; - private String status; - private String from; - private String originId; - private MetadataResponse metadata; - private String createdAt; - private String updatedAt; - private String deletedAt; - private String userId; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/RoleResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/RoleResponse.java deleted file mode 100644 index 58cc4c14..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/RoleResponse.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.xmzs.common.chat.domain.response; - -import lombok.Data; - -/** - * @author WangLe - */ -@Data -public class RoleResponse { - private String status; - private String message; - private RoleDataResponse data; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/SimpleGenerateDataResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/SimpleGenerateDataResponse.java deleted file mode 100644 index b8a37a96..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/SimpleGenerateDataResponse.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.common.chat.domain.response; - -import lombok.Data; - -/** - * @author WangLe - */ -@Data -public class SimpleGenerateDataResponse { - - /** - * 本次生成的ID - */ - private String id; - - /** - * 本次生成结果的音频文件地址 - */ - private String audio; - - /** - * 本次生成所消耗的点数 - */ - private Integer credit_used; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/SimpleGenerateResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/SimpleGenerateResponse.java deleted file mode 100644 index 0b0266c5..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/domain/response/SimpleGenerateResponse.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.common.chat.domain.response; - -import lombok.Data; - -/** - * @author WangLe - */ -@Data -public class SimpleGenerateResponse { - - /** - * 状态码,失败时则为500 - */ - private String status; - - /** - * 状态消息 - */ - private String message; - - /** - * 生成详情 - */ - private SimpleGenerateDataResponse data; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TextToSpeech.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TextToSpeech.java deleted file mode 100644 index cb4e88b1..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TextToSpeech.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TtsFormat.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TtsFormat.java deleted file mode 100644 index 2385813b..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TtsFormat.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TtsVoice.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TtsVoice.java deleted file mode 100644 index 370bb0b8..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/Tts/TtsVoice.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/BillingUsage.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/BillingUsage.java deleted file mode 100644 index b7c402a9..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/BillingUsage.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/CreditGrantsResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/CreditGrantsResponse.java deleted file mode 100644 index 9937e639..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/CreditGrantsResponse.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/DailyCost.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/DailyCost.java deleted file mode 100644 index 4af4bc29..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/DailyCost.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Datum.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Datum.java deleted file mode 100644 index a9b8e39d..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Datum.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Grants.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Grants.java deleted file mode 100644 index 41a4fd07..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Grants.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/KeyInfo.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/KeyInfo.java deleted file mode 100644 index 7933fa09..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/KeyInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/LineItem.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/LineItem.java deleted file mode 100644 index b09c510a..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/LineItem.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Plan.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Plan.java deleted file mode 100644 index c0af8388..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Plan.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Subscription.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Subscription.java deleted file mode 100644 index bbdad7f9..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/billing/Subscription.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/BaseChatCompletion.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/BaseChatCompletion.java deleted file mode 100644 index 9e6f5b8f..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/BaseChatCompletion.java +++ /dev/null @@ -1,263 +0,0 @@ -package com.xmzs.common.chat.entity.chat; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.xmzs.common.chat.constant.OpenAIConst; -import com.xmzs.common.chat.entity.chat.tool.Tools; -import lombok.*; -import lombok.experimental.SuperBuilder; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -import static com.xmzs.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; - } - - public static double getModelCost(String modelName) { - if(modelName.startsWith("gpt-3.5")){ - return OpenAIConst.GPT3_COST; - }else { - return OpenAIConst.GPT4_COST; - } - } -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/BaseMessage.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/BaseMessage.java deleted file mode 100644 index 391b4c6a..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/BaseMessage.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.xmzs.common.chat.entity.chat; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.unfbx.chatgpt.entity.chat.tool.ToolCalls; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.Getter; - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletion.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletion.java deleted file mode 100644 index 0e626ebe..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletion.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.xmzs.common.chat.entity.chat; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.*; -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletionWithPicture.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletionWithPicture.java deleted file mode 100644 index a5c68018..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletionWithPicture.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.common.chat.entity.chat; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.*; -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Content.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Content.java deleted file mode 100644 index f26fcb9a..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Content.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/FunctionCall.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/FunctionCall.java deleted file mode 100644 index cc19b3a5..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/FunctionCall.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Functions.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Functions.java deleted file mode 100644 index 95c1b3c7..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Functions.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ImageUrl.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ImageUrl.java deleted file mode 100644 index c2fa6b37..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ImageUrl.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/MessagePicture.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/MessagePicture.java deleted file mode 100644 index 9ad7d632..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/MessagePicture.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.xmzs.common.chat.entity.chat; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.unfbx.chatgpt.entity.chat.tool.ToolCalls; -import lombok.AllArgsConstructor; -import lombok.Data; - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Parameters.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Parameters.java deleted file mode 100644 index b4d5ad8a..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Parameters.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ResponseFormat.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ResponseFormat.java deleted file mode 100644 index 06da355c..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ResponseFormat.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolCallFunction.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolCallFunction.java deleted file mode 100644 index 293ac314..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolCallFunction.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolCalls.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolCalls.java deleted file mode 100644 index 9b304b57..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolCalls.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.unfbx.chatgpt.entity.chat.tool; - -import com.xmzs.common.chat.entity.chat.tool.ToolCallFunction; -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoice.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoice.java deleted file mode 100644 index d99b6577..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoice.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.common.chat.entity.chat.tool; - -import lombok.*; - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoiceObj.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoiceObj.java deleted file mode 100644 index 04dbfd55..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoiceObj.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoiceObjFunction.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoiceObjFunction.java deleted file mode 100644 index b45ab9ab..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolChoiceObjFunction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/Tools.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/Tools.java deleted file mode 100644 index 43f5be92..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/Tools.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolsFunction.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolsFunction.java deleted file mode 100644 index 7465eb5e..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/tool/ToolsFunction.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.xmzs.common.chat.entity.chat.tool; - - -import com.xmzs.common.chat.entity.chat.Parameters; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/Choice.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/Choice.java deleted file mode 100644 index 63360b87..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/Choice.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/DeleteResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/DeleteResponse.java deleted file mode 100644 index 4d35e0d2..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/DeleteResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/OpenAiResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/OpenAiResponse.java deleted file mode 100644 index 36b8b6e2..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/OpenAiResponse.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/completions/Completion.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/completions/Completion.java deleted file mode 100644 index f3ecc121..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/completions/Completion.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/completions/CompletionResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/completions/CompletionResponse.java deleted file mode 100644 index 891aa91d..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/completions/CompletionResponse.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.xmzs.common.chat.entity.completions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.xmzs.common.chat.entity.common.Choice; -import com.xmzs.common.chat.entity.common.OpenAiResponse; -import com.xmzs.common.chat.entity.common.Usage; -import lombok.Data; - - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/dto/WebSocketMessageDto.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/dto/WebSocketMessageDto.java deleted file mode 100644 index 7a73aaef..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/dto/WebSocketMessageDto.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/edits/Edit.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/edits/Edit.java deleted file mode 100644 index 7e803362..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/edits/Edit.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/edits/EditResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/edits/EditResponse.java deleted file mode 100644 index 8f5c60b8..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/edits/EditResponse.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.xmzs.common.chat.entity.edits; - - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.xmzs.common.chat.entity.common.Choice; -import com.xmzs.common.chat.entity.common.Usage; -import lombok.Data; - - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/Embedding.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/Embedding.java deleted file mode 100644 index 79965902..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/Embedding.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/EmbeddingResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/EmbeddingResponse.java deleted file mode 100644 index 57bb1140..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/EmbeddingResponse.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.common.chat.entity.embeddings; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.xmzs.common.chat.entity.common.Usage; -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 EmbeddingResponse implements Serializable { - - private String object; - private List data; - private String model; - private Usage usage; -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/Item.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/Item.java deleted file mode 100644 index 2ceb1c89..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/embeddings/Item.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/engines/Engine.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/engines/Engine.java deleted file mode 100644 index 1f8e552d..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/engines/Engine.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/files/File.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/files/File.java deleted file mode 100644 index 1dc00522..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/files/File.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.common.chat.entity.files; - -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 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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/files/UploadFileResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/files/UploadFileResponse.java deleted file mode 100644 index 00276ade..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/files/UploadFileResponse.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/Event.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/Event.java deleted file mode 100644 index af4a0d50..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/Event.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTune.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTune.java deleted file mode 100644 index 29d4e5a5..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTune.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.xmzs.common.chat.entity.fineTune; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.xmzs.common.chat.openai.exception.CommonError; -import lombok.*; -import lombok.extern.slf4j.Slf4j; -import com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTuneDeleteResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTuneDeleteResponse.java deleted file mode 100644 index ddb787ac..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTuneDeleteResponse.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTuneResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTuneResponse.java deleted file mode 100644 index 2753fcaa..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/FineTuneResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/HyperParam.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/HyperParam.java deleted file mode 100644 index 1aca22d8..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/HyperParam.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/TrainingFile.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/TrainingFile.java deleted file mode 100644 index e0736b80..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/fineTune/TrainingFile.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/Image.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/Image.java deleted file mode 100644 index 76b75d56..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/Image.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.xmzs.common.chat.entity.images; - -import com.fasterxml.jackson.annotation.JsonInclude; -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 -@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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageEdit.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageEdit.java deleted file mode 100644 index d1e87681..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageEdit.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.xmzs.common.chat.entity.images; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.xmzs.common.chat.openai.exception.CommonError; -import lombok.*; -import lombok.extern.slf4j.Slf4j; -import com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageResponse.java deleted file mode 100644 index 1d2b5a08..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageVariations.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageVariations.java deleted file mode 100644 index 58018db7..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ImageVariations.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/Item.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/Item.java deleted file mode 100644 index c22afa44..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/Item.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ResponseFormat.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ResponseFormat.java deleted file mode 100644 index b75c6912..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/ResponseFormat.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/SizeEnum.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/SizeEnum.java deleted file mode 100644 index a72ef384..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/images/SizeEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/Model.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/Model.java deleted file mode 100644 index 0b45b6fc..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/Model.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/ModelResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/ModelResponse.java deleted file mode 100644 index 33aee8d8..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/ModelResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/Permission.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/Permission.java deleted file mode 100644 index ffdbd526..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/models/Permission.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Categories.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Categories.java deleted file mode 100644 index 140195d9..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Categories.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/CategoryScores.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/CategoryScores.java deleted file mode 100644 index 9efcdd2d..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/CategoryScores.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Moderation.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Moderation.java deleted file mode 100644 index 193659a8..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Moderation.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.xmzs.common.chat.entity.moderations; - -import com.xmzs.common.chat.openai.exception.CommonError; -import lombok.*; -import lombok.extern.slf4j.Slf4j; -import com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/ModerationResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/ModerationResponse.java deleted file mode 100644 index 91e00a94..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/ModerationResponse.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Result.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Result.java deleted file mode 100644 index 12ab9ac7..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/moderations/Result.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Transcriptions.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Transcriptions.java deleted file mode 100644 index 58032619..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Transcriptions.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.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 = Whisper.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Translations.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Translations.java deleted file mode 100644 index fe68f9b6..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Translations.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Whisper.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Whisper.java deleted file mode 100644 index 4e4f681b..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/Whisper.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/WhisperResponse.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/WhisperResponse.java deleted file mode 100644 index 183207f1..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/whisper/WhisperResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/handler/PlusWebSocketHandler.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/handler/PlusWebSocketHandler.java deleted file mode 100644 index 96c17de0..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/handler/PlusWebSocketHandler.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.xmzs.common.chat.handler; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson2.JSONObject; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.chat.config.LocalCache; -import com.xmzs.common.chat.entity.chat.ChatCompletion; -import com.xmzs.common.chat.holder.WebSocketSessionHolder; -import com.xmzs.common.chat.listener.WebSocketEventListener; -import com.xmzs.common.chat.openai.OpenAiStreamClient; -import com.xmzs.common.chat.entity.chat.Message; -import com.xmzs.common.chat.utils.WebSocketUtils; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.socket.*; -import org.springframework.web.socket.handler.AbstractWebSocketHandler; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -/** - * WebSocketHandler 实现类 - * - * @author zendwang - */ -@Slf4j -public class PlusWebSocketHandler extends AbstractWebSocketHandler { - - /** - * 是否开启文本审核 - */ - @Value("${baidu.enabled}") - private Boolean enabled; - - /** - * 连接成功后 - */ - @Override - public void afterConnectionEstablished(WebSocketSession session) { - WebSocketSessionHolder.addSession(session.getId(), session); - } - - /** - * 处理发送来的文本消息 - * - * @param session - * @param message - */ - @Override - protected void handleTextMessage(WebSocketSession session, TextMessage message) { -// if(enabled){ -// // 判断文本是否合规 -// TextReviewService textReviewService=(TextReviewService) SpringUtils.context().getBean("textReviewService"); -// String type = textReviewService.textReview(message.getPayload()); -// // 审核状态 1 代表合法 -// String conclusionType = "1"; -// if (!conclusionType.equals(type) && StringUtils.isNotEmpty(type)) { -// HashMap msgMap = new HashMap<>(10); -// msgMap.put("content", "文本不合规,请修改!"); -// String jsonStr = JSONUtil.toJsonStr(msgMap); -// WebSocketUtils.sendMessage(session, jsonStr); -// WebSocketUtils.sendMessage(session, "[DONE]"); -// return; -// } -// } - 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(ChatCompletion.Model.GPT_3_5_TURBO.getName()) - .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); - } - - /** - * 根据key获取Value值 - * - * @Date 2023/7/27 - * @param jsonObject - * @param key - * @param defaultValue - * @return String - **/ - public String getValue(JSONObject jsonObject,String key,String defaultValue){ - String value = (String)jsonObject.get(key); - if(StrUtil.isEmpty(value)){ - return defaultValue; - } - return value; - } - - @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 - */ - @Override - public boolean supportsPartialMessages() { - return false; - } -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/holder/WebSocketSessionHolder.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/holder/WebSocketSessionHolder.java deleted file mode 100644 index d04a0bb7..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/holder/WebSocketSessionHolder.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/interceptor/PlusWebSocketInterceptor.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/interceptor/PlusWebSocketInterceptor.java deleted file mode 100644 index 49f24672..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/interceptor/PlusWebSocketInterceptor.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/SSEEventSourceListener.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/SSEEventSourceListener.java deleted file mode 100644 index 2ec6b966..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/SSEEventSourceListener.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.xmzs.common.chat.listener; - - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xmzs.common.chat.config.LocalCache; -import com.xmzs.common.chat.entity.chat.ChatChoice; -import com.xmzs.common.chat.entity.chat.ChatCompletionResponse; -import com.xmzs.common.core.utils.StringUtils; -import lombok.AllArgsConstructor; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import okhttp3.Response; -import okhttp3.ResponseBody; -import okhttp3.sse.EventSource; -import okhttp3.sse.EventSourceListener; - -import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter; - -import java.util.Objects; - -/** - * 描述:OpenAIEventSourceListener - * - * @author https:www.unfbx.com - * @date 2023-02-22 - */ -@Slf4j -@AllArgsConstructor -public class SSEEventSourceListener extends EventSourceListener { - - private static final String DONE_SIGNAL = "[DONE]"; - - private final ResponseBodyEmitter emitter; - - /** - * {@inheritDoc} - */ - @Override - public void onOpen(EventSource eventSource, Response response) { - log.info("OpenAI建立sse连接..."); - } - - /** - * {@inheritDoc} - */ - @SneakyThrows - @Override - public void onEvent(EventSource eventSource, String id, String type, String data) { - try { - log.info("响应数据{}=========",data); - emitter.send(data); - if (data.equals(DONE_SIGNAL)) { - //成功响应 - emitter.complete(); - } - } catch (Exception e) { - log.error("sse信息推送失败!"); - 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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/WebSocketEventListener.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/WebSocketEventListener.java deleted file mode 100644 index 027cd0df..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/WebSocketEventListener.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.xmzs.common.chat.listener; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import com.xmzs.common.chat.constant.OpenAIConst; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import okhttp3.Response; -import okhttp3.ResponseBody; -import okhttp3.sse.EventSource; -import okhttp3.sse.EventSourceListener; -import com.xmzs.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 = mapper.writeValueAsString(completionResponse.getChoices().get(0).getDelta()); - 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)) { - // 返回非流式回复内容 - if(response.code() == OpenAIConst.SUCCEED_CODE){ - ObjectMapper mapper = new ObjectMapper(); - ChatCompletionResponse completionResponse = mapper.readValue(body.string(), ChatCompletionResponse.class); - String delta = mapper.writeValueAsString(completionResponse.getChoices().get(0).getMessage().getContent()); - session.sendMessage(new TextMessage(delta)); - }else { - log.error("Socket连接异常data:{},异常:{}", body.string(), t); - } - } else { - log.error("Socket连接异常data:{},异常:{}", response, t); - } - eventSource.cancel(); - } -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/WebSocketTopicListener.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/WebSocketTopicListener.java deleted file mode 100644 index 632dda03..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/listener/WebSocketTopicListener.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.common.chat.listener; - -import cn.hutool.core.collection.CollUtil; -import com.xmzs.common.chat.holder.WebSocketSessionHolder; -import com.xmzs.common.chat.utils.WebSocketUtils; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiApi.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiApi.java deleted file mode 100644 index df8a83f2..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiApi.java +++ /dev/null @@ -1,356 +0,0 @@ -package com.xmzs.common.chat.openai; - -import com.xmzs.common.chat.entity.Tts.TextToSpeech; -import com.xmzs.common.chat.entity.chat.ChatCompletionWithPicture; -import io.reactivex.Single; -import okhttp3.MultipartBody; -import okhttp3.RequestBody; -import okhttp3.ResponseBody; - -import com.xmzs.common.chat.entity.billing.BillingUsage; -import com.xmzs.common.chat.entity.billing.CreditGrantsResponse; -import com.xmzs.common.chat.entity.billing.Subscription; -import com.xmzs.common.chat.entity.chat.ChatCompletion; -import com.xmzs.common.chat.entity.chat.ChatCompletionResponse; -import com.xmzs.common.chat.entity.common.DeleteResponse; -import com.xmzs.common.chat.entity.common.OpenAiResponse; -import com.xmzs.common.chat.entity.completions.Completion; -import com.xmzs.common.chat.entity.completions.CompletionResponse; -import com.xmzs.common.chat.entity.edits.Edit; -import com.xmzs.common.chat.entity.edits.EditResponse; -import com.xmzs.common.chat.entity.embeddings.Embedding; -import com.xmzs.common.chat.entity.embeddings.EmbeddingResponse; -import com.xmzs.common.chat.entity.engines.Engine; -import com.xmzs.common.chat.entity.files.File; -import com.xmzs.common.chat.entity.files.UploadFileResponse; -import com.xmzs.common.chat.entity.fineTune.Event; -import com.xmzs.common.chat.entity.fineTune.FineTune; -import com.xmzs.common.chat.entity.fineTune.FineTuneDeleteResponse; -import com.xmzs.common.chat.entity.fineTune.FineTuneResponse; -import com.xmzs.common.chat.entity.images.Image; -import com.xmzs.common.chat.entity.images.ImageResponse; -import com.xmzs.common.chat.entity.models.Model; -import com.xmzs.common.chat.entity.models.ModelResponse; -import com.xmzs.common.chat.entity.moderations.Moderation; -import com.xmzs.common.chat.entity.moderations.ModerationResponse; -import com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiClient.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiClient.java deleted file mode 100644 index bb439813..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiClient.java +++ /dev/null @@ -1,805 +0,0 @@ -package com.xmzs.common.chat.openai; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; - - -import com.xmzs.common.chat.entity.images.*; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.chat.constant.OpenAIConst; -import com.xmzs.common.chat.entity.billing.BillingUsage; -import com.xmzs.common.chat.entity.billing.Subscription; -import com.xmzs.common.chat.entity.chat.ChatCompletion; -import com.xmzs.common.chat.entity.chat.ChatCompletionResponse; -import com.xmzs.common.chat.entity.chat.Message; -import com.xmzs.common.chat.entity.common.DeleteResponse; -import com.xmzs.common.chat.entity.common.OpenAiResponse; -import com.xmzs.common.chat.entity.completions.Completion; -import com.xmzs.common.chat.entity.completions.CompletionResponse; -import com.xmzs.common.chat.entity.edits.Edit; -import com.xmzs.common.chat.entity.edits.EditResponse; -import com.xmzs.common.chat.entity.embeddings.Embedding; -import com.xmzs.common.chat.entity.embeddings.EmbeddingResponse; -import com.xmzs.common.chat.entity.engines.Engine; -import com.xmzs.common.chat.entity.files.File; -import com.xmzs.common.chat.entity.files.UploadFileResponse; -import com.xmzs.common.chat.entity.fineTune.Event; -import com.xmzs.common.chat.entity.fineTune.FineTune; -import com.xmzs.common.chat.entity.fineTune.FineTuneDeleteResponse; -import com.xmzs.common.chat.entity.fineTune.FineTuneResponse; -import com.xmzs.common.chat.entity.models.Model; -import com.xmzs.common.chat.entity.models.ModelResponse; -import com.xmzs.common.chat.entity.moderations.Moderation; -import com.xmzs.common.chat.entity.moderations.ModerationResponse; -import com.xmzs.common.chat.entity.whisper.Translations; -import com.xmzs.common.chat.entity.whisper.WhisperResponse; -import com.xmzs.common.chat.openai.exception.CommonError; -import com.xmzs.common.chat.openai.function.KeyRandomStrategy; -import com.xmzs.common.chat.openai.function.KeyStrategyFunction; -import com.xmzs.common.chat.openai.interceptor.DefaultOpenAiAuthInterceptor; -import com.xmzs.common.chat.openai.interceptor.DynamicKeyOpenAiAuthInterceptor; -import com.xmzs.common.chat.openai.interceptor.OpenAiAuthInterceptor; -import io.reactivex.Single; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import okhttp3.*; -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 OpenAiClient.Builder builder() { - return new OpenAiClient.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(); - } - - /** - * 简易版 语音翻译:目前仅支持翻译为英文 - * - * @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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiStreamClient.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiStreamClient.java deleted file mode 100644 index 5c56ecff..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/OpenAiStreamClient.java +++ /dev/null @@ -1,501 +0,0 @@ -package com.xmzs.common.chat.openai; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.ContentType; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xmzs.common.chat.config.LocalCache; -import com.xmzs.common.chat.entity.Tts.TextToSpeech; -import com.xmzs.common.chat.entity.billing.BillingUsage; -import com.xmzs.common.chat.entity.billing.KeyInfo; -import com.xmzs.common.chat.entity.billing.Subscription; -import com.xmzs.common.chat.entity.chat.BaseChatCompletion; -import com.xmzs.common.chat.entity.chat.ChatCompletionResponse; -import com.xmzs.common.chat.entity.chat.ChatCompletionWithPicture; -import com.xmzs.common.chat.entity.files.UploadFileResponse; -import com.xmzs.common.chat.entity.images.Image; -import com.xmzs.common.chat.entity.images.ImageResponse; -import com.xmzs.common.chat.entity.models.Model; -import com.xmzs.common.chat.entity.models.ModelResponse; -import com.xmzs.common.chat.entity.whisper.Transcriptions; -import com.xmzs.common.chat.entity.whisper.WhisperResponse; -import com.xmzs.common.chat.openai.exception.CommonError; -import com.xmzs.common.chat.openai.function.KeyRandomStrategy; -import com.xmzs.common.chat.openai.function.KeyStrategyFunction; -import com.xmzs.common.chat.openai.interceptor.DefaultOpenAiAuthInterceptor; -import com.xmzs.common.chat.openai.interceptor.DynamicKeyOpenAiAuthInterceptor; -import com.xmzs.common.chat.openai.interceptor.OpenAiAuthInterceptor; -import com.xmzs.common.core.exception.ServiceException; -import io.reactivex.Single; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import okhttp3.*; -import okhttp3.sse.EventSource; -import okhttp3.sse.EventSourceListener; -import okhttp3.sse.EventSources; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.chat.constant.OpenAIConst; -import com.xmzs.common.chat.entity.chat.ChatCompletion; -import org.jetbrains.annotations.NotNull; -import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter; -import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; -import retrofit2.Call; -import retrofit2.Retrofit; -import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; -import retrofit2.converter.jackson.JacksonConverterFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.nio.charset.StandardCharsets; -import java.rmi.ServerException; -import java.time.LocalDate; -import java.time.ZoneId; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.net.URI; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.net.http.HttpResponse; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; - -/** - * 描述: open ai 客户端 - * - * @author https:www.unfbx.com - * 2023-02-28 - */ - -@Slf4j -public class OpenAiStreamClient { - @Getter - @NotNull - private List apiKey; - /** - * 自定义api host使用builder的方式构造client - */ - @Getter - private String apiHost; - /** - * 自定义的okHttpClient - * 如果不自定义 ,就是用sdk默认的OkHttpClient实例 - */ - @Getter - private OkHttpClient okHttpClient; - - /** - * api key的获取策略 - */ - @Getter - private KeyStrategyFunction, String> keyStrategy; - - @Getter - private OpenAiApi openAiApi; - - /** - * 自定义鉴权处理拦截器
- * 可以不设置,默认实现:DefaultOpenAiAuthInterceptor
- * 如需自定义实现参考:DealKeyWithOpenAiAuthInterceptor - * - * @see DynamicKeyOpenAiAuthInterceptor - * @see DefaultOpenAiAuthInterceptor - */ - @Getter - private OpenAiAuthInterceptor authInterceptor; - - private static final String API_KEY = "sk-Waea254YSRYVg4FZVCz2CDz73B22xRpmKpJ41kbczVgpPxvg"; - - HttpClient client = HttpClient.newHttpClient(); - - 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()); - } - } - - - /** - * 根据描述生成图片 - * - * @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(); - } - - /** - * 账户信息查询:里面包含总金额等信息 - * - * @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) { - retrofit2.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()); - } - } - - - /** - * 构造 - * - * @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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/TestOpenAIAPI.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/TestOpenAIAPI.java deleted file mode 100644 index f4e8bd51..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/TestOpenAIAPI.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/exception/CommonError.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/exception/CommonError.java deleted file mode 100644 index a02877d3..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/exception/CommonError.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.xmzs.common.chat.openai.exception; - -/** - * 描述: 错误 - * - * @author https:www.unfbx.com - * 2023-02-11 - */ -public enum CommonError implements IError { - 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 int code; - private 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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/exception/IError.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/exception/IError.java deleted file mode 100644 index 98f73b8e..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/exception/IError.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.xmzs.common.chat.openai.exception; -/** - * 描述: - * - * @author https:www.unfbx.com - * 2023-02-11 - */ -public interface IError { - String msg(); - - int code(); -} diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/function/KeyRandomStrategy.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/function/KeyRandomStrategy.java deleted file mode 100644 index 8251db3c..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/function/KeyRandomStrategy.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/function/KeyStrategyFunction.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/function/KeyStrategyFunction.java deleted file mode 100644 index 97d90a89..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/function/KeyStrategyFunction.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/DefaultOpenAiAuthInterceptor.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/DefaultOpenAiAuthInterceptor.java deleted file mode 100644 index fb17ccf6..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/DefaultOpenAiAuthInterceptor.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/DynamicKeyOpenAiAuthInterceptor.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/DynamicKeyOpenAiAuthInterceptor.java deleted file mode 100644 index 7deba375..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/DynamicKeyOpenAiAuthInterceptor.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.xmzs.common.chat.openai.interceptor; - -import cn.hutool.json.JSONUtil; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import okhttp3.Request; -import okhttp3.Response; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.chat.entity.common.OpenAiResponse; -import com.xmzs.common.chat.openai.exception.CommonError; - - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAILogger.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAILogger.java deleted file mode 100644 index 5c24efb2..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAILogger.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAiAuthInterceptor.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAiAuthInterceptor.java deleted file mode 100644 index f40d782a..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAiAuthInterceptor.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.chat.openai.exception.CommonError; -import com.xmzs.common.chat.openai.function.KeyStrategyFunction; - - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAiResponseInterceptor.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAiResponseInterceptor.java deleted file mode 100644 index 4d3ade56..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/openai/interceptor/OpenAiResponseInterceptor.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.common.chat.openai.interceptor; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import okhttp3.Interceptor; -import okhttp3.Request; -import okhttp3.Response; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.chat.entity.common.OpenAiResponse; -import com.xmzs.common.chat.openai.exception.CommonError; - - -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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/utils/TikTokensUtil.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/utils/TikTokensUtil.java deleted file mode 100644 index 307b5c15..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/utils/TikTokensUtil.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.xmzs.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 com.xmzs.common.chat.entity.chat.BaseChatCompletion; -import lombok.extern.slf4j.Slf4j; - -import com.xmzs.common.chat.entity.chat.ChatCompletion; -import com.xmzs.common.chat.entity.chat.FunctionCall; -import com.xmzs.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计费",modelName); - tokensPerMessage = 3; - tokensPerName = 1; - } - int sum = 0; - for (Message msg : messages) { - sum += tokensPerMessage; - sum += tokens(encoding, msg.getContent()); - 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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/utils/WebSocketUtils.java b/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/utils/WebSocketUtils.java deleted file mode 100644 index 1e71341f..00000000 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/utils/WebSocketUtils.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.xmzs.common.chat.utils; - -import cn.hutool.core.collection.CollUtil; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.common.chat.entity.dto.WebSocketMessageDto; -import com.xmzs.common.chat.holder.WebSocketSessionHolder; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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 com.xmzs.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/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/ChatConfig.java b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/ChatConfig.java index 03c519b0..624779c4 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/ChatConfig.java +++ b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/ChatConfig.java @@ -31,7 +31,6 @@ public class ChatConfig { // 重启才会生效 @Bean public OpenAiStreamClient openAiStreamClient() { - String apiHost = configService.getConfigValue("chat", "apiHost"); String apiKey = configService.getConfigValue("chat", "apiKey"); openAiStreamClient = createOpenAiStreamClient(apiHost,apiKey); diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java index 7b090042..f9242c66 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java +++ b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java @@ -29,15 +29,17 @@ public class WebSocketConfig { 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()); diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/domain/request/ChatRequest.java b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/domain/request/ChatRequest.java index a667fff7..35f5269a 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/domain/request/ChatRequest.java +++ b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/domain/request/ChatRequest.java @@ -34,12 +34,14 @@ public class ChatRequest { private double top_p = 1; -// private String userId; + /** + * 知识库id + */ + private String kid; + + private String userId; // -// /** -// * 知识库id -// */ -// private String kid; + // // /** // * gpt的默认设置 diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/handler/PlusWebSocketHandler.java b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/handler/PlusWebSocketHandler.java index 1e79f2a8..7aec0bfb 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/handler/PlusWebSocketHandler.java +++ b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/handler/PlusWebSocketHandler.java @@ -12,6 +12,7 @@ import org.ruoyi.common.chat.listener.WebSocketEventListener; import org.ruoyi.common.chat.openai.OpenAiStreamClient; import org.ruoyi.common.chat.utils.WebSocketUtils; import org.ruoyi.common.core.utils.SpringUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.socket.*; import org.springframework.web.socket.handler.AbstractWebSocketHandler; @@ -70,22 +71,6 @@ public class PlusWebSocketHandler extends AbstractWebSocketHandler { LocalCache.CACHE.put(session.getId(), JSONUtil.toJsonStr(messages), LocalCache.TIMEOUT); } - /** - * 根据key获取Value值 - * - * @Date 2023/7/27 - * @param jsonObject - * @param key - * @param defaultValue - * @return String - **/ - public String getValue(JSONObject jsonObject,String key,String defaultValue){ - String value = (String)jsonObject.get(key); - if(StrUtil.isEmpty(value)){ - return defaultValue; - } - return value; - } @Override protected void handleBinaryMessage(WebSocketSession session, BinaryMessage message) throws Exception { @@ -128,9 +113,9 @@ public class PlusWebSocketHandler extends AbstractWebSocketHandler { } /** - * 是否支持分片消息 + * 指示处理程序是否支持接收部分消息 * - * @return + * @return 如果支持接收部分消息,则返回true;否则返回false */ @Override public boolean supportsPartialMessages() { diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/openai/OpenAiStreamClient.java b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/openai/OpenAiStreamClient.java index e293aa41..cad1bbbf 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/openai/OpenAiStreamClient.java +++ b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/openai/OpenAiStreamClient.java @@ -21,6 +21,8 @@ import org.ruoyi.common.chat.entity.chat.BaseChatCompletion; import org.ruoyi.common.chat.entity.chat.ChatCompletion; import org.ruoyi.common.chat.entity.chat.ChatCompletionResponse; import org.ruoyi.common.chat.entity.chat.ChatCompletionWithPicture; +import org.ruoyi.common.chat.entity.embeddings.Embedding; +import org.ruoyi.common.chat.entity.embeddings.EmbeddingResponse; import org.ruoyi.common.chat.entity.files.UploadFileResponse; import org.ruoyi.common.chat.entity.images.Image; import org.ruoyi.common.chat.entity.images.ImageResponse; @@ -292,6 +294,17 @@ public class OpenAiStreamClient { return billingUsage.blockingGet(); } + /** + * 文本转换向量 + * + * @param embedding 入参 + * @return EmbeddingResponse + */ + public EmbeddingResponse embeddings(Embedding embedding) { + Single embeddings = this.openAiApi.embeddings(embedding); + return embeddings.blockingGet(); + } + /** * 账户信息查询:里面包含总金额等信息 * diff --git a/ruoyi-common/ruoyi-common-core/pom.xml b/ruoyi-common/ruoyi-common-core/pom.xml index 57d714fe..36bd0d8e 100644 --- a/ruoyi-common/ruoyi-common-core/pom.xml +++ b/ruoyi-common/ruoyi-common-core/pom.xml @@ -73,6 +73,18 @@ lombok + + com.github.binarywang + weixin-java-cp + ${weixin-java-miniapp.version} + + + + com.github.binarywang + weixin-java-cp + ${weixin-java-cp.version} + + org.springframework.boot diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ApplicationConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ApplicationConfig.java deleted file mode 100644 index 96c5d3d5..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ApplicationConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/AsyncConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/AsyncConfig.java deleted file mode 100644 index 294a5165..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/AsyncConfig.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.xmzs.common.core.config; - -import cn.hutool.core.util.ArrayUtil; -import com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/RuoYiConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/RuoYiConfig.java deleted file mode 100644 index a3f5195f..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/RuoYiConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.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 = "ruoyi") -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ThreadPoolConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ThreadPoolConfig.java deleted file mode 100644 index e674ce11..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ThreadPoolConfig.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.xmzs.common.core.config; - -import com.xmzs.common.core.config.properties.ThreadPoolProperties; -import com.xmzs.common.core.utils.Threads; -import org.apache.commons.lang3.concurrent.BasicThreadFactory; -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ValidatorConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ValidatorConfig.java deleted file mode 100644 index a50c9da9..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/ValidatorConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/properties/ThreadPoolProperties.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/properties/ThreadPoolProperties.java deleted file mode 100644 index 50366ace..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/config/properties/ThreadPoolProperties.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/CacheConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/CacheConstants.java deleted file mode 100644 index 13e0902e..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/CacheConstants.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/CacheNames.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/CacheNames.java deleted file mode 100644 index b9b48d73..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/CacheNames.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/Constants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/Constants.java deleted file mode 100644 index d107f7c1..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/Constants.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.xmzs.common.core.constant; - -/** - * 通用常量信息 - * - * @author ruoyi - */ -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 = 20; - - /** - * 令牌 - */ - String TOKEN = "token"; - - /** - * 顶级部门id - */ - Long TOP_PARENT_ID = 0L; - - /** - * 默认租户ID - **/ - String TENANT_ID = "00000"; - -} - diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/GlobalConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/GlobalConstants.java deleted file mode 100644 index adedb2a2..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/GlobalConstants.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/HttpStatus.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/HttpStatus.java deleted file mode 100644 index 7e263c3f..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/HttpStatus.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/TenantConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/TenantConstants.java deleted file mode 100644 index 0c54462d..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/TenantConstants.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/UserConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/UserConstants.java deleted file mode 100644 index 5eb5a9d1..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/constant/UserConstants.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.xmzs.common.core.constant; - -/** - * 用户常量信息 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/R.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/R.java deleted file mode 100644 index e614a862..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/R.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.xmzs.common.core.domain; - -import com.xmzs.common.core.constant.HttpStatus; -import lombok.Data; -import lombok.NoArgsConstructor; - -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/dto/RoleDTO.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/dto/RoleDTO.java deleted file mode 100644 index 32713730..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/dto/RoleDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/dto/UserOnlineDTO.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/dto/UserOnlineDTO.java deleted file mode 100644 index deea41da..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/dto/UserOnlineDTO.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.xmzs.common.core.domain.dto; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serial; -import java.io.Serializable; - -/** - * 当前在线会话 - * - * @author ruoyi - */ - -@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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/EmailLoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/EmailLoginBody.java deleted file mode 100644 index 1c5553cd..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/EmailLoginBody.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/LoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/LoginBody.java deleted file mode 100644 index c36905cf..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/LoginBody.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.xmzs.common.core.domain.model; - -import com.xmzs.common.core.constant.UserConstants; -import lombok.Data; -import org.hibernate.validator.constraints.Length; - -import jakarta.validation.constraints.NotBlank; - -/** - * 用户登录对象 - * - * @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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/LoginUser.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/LoginUser.java deleted file mode 100644 index 9fd909bd..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/LoginUser.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.xmzs.common.core.domain.model; - -import com.xmzs.common.core.domain.dto.RoleDTO; -import lombok.Data; -import lombok.NoArgsConstructor; - -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/RegisterBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/RegisterBody.java deleted file mode 100644 index cb6ef6af..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/RegisterBody.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xmzs.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; - -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/SmsLoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/SmsLoginBody.java deleted file mode 100644 index 818098d5..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/SmsLoginBody.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.xmzs.common.core.domain.model; - -import lombok.Data; - -import jakarta.validation.constraints.NotBlank; - -/** - * 短信登录对象 - * - * @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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/VisitorLoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/VisitorLoginBody.java deleted file mode 100644 index 94564b16..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/VisitorLoginBody.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/VisitorLoginUser.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/VisitorLoginUser.java deleted file mode 100644 index e346a4a5..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/domain/model/VisitorLoginUser.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/DeviceType.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/DeviceType.java deleted file mode 100644 index be899884..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/DeviceType.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/LoginType.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/LoginType.java deleted file mode 100644 index ec123eb9..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/LoginType.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/LoginUserType.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/LoginUserType.java deleted file mode 100644 index e0753edd..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/LoginUserType.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/TenantStatus.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/TenantStatus.java deleted file mode 100644 index 7e7050ef..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/TenantStatus.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/UserStatus.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/UserStatus.java deleted file mode 100644 index 16fe3bc1..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/UserStatus.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.common.core.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * 用户状态 - * - * @author ruoyi - */ -@Getter -@AllArgsConstructor -public enum UserStatus { - /** - * 正常 - */ - OK("0", "正常"), - /** - * 停用 - */ - DISABLE("1", "停用"), - /** - * 删除 - */ - DELETED("2", "删除"); - - private final String code; - private final String info; - -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/UserType.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/UserType.java deleted file mode 100644 index 6ebfba7d..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/enums/UserType.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xmzs.common.core.enums; - -import com.xmzs.common.core.utils.StringUtils; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * 设备类型 - * 针对多套 用户体系 - * - * @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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/DemoModeException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/DemoModeException.java deleted file mode 100644 index 063bb4e4..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/DemoModeException.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xmzs.common.core.exception; - -import java.io.Serial; - -/** - * 演示模式异常 - * - * @author ruoyi - */ -public class DemoModeException extends RuntimeException { - - @Serial - private static final long serialVersionUID = 1L; - - public DemoModeException() { - } -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/GlobalException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/GlobalException.java deleted file mode 100644 index 0b5ef2ae..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/GlobalException.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.xmzs.common.core.exception; - -import java.io.Serial; - -/** - * 全局异常 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/ServiceException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/ServiceException.java deleted file mode 100644 index ff85efbf..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/ServiceException.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.xmzs.common.core.exception; - -import java.io.Serial; - -/** - * 业务异常 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/UtilException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/UtilException.java deleted file mode 100644 index e2455364..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/UtilException.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.common.core.exception; - -import java.io.Serial; - -/** - * 工具类异常 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/base/BaseException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/base/BaseException.java deleted file mode 100644 index a92efa84..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/base/BaseException.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.xmzs.common.core.exception.base; - -import com.xmzs.common.core.utils.MessageUtils; -import com.xmzs.common.core.utils.StringUtils; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -import java.io.Serial; - -/** - * 基础异常 - * - * @author ruoyi - */ -@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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileException.java deleted file mode 100644 index eb559996..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileException.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.common.core.exception.file; - -import com.xmzs.common.core.exception.base.BaseException; - -import java.io.Serial; - -/** - * 文件信息异常类 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileNameLengthLimitExceededException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileNameLengthLimitExceededException.java deleted file mode 100644 index 905883fc..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileNameLengthLimitExceededException.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.exception.file; - -import java.io.Serial; - -/** - * 文件名称超长限制异常类 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileSizeLimitExceededException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileSizeLimitExceededException.java deleted file mode 100644 index f39046ea..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/file/FileSizeLimitExceededException.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.exception.file; - -import java.io.Serial; - -/** - * 文件名大小限制异常类 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/CaptchaException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/CaptchaException.java deleted file mode 100644 index 1a4b885e..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/CaptchaException.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.exception.user; - -import java.io.Serial; - -/** - * 验证码错误异常类 - * - * @author ruoyi - */ -public class CaptchaException extends UserException { - - @Serial - private static final long serialVersionUID = 1L; - - public CaptchaException() { - super("user.jcaptcha.error"); - } -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/CaptchaExpireException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/CaptchaExpireException.java deleted file mode 100644 index 5b7193f6..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/CaptchaExpireException.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.exception.user; - -import java.io.Serial; - -/** - * 验证码失效异常类 - * - * @author ruoyi - */ -public class CaptchaExpireException extends UserException { - - @Serial - private static final long serialVersionUID = 1L; - - public CaptchaExpireException() { - super("user.jcaptcha.expire"); - } -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserException.java deleted file mode 100644 index 43c4b730..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserException.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.common.core.exception.user; - -import com.xmzs.common.core.exception.base.BaseException; - -import java.io.Serial; - -/** - * 用户信息异常类 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserPasswordNotMatchException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserPasswordNotMatchException.java deleted file mode 100644 index 12970b0d..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserPasswordNotMatchException.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.exception.user; - -import java.io.Serial; - -/** - * 用户密码不正确或不符合规范异常类 - * - * @author ruoyi - */ -public class UserPasswordNotMatchException extends UserException { - - @Serial - private static final long serialVersionUID = 1L; - - public UserPasswordNotMatchException() { - super("user.password.not.match"); - } -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserPasswordRetryLimitExceedException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserPasswordRetryLimitExceedException.java deleted file mode 100644 index 80f3674a..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/exception/user/UserPasswordRetryLimitExceedException.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.common.core.exception.user; - -import java.io.Serial; - -/** - * 用户错误最大次数异常类 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/manager/ShutdownManager.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/manager/ShutdownManager.java deleted file mode 100644 index 9773f285..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/manager/ShutdownManager.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.xmzs.common.core.manager; - -import com.xmzs.common.core.utils.Threads; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Component; - -import jakarta.annotation.PreDestroy; -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/ConfigService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/ConfigService.java deleted file mode 100644 index e8d9eacc..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/ConfigService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.service; - -/** - * 通用 参数配置服务 - * - * @author Lion Li - */ -public interface ConfigService { - - /** - * 根据参数 key 获取参数值 - * - * @param configKey 参数 key - * @return 参数值 - */ - String getConfigValue(String configKey); - -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/DeptService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/DeptService.java deleted file mode 100644 index 74be3b5f..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/DeptService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.service; - -/** - * 通用 部门服务 - * - * @author Lion Li - */ -public interface DeptService { - - /** - * 通过部门ID查询部门名称 - * - * @param deptIds 部门ID串逗号分隔 - * @return 部门名称串逗号分隔 - */ - String selectDeptNameByIds(String deptIds); - -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/DictService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/DictService.java deleted file mode 100644 index 8716ccf1..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/DictService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/OssService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/OssService.java deleted file mode 100644 index f3524aa5..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/OssService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.service; - -/** - * 通用 OSS服务 - * - * @author Lion Li - */ -public interface OssService { - - /** - * 通过ossId查询对应的url - * - * @param ossIds ossId串逗号分隔 - * @return url串逗号分隔 - */ - String selectUrlByIds(String ossIds); - -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/UserService.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/UserService.java deleted file mode 100644 index 3bd2de59..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/service/UserService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.core.service; - -/** - * 通用 用户服务 - * - * @author Lion Li - */ -public interface UserService { - - /** - * 通过用户ID查询用户账户 - * - * @param userId 用户ID - * @return 用户账户 - */ - String selectUserNameById(Long userId); - -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/DateUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/DateUtils.java deleted file mode 100644 index 35718dba..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/DateUtils.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.xmzs.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.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.Date; - -/** - * 时间工具类 - * - * @author ruoyi - */ -@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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/JsonUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/JsonUtils.java deleted file mode 100644 index 4827aa7b..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/JsonUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/MapstructUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/MapstructUtils.java deleted file mode 100644 index 0c5820bf..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/MapstructUtils.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/MessageUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/MessageUtils.java deleted file mode 100644 index c4936585..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/MessageUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ServletUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ServletUtils.java deleted file mode 100644 index 262b9efc..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ServletUtils.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.xmzs.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 ruoyi - */ -@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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/SpringUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/SpringUtils.java deleted file mode 100644 index d69af178..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/SpringUtils.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/StreamUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/StreamUtils.java deleted file mode 100644 index 8f6161fa..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/StreamUtils.java +++ /dev/null @@ -1,254 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/StringUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/StringUtils.java deleted file mode 100644 index a225d704..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/StringUtils.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/Threads.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/Threads.java deleted file mode 100644 index be9c255f..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/Threads.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.xmzs.common.core.utils; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -import java.util.concurrent.*; - -/** - * 线程相关工具类. - * - * @author ruoyi - */ -@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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/TreeBuildUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/TreeBuildUtils.java deleted file mode 100644 index 6cec55b0..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/TreeBuildUtils.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.reflect.ReflectUtils; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ValidatorUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ValidatorUtils.java deleted file mode 100644 index 9c94de2f..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ValidatorUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.common.core.utils; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -import jakarta.validation.ConstraintViolation; -import jakarta.validation.ConstraintViolationException; -import jakarta.validation.Validator; -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/file/FileUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/file/FileUtils.java deleted file mode 100644 index a21d3cbe..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/file/FileUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xmzs.common.core.utils.file; - -import cn.hutool.core.io.FileUtil; -import jakarta.servlet.http.HttpServletResponse; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; - -/** - * 文件处理工具类 - * - * @author Lion Li - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public class FileUtils extends FileUtil { - - /** - * 下载文件名重新编码 - * - * @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"); - } -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/file/MimeTypeUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/file/MimeTypeUtils.java deleted file mode 100644 index 403a1bf4..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/file/MimeTypeUtils.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.xmzs.common.core.utils.file; - -/** - * 媒体类型工具类 - * - * @author ruoyi - */ -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[] 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", - // pdf - "pdf"}; - -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ip/AddressUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ip/AddressUtils.java deleted file mode 100644 index ff86003d..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ip/AddressUtils.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xmzs.common.core.utils.ip; - -import cn.hutool.core.net.NetUtil; -import cn.hutool.http.HtmlUtil; -import com.xmzs.common.core.utils.StringUtils; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -/** - * 获取地址类 - * - * @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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ip/RegionUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ip/RegionUtils.java deleted file mode 100644 index c618d93d..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/ip/RegionUtils.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.xmzs.common.core.utils.ip; - -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.io.resource.ClassPathResource; -import cn.hutool.core.util.ObjectUtil; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.file.FileUtils; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/reflect/ReflectUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/reflect/ReflectUtils.java deleted file mode 100644 index 13392587..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/reflect/ReflectUtils.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.xmzs.common.core.utils.reflect; - -import cn.hutool.core.util.ReflectUtil; -import com.xmzs.common.core.utils.StringUtils; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/sql/SqlUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/sql/SqlUtil.java deleted file mode 100644 index 46fa9255..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/utils/sql/SqlUtil.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.xmzs.common.core.utils.sql; - -import com.xmzs.common.core.exception.UtilException; -import com.xmzs.common.core.utils.StringUtils; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * sql操作工具类 - * - * @author ruoyi - */ -@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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/AddGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/AddGroup.java deleted file mode 100644 index 0fa2a72c..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/AddGroup.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.xmzs.common.core.validate; - -/** - * 校验分组 add - * - * @author Lion Li - */ -public interface AddGroup { -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/EditGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/EditGroup.java deleted file mode 100644 index 85a780ec..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/EditGroup.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.xmzs.common.core.validate; - -/** - * 校验分组 edit - * - * @author Lion Li - */ -public interface EditGroup { -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/QueryGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/QueryGroup.java deleted file mode 100644 index 89edfeea..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/validate/QueryGroup.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.xmzs.common.core.validate; - -/** - * 校验分组 query - * - * @author Lion Li - */ -public interface QueryGroup { -} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/xss/Xss.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/xss/Xss.java deleted file mode 100644 index 595a4248..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/xss/Xss.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/xss/XssValidator.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/xss/XssValidator.java deleted file mode 100644 index 902b900b..00000000 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/xmzs/common/core/xss/XssValidator.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-core/src/main/java/org/ruoyi/common/core/constant/Constants.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/ruoyi/common/core/constant/Constants.java index 41001002..b8f55c2d 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/ruoyi/common/core/constant/Constants.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/ruoyi/common/core/constant/Constants.java @@ -67,6 +67,16 @@ public interface Constants { */ Integer CAPTCHA_EXPIRATION = 30; + /** + * 文多多apiToken KEY + */ + String WDD_TOKEN_KEY = "sys_chat:wdd_api_token:"; + + /** + * 文多多apiToken有效期(分钟) + */ + Integer WDD_TOKEN_EXPIRATION = 60 * 2; + /** * 令牌 */ diff --git a/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/config/SwaggerConfig.java b/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/config/SwaggerConfig.java deleted file mode 100644 index 19bb10d1..00000000 --- a/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/config/SwaggerConfig.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.xmzs.common.doc.config; - -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.doc.config.properties.SwaggerProperties; -import com.xmzs.common.doc.handler.OpenApiHandler; -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.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/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/config/properties/SwaggerProperties.java b/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/config/properties/SwaggerProperties.java deleted file mode 100644 index b94519c4..00000000 --- a/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/config/properties/SwaggerProperties.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/handler/OpenApiHandler.java b/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/handler/OpenApiHandler.java deleted file mode 100644 index ddf888ff..00000000 --- a/ruoyi-common/ruoyi-common-doc/src/main/java/com/xmzs/common/doc/handler/OpenApiHandler.java +++ /dev/null @@ -1,252 +0,0 @@ -package com.xmzs.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)) { - io.swagger.v3.oas.models.tags.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)) { - io.swagger.v3.oas.models.tags.Tag tag = new io.swagger.v3.oas.models.tags.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/annotation/EncryptField.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/annotation/EncryptField.java deleted file mode 100644 index 536a07bf..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/annotation/EncryptField.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.xmzs.common.encrypt.annotation; - -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/config/EncryptorAutoConfiguration.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/config/EncryptorAutoConfiguration.java deleted file mode 100644 index 3d7f0930..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/config/EncryptorAutoConfiguration.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.xmzs.common.encrypt.config; - -import com.xmzs.common.encrypt.core.EncryptorManager; -import com.xmzs.common.encrypt.interceptor.MybatisDecryptInterceptor; -import com.xmzs.common.encrypt.interceptor.MybatisEncryptInterceptor; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/EncryptContext.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/EncryptContext.java deleted file mode 100644 index 9dc9ae51..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/EncryptContext.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.xmzs.common.encrypt.core; - -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.common.encrypt.enumd.EncodeType; -import lombok.Data; - -/** - * 加密上下文 用于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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/EncryptorManager.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/EncryptorManager.java deleted file mode 100644 index 088fb5bc..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/EncryptorManager.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.xmzs.common.encrypt.core; - -import cn.hutool.core.util.ReflectUtil; -import com.xmzs.common.encrypt.annotation.EncryptField; -import lombok.extern.slf4j.Slf4j; - -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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/IEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/IEncryptor.java deleted file mode 100644 index f9fef582..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/IEncryptor.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.common.encrypt.core; - -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/AbstractEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/AbstractEncryptor.java deleted file mode 100644 index 6f6c7400..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/AbstractEncryptor.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.encrypt.core.encryptor; - -import com.xmzs.common.encrypt.core.EncryptContext; -import com.xmzs.common.encrypt.core.IEncryptor; - -/** - * 所有加密执行者的基类 - * - * @author 老马 - * @version 4.6.0 - */ -public abstract class AbstractEncryptor implements IEncryptor { - - public AbstractEncryptor(EncryptContext context) { - // 用户配置校验与配置注入 - } - -} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/AesEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/AesEncryptor.java deleted file mode 100644 index 02957ba7..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/AesEncryptor.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.xmzs.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 com.xmzs.common.encrypt.core.EncryptContext; -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Base64Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Base64Encryptor.java deleted file mode 100644 index f4567e00..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Base64Encryptor.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.common.encrypt.core.encryptor; - -import cn.hutool.core.codec.Base64; -import com.xmzs.common.encrypt.core.EncryptContext; -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/RsaEncryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/RsaEncryptor.java deleted file mode 100644 index f21a8540..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/RsaEncryptor.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.encrypt.core.EncryptContext; -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Sm2Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Sm2Encryptor.java deleted file mode 100644 index 149a65f6..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Sm2Encryptor.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.encrypt.core.EncryptContext; -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Sm4Encryptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Sm4Encryptor.java deleted file mode 100644 index f2374ace..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/core/encryptor/Sm4Encryptor.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.xmzs.common.encrypt.core.encryptor; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.crypto.SmUtil; -import cn.hutool.crypto.symmetric.SM4; -import com.xmzs.common.encrypt.core.EncryptContext; -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/enumd/AlgorithmType.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/enumd/AlgorithmType.java deleted file mode 100644 index fe90715c..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/enumd/AlgorithmType.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.common.encrypt.enumd; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/enumd/EncodeType.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/enumd/EncodeType.java deleted file mode 100644 index e41dcd0c..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/enumd/EncodeType.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.common.encrypt.enumd; - -/** - * 编码类型 - * - * @author 老马 - * @version 4.6.0 - */ -public enum EncodeType { - - /** - * 默认使用yml配置 - */ - DEFAULT, - - /** - * base64编码 - */ - BASE64, - - /** - * 16进制编码 - */ - HEX; - -} diff --git a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/interceptor/MybatisDecryptInterceptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/interceptor/MybatisDecryptInterceptor.java deleted file mode 100644 index c64465d6..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/interceptor/MybatisDecryptInterceptor.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.encrypt.annotation.EncryptField; -import com.xmzs.common.encrypt.core.EncryptContext; -import com.xmzs.common.encrypt.core.EncryptorManager; -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.common.encrypt.enumd.EncodeType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/interceptor/MybatisEncryptInterceptor.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/interceptor/MybatisEncryptInterceptor.java deleted file mode 100644 index c79baadf..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/interceptor/MybatisEncryptInterceptor.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.encrypt.annotation.EncryptField; -import com.xmzs.common.encrypt.core.EncryptContext; -import com.xmzs.common.encrypt.core.EncryptorManager; -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.common.encrypt.enumd.EncodeType; -import com.xmzs.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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/properties/EncryptorProperties.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/properties/EncryptorProperties.java deleted file mode 100644 index ab67a6dc..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/properties/EncryptorProperties.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.common.encrypt.properties; - -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import com.xmzs.common.encrypt.enumd.EncodeType; -import lombok.Data; -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/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/utils/EncryptUtils.java b/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/utils/EncryptUtils.java deleted file mode 100644 index bc92cc2c..00000000 --- a/ruoyi-common/ruoyi-common-encrypt/src/main/java/com/xmzs/common/encrypt/utils/EncryptUtils.java +++ /dev/null @@ -1,243 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/CellMerge.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/CellMerge.java deleted file mode 100644 index 6893a689..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/CellMerge.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xmzs.common.excel.annotation; - -import com.xmzs.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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/ExcelDictFormat.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/ExcelDictFormat.java deleted file mode 100644 index 2458d3d5..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/ExcelDictFormat.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xmzs.common.excel.annotation; - -import com.xmzs.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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/ExcelEnumFormat.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/ExcelEnumFormat.java deleted file mode 100644 index b0822954..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/annotation/ExcelEnumFormat.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelBigNumberConvert.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelBigNumberConvert.java deleted file mode 100644 index f3a61199..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelBigNumberConvert.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelDictConvert.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelDictConvert.java deleted file mode 100644 index 1136c78c..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelDictConvert.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.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 com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.core.service.DictService; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.excel.utils.ExcelUtil; -import lombok.extern.slf4j.Slf4j; - -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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelEnumConvert.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelEnumConvert.java deleted file mode 100644 index c7f48e27..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/convert/ExcelEnumConvert.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.reflect.ReflectUtils; -import com.xmzs.common.excel.annotation.ExcelEnumFormat; -import lombok.extern.slf4j.Slf4j; - -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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/CellMergeStrategy.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/CellMergeStrategy.java deleted file mode 100644 index f6852cc1..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/CellMergeStrategy.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.reflect.ReflectUtils; -import com.xmzs.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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/DefaultExcelListener.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/DefaultExcelListener.java deleted file mode 100644 index cb267bcb..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/DefaultExcelListener.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.ValidatorUtils; -import com.xmzs.common.json.utils.JsonUtils; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.ConstraintViolationException; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/DefaultExcelResult.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/DefaultExcelResult.java deleted file mode 100644 index 4c3302c1..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/DefaultExcelResult.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/ExcelListener.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/ExcelListener.java deleted file mode 100644 index 7e9fa448..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/ExcelListener.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.common.excel.core; - -import com.alibaba.excel.read.listener.ReadListener; - -/** - * Excel 导入监听 - * - * @author Lion Li - */ -public interface ExcelListener extends ReadListener { - - ExcelResult getExcelResult(); - -} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/ExcelResult.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/ExcelResult.java deleted file mode 100644 index 105304e3..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/core/ExcelResult.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.common.excel.core; - -import java.util.List; - -/** - * excel返回对象 - * - * @author Lion Li - */ -public interface ExcelResult { - - /** - * 对象列表 - */ - List getList(); - - /** - * 错误列表 - */ - List getErrorList(); - - /** - * 导入回执 - */ - String getAnalysis(); -} diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/utils/ExcelUtil.java b/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/utils/ExcelUtil.java deleted file mode 100644 index 8351849b..00000000 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/com/xmzs/common/excel/utils/ExcelUtil.java +++ /dev/null @@ -1,327 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.file.FileUtils; -import com.xmzs.common.excel.convert.ExcelBigNumberConvert; -import com.xmzs.common.excel.core.CellMergeStrategy; -import com.xmzs.common.excel.core.DefaultExcelListener; -import com.xmzs.common.excel.core.ExcelListener; -import com.xmzs.common.excel.core.ExcelResult; -import jakarta.servlet.ServletOutputStream; -import jakarta.servlet.http.HttpServletResponse; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -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/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/annotation/RepeatSubmit.java b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/annotation/RepeatSubmit.java deleted file mode 100644 index 541ddbcf..00000000 --- a/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/annotation/RepeatSubmit.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/aspectj/RepeatSubmitAspect.java b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/aspectj/RepeatSubmitAspect.java deleted file mode 100644 index 91f4b665..00000000 --- a/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/aspectj/RepeatSubmitAspect.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.xmzs.common.idempotent.aspectj; - -import cn.dev33.satoken.SaManager; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.crypto.SecureUtil; -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.MessageUtils; -import com.xmzs.common.core.utils.ServletUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.idempotent.annotation.RepeatSubmit; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.redis.utils.RedisUtils; -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.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/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/config/IdempotentConfig.java b/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/config/IdempotentConfig.java deleted file mode 100644 index 2964617c..00000000 --- a/ruoyi-common/ruoyi-common-idempotent/src/main/java/com/xmzs/common/idempotent/config/IdempotentConfig.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.common.idempotent.config; - -import com.xmzs.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/ruoyi-common/ruoyi-common-job/pom.xml b/ruoyi-common/ruoyi-common-job/pom.xml deleted file mode 100644 index d820f20f..00000000 --- a/ruoyi-common/ruoyi-common-job/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - com.xmzs - ruoyi-common - ${revision} - ../pom.xml - - 4.0.0 - - ruoyi-common-job - - - ruoyi-common-job 定时任务 - - - - - - org.springframework.boot - spring-boot-autoconfigure - - - - - com.xuxueli - xxl-job-core - - - - org.projectlombok - lombok - - - - com.xmzs - ruoyi-common-core - - - - diff --git a/ruoyi-common/ruoyi-common-job/src/main/java/com/xmzs/common/job/config/XxlJobConfig.java b/ruoyi-common/ruoyi-common-job/src/main/java/com/xmzs/common/job/config/XxlJobConfig.java deleted file mode 100644 index c7d184e9..00000000 --- a/ruoyi-common/ruoyi-common-job/src/main/java/com/xmzs/common/job/config/XxlJobConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.common.job.config; - -import com.xmzs.common.job.config.properties.XxlJobProperties; -import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; -import lombok.extern.slf4j.Slf4j; -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; - -/** - * xxl-job config - * - * @author Lion Li - */ -@Slf4j -@AutoConfiguration -@EnableConfigurationProperties(XxlJobProperties.class) -@ConditionalOnProperty(prefix = "xxl.job", name = "enabled", havingValue = "true") -public class XxlJobConfig { - - @Bean - public XxlJobSpringExecutor xxlJobExecutor(XxlJobProperties xxlJobProperties) { - log.info(">>>>>>>>>>> xxl-job config init."); - XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); - xxlJobSpringExecutor.setAdminAddresses(xxlJobProperties.getAdminAddresses()); - xxlJobSpringExecutor.setAccessToken(xxlJobProperties.getAccessToken()); - XxlJobProperties.Executor executor = xxlJobProperties.getExecutor(); - xxlJobSpringExecutor.setAppname(executor.getAppname()); - xxlJobSpringExecutor.setAddress(executor.getAddress()); - xxlJobSpringExecutor.setIp(executor.getIp()); - xxlJobSpringExecutor.setPort(executor.getPort()); - xxlJobSpringExecutor.setLogPath(executor.getLogPath()); - xxlJobSpringExecutor.setLogRetentionDays(executor.getLogRetentionDays()); - return xxlJobSpringExecutor; - } - -} diff --git a/ruoyi-common/ruoyi-common-job/src/main/java/com/xmzs/common/job/config/properties/XxlJobProperties.java b/ruoyi-common/ruoyi-common-job/src/main/java/com/xmzs/common/job/config/properties/XxlJobProperties.java deleted file mode 100644 index 5beb4734..00000000 --- a/ruoyi-common/ruoyi-common-job/src/main/java/com/xmzs/common/job/config/properties/XxlJobProperties.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.xmzs.common.job.config.properties; - -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * xxljob配置类 - * - * @author Lion Li - */ -@Data -@ConfigurationProperties(prefix = "xxl.job") -public class XxlJobProperties { - - private Boolean enabled; - - private String adminAddresses; - - private String accessToken; - - private Executor executor; - - @Data - @NoArgsConstructor - public static class Executor { - - private String appname; - - private String address; - - private String ip; - - private int port; - - private String logPath; - - private int logRetentionDays; - } -} diff --git a/ruoyi-common/ruoyi-common-job/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java b/ruoyi-common/ruoyi-common-job/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java deleted file mode 100644 index 00cd8228..00000000 --- a/ruoyi-common/ruoyi-common-job/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.xxl.job.core.glue.impl; - -import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; -import com.xxl.job.core.glue.GlueFactory; -import jakarta.annotation.Resource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.core.annotation.AnnotationUtils; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; - -/** - * @author xuxueli 2018-11-01 - */ -public class SpringGlueFactory extends GlueFactory { - private static Logger logger = LoggerFactory.getLogger(SpringGlueFactory.class); - - - /** - * inject action of spring - * @param instance - */ - @Override - public void injectService(Object instance){ - if (instance==null) { - return; - } - - if (XxlJobSpringExecutor.getApplicationContext() == null) { - return; - } - - Field[] fields = instance.getClass().getDeclaredFields(); - for (Field field : fields) { - if (Modifier.isStatic(field.getModifiers())) { - continue; - } - - Object fieldBean = null; - // with bean-id, bean could be found by both @Resource and @Autowired, or bean could only be found by @Autowired - - if (AnnotationUtils.getAnnotation(field, Resource.class) != null) { - try { - Resource resource = AnnotationUtils.getAnnotation(field, Resource.class); - if (resource.name()!=null && resource.name().length()>0){ - fieldBean = XxlJobSpringExecutor.getApplicationContext().getBean(resource.name()); - } else { - fieldBean = XxlJobSpringExecutor.getApplicationContext().getBean(field.getName()); - } - } catch (Exception e) { - } - if (fieldBean==null ) { - fieldBean = XxlJobSpringExecutor.getApplicationContext().getBean(field.getType()); - } - } else if (AnnotationUtils.getAnnotation(field, Autowired.class) != null) { - Qualifier qualifier = AnnotationUtils.getAnnotation(field, Qualifier.class); - if (qualifier!=null && qualifier.value()!=null && qualifier.value().length()>0) { - fieldBean = XxlJobSpringExecutor.getApplicationContext().getBean(qualifier.value()); - } else { - fieldBean = XxlJobSpringExecutor.getApplicationContext().getBean(field.getType()); - } - } - - if (fieldBean!=null) { - field.setAccessible(true); - try { - field.set(instance, fieldBean); - } catch (IllegalArgumentException e) { - logger.error(e.getMessage(), e); - } catch (IllegalAccessException e) { - logger.error(e.getMessage(), e); - } - } - } - } - -} diff --git a/ruoyi-common/ruoyi-common-job/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-job/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports deleted file mode 100644 index 559a39df..00000000 --- a/ruoyi-common/ruoyi-common-job/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ /dev/null @@ -1 +0,0 @@ -com.xmzs.common.job.config.XxlJobConfig diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/config/JacksonConfig.java b/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/config/JacksonConfig.java deleted file mode 100644 index 9ed093ea..00000000 --- a/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/config/JacksonConfig.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.xmzs.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 com.xmzs.common.json.handler.BigNumberSerializer; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/handler/BigNumberSerializer.java b/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/handler/BigNumberSerializer.java deleted file mode 100644 index 256b1973..00000000 --- a/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/handler/BigNumberSerializer.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/utils/JsonUtils.java b/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/utils/JsonUtils.java deleted file mode 100644 index 904f86bd..00000000 --- a/ruoyi-common/ruoyi-common-json/src/main/java/com/xmzs/common/json/utils/JsonUtils.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -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/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/annotation/Log.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/annotation/Log.java deleted file mode 100644 index 2265d464..00000000 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/annotation/Log.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.common.log.annotation; - -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.log.enums.OperatorType; - -import java.lang.annotation.*; - -/** - * 自定义操作日志记录注解 - * - * @author ruoyi - */ -@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/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/aspect/LogAspect.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/aspect/LogAspect.java deleted file mode 100644 index 41c091c4..00000000 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/aspect/LogAspect.java +++ /dev/null @@ -1,221 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.ServletUtils; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessStatus; -import com.xmzs.common.log.event.OperLogEvent; -import com.xmzs.common.satoken.utils.LoginHelper; -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.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/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/BusinessStatus.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/BusinessStatus.java deleted file mode 100644 index 84109a7f..00000000 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/BusinessStatus.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.log.enums; - -/** - * 操作状态 - * - * @author ruoyi - */ -public enum BusinessStatus { - /** - * 成功 - */ - SUCCESS, - - /** - * 失败 - */ - FAIL, -} diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/BusinessType.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/BusinessType.java deleted file mode 100644 index 698123f5..00000000 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/BusinessType.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.xmzs.common.log.enums; - -/** - * 业务操作类型 - * - * @author ruoyi - */ -public enum BusinessType { - /** - * 其它 - */ - OTHER, - - /** - * 新增 - */ - INSERT, - - /** - * 修改 - */ - UPDATE, - - /** - * 删除 - */ - DELETE, - - /** - * 授权 - */ - GRANT, - - /** - * 导出 - */ - EXPORT, - - /** - * 导入 - */ - IMPORT, - - /** - * 强退 - */ - FORCE, - - /** - * 生成代码 - */ - GENCODE, - - /** - * 清空数据 - */ - CLEAN, -} diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/OperatorType.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/OperatorType.java deleted file mode 100644 index f83a8c75..00000000 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/enums/OperatorType.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.common.log.enums; - -/** - * 操作人类别 - * - * @author ruoyi - */ -public enum OperatorType { - /** - * 其它 - */ - OTHER, - - /** - * 后台用户 - */ - MANAGE, - - /** - * 手机端用户 - */ - MOBILE -} diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/event/LogininforEvent.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/event/LogininforEvent.java deleted file mode 100644 index 10a9340e..00000000 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/event/LogininforEvent.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xmzs.common.log.event; - -import lombok.Data; - -import jakarta.servlet.http.HttpServletRequest; - -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/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/event/OperLogEvent.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/event/OperLogEvent.java deleted file mode 100644 index 8ab5529d..00000000 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/xmzs/common/log/event/OperLogEvent.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/config/MailConfig.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/config/MailConfig.java deleted file mode 100644 index 97046924..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/config/MailConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xmzs.common.mail.config; - -import com.xmzs.common.mail.config.properties.MailProperties; -import com.xmzs.common.mail.utils.MailAccount; -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; - -/** - * JavaMail 配置 - * - * @author Michelle.Chung - */ -@AutoConfiguration -@EnableConfigurationProperties(MailProperties.class) -public class MailConfig { - - @Bean - @ConditionalOnProperty(value = "mail.enabled", havingValue = "true") - public MailAccount mailAccount(MailProperties mailProperties) { - MailAccount account = new MailAccount(); - account.setHost(mailProperties.getHost()); - account.setPort(mailProperties.getPort()); - account.setAuth(mailProperties.getAuth()); - account.setFrom(mailProperties.getFrom()); - account.setUser(mailProperties.getUser()); - account.setPass(mailProperties.getPass()); - account.setSocketFactoryPort(mailProperties.getPort()); - account.setStarttlsEnable(mailProperties.getStarttlsEnable()); - account.setSslEnable(mailProperties.getSslEnable()); - account.setTimeout(mailProperties.getTimeout()); - account.setConnectionTimeout(mailProperties.getConnectionTimeout()); - return account; - } - -} diff --git a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/config/properties/MailProperties.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/config/properties/MailProperties.java deleted file mode 100644 index c7272b57..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/config/properties/MailProperties.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.xmzs.common.mail.config.properties; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * JavaMail 配置属性 - * - * @author Michelle.Chung - */ -@Data -@ConfigurationProperties(prefix = "mail") -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/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/GlobalMailAccount.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/GlobalMailAccount.java deleted file mode 100644 index bdc72a87..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/GlobalMailAccount.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/InternalMailUtil.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/InternalMailUtil.java deleted file mode 100644 index 0426754f..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/InternalMailUtil.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/Mail.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/Mail.java deleted file mode 100644 index 51d3b477..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/Mail.java +++ /dev/null @@ -1,483 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailAccount.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailAccount.java deleted file mode 100644 index 8e0fbd24..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailAccount.java +++ /dev/null @@ -1,659 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailException.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailException.java deleted file mode 100644 index c5caaf36..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailException.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailUtils.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailUtils.java deleted file mode 100644 index 8a422b62..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/MailUtils.java +++ /dev/null @@ -1,468 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.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/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/UserPassAuthenticator.java b/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/UserPassAuthenticator.java deleted file mode 100644 index 9f3ebac2..00000000 --- a/ruoyi-common/ruoyi-common-mail/src/main/java/com/xmzs/common/mail/utils/UserPassAuthenticator.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/annotation/DataColumn.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/annotation/DataColumn.java deleted file mode 100644 index 5b86fa1f..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/annotation/DataColumn.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/annotation/DataPermission.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/annotation/DataPermission.java deleted file mode 100644 index 8737eee6..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/annotation/DataPermission.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/config/MybatisPlusConfig.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/config/MybatisPlusConfig.java deleted file mode 100644 index 9ffde5e5..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/config/MybatisPlusConfig.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.xmzs.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 com.xmzs.common.mybatis.handler.InjectionMetaObjectHandler; -import com.xmzs.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/domain/BaseEntity.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/domain/BaseEntity.java deleted file mode 100644 index 732f414e..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/domain/BaseEntity.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/mapper/BaseMapperPlus.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/mapper/BaseMapperPlus.java deleted file mode 100644 index 8db817b3..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/mapper/BaseMapperPlus.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.MapstructUtils; -import org.apache.ibatis.logging.Log; -import org.apache.ibatis.logging.LogFactory; - -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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/page/PageQuery.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/page/PageQuery.java deleted file mode 100644 index 4e43f11d..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/page/PageQuery.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.sql.SqlUtil; -import lombok.Data; - -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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/page/TableDataInfo.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/page/TableDataInfo.java deleted file mode 100644 index 631f83b8..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/core/page/TableDataInfo.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/enums/DataBaseType.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/enums/DataBaseType.java deleted file mode 100644 index 5e7d47ce..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/enums/DataBaseType.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.common.mybatis.enums; - -import com.xmzs.common.core.utils.StringUtils; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * 数据库类型 - * - * @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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/enums/DataScopeType.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/enums/DataScopeType.java deleted file mode 100644 index 7b566e9d..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/enums/DataScopeType.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.common.mybatis.enums; - -import com.xmzs.common.core.utils.StringUtils; -import lombok.AllArgsConstructor; -import lombok.Getter; -import com.xmzs.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/InjectionMetaObjectHandler.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/InjectionMetaObjectHandler.java deleted file mode 100644 index cc37dcd5..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/InjectionMetaObjectHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.xmzs.common.mybatis.handler; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.http.HttpStatus; -import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.common.satoken.utils.LoginHelper; -import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.reflection.MetaObject; - -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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/MybatisExceptionHandler.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/MybatisExceptionHandler.java deleted file mode 100644 index b072fa1d..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/MybatisExceptionHandler.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.xmzs.common.mybatis.handler; - -import com.xmzs.common.core.domain.R; -import lombok.extern.slf4j.Slf4j; -import org.mybatis.spring.MyBatisSystemException; -import org.springframework.dao.DuplicateKeyException; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -import jakarta.servlet.http.HttpServletRequest; - -/** - * 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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/PlusDataPermissionHandler.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/PlusDataPermissionHandler.java deleted file mode 100644 index 87c312ee..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/handler/PlusDataPermissionHandler.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.domain.dto.RoleDTO; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.annotation.DataColumn; -import com.xmzs.common.mybatis.annotation.DataPermission; -import com.xmzs.common.mybatis.enums.DataScopeType; -import com.xmzs.common.mybatis.helper.DataPermissionHelper; -import com.xmzs.common.satoken.utils.LoginHelper; -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.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/helper/DataBaseHelper.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/helper/DataBaseHelper.java deleted file mode 100644 index 6306857d..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/helper/DataBaseHelper.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.xmzs.common.mybatis.helper; - -import cn.hutool.core.convert.Convert; -import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.mybatis.enums.DataBaseType; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/helper/DataPermissionHelper.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/helper/DataPermissionHelper.java deleted file mode 100644 index 74e5a210..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/helper/DataPermissionHelper.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/interceptor/PlusDataPermissionInterceptor.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/interceptor/PlusDataPermissionInterceptor.java deleted file mode 100644 index e434c241..00000000 --- a/ruoyi-common/ruoyi-common-mybatis/src/main/java/com/xmzs/common/mybatis/interceptor/PlusDataPermissionInterceptor.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.xmzs.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 com.xmzs.common.mybatis.handler.PlusDataPermissionHandler; -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 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/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/constant/OssConstant.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/constant/OssConstant.java deleted file mode 100644 index 5b7d456f..00000000 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/constant/OssConstant.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/core/OssClient.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/core/OssClient.java deleted file mode 100644 index 3eda58a6..00000000 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/core/OssClient.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.DateUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.oss.constant.OssConstant; -import com.xmzs.common.oss.entity.UploadResult; -import com.xmzs.common.oss.enumd.AccessPolicyType; -import com.xmzs.common.oss.enumd.PolicyType; -import com.xmzs.common.oss.exception.OssException; -import com.xmzs.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/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/entity/UploadResult.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/entity/UploadResult.java deleted file mode 100644 index df554459..00000000 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/entity/UploadResult.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/enumd/AccessPolicyType.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/enumd/AccessPolicyType.java deleted file mode 100644 index 0d71f94d..00000000 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/enumd/AccessPolicyType.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/enumd/PolicyType.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/enumd/PolicyType.java deleted file mode 100644 index ad9d30a3..00000000 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/enumd/PolicyType.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/exception/OssException.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/exception/OssException.java deleted file mode 100644 index 0029ca6a..00000000 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/exception/OssException.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/factory/OssFactory.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/factory/OssFactory.java deleted file mode 100644 index 220c092c..00000000 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/factory/OssFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.xmzs.common.oss.factory; - -import com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.oss.constant.OssConstant; -import com.xmzs.common.oss.core.OssClient; -import com.xmzs.common.oss.exception.OssException; -import com.xmzs.common.oss.properties.OssProperties; -import com.xmzs.common.redis.utils.CacheUtils; -import com.xmzs.common.redis.utils.RedisUtils; -import lombok.extern.slf4j.Slf4j; - -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/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/properties/OssProperties.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/properties/OssProperties.java deleted file mode 100644 index cbc5df7e..00000000 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/xmzs/common/oss/properties/OssProperties.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/config/PayConfig.java b/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/config/PayConfig.java deleted file mode 100644 index 97436ac6..00000000 --- a/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/config/PayConfig.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.xmzs.common.config; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * 支付配置信息 - * - * @author Admin - */ -@Data -@Component -@ConfigurationProperties(prefix = "pay") -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/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/response/PayResponse.java b/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/response/PayResponse.java deleted file mode 100644 index de1d7829..00000000 --- a/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/response/PayResponse.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.xmzs.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -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/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/service/PayService.java b/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/service/PayService.java deleted file mode 100644 index 78d1cb96..00000000 --- a/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/service/PayService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/service/impl/PayServiceImpl.java b/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/service/impl/PayServiceImpl.java deleted file mode 100644 index b084aa47..00000000 --- a/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/service/impl/PayServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.xmzs.common.service.impl; - -import cn.hutool.http.HttpUtil; -import cn.hutool.json.JSONObject; - -import com.xmzs.common.config.PayConfig; -import com.xmzs.common.service.PayService; -import com.xmzs.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/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/utils/MD5Util.java b/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/utils/MD5Util.java deleted file mode 100644 index 1327cca3..00000000 --- a/ruoyi-common/ruoyi-common-pay/src/main/java/com/xmzs/common/utils/MD5Util.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.xmzs.common.utils; - -import cn.hutool.core.util.StrUtil; - -import java.io.UnsupportedEncodingException; -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/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/annotation/RateLimiter.java b/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/annotation/RateLimiter.java deleted file mode 100644 index 94e5969c..00000000 --- a/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/annotation/RateLimiter.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.xmzs.common.ratelimiter.annotation; - -import com.xmzs.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/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/aspectj/RateLimiterAspect.java b/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/aspectj/RateLimiterAspect.java deleted file mode 100644 index ec9ac999..00000000 --- a/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/aspectj/RateLimiterAspect.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.xmzs.common.ratelimiter.aspectj; - -import cn.hutool.core.util.ArrayUtil; -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.MessageUtils; -import com.xmzs.common.core.utils.ServletUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.ratelimiter.annotation.RateLimiter; -import com.xmzs.common.ratelimiter.enums.LimitType; -import com.xmzs.common.redis.utils.RedisUtils; -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.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/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/config/RateLimiterConfig.java b/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/config/RateLimiterConfig.java deleted file mode 100644 index 32a3c907..00000000 --- a/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/config/RateLimiterConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.common.ratelimiter.config; - -import com.xmzs.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/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/enums/LimitType.java b/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/enums/LimitType.java deleted file mode 100644 index df9c8e62..00000000 --- a/ruoyi-common/ruoyi-common-ratelimiter/src/main/java/com/xmzs/common/ratelimiter/enums/LimitType.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xmzs.common.ratelimiter.enums; - -/** - * 限流类型 - * - * @author ruoyi - */ - -public enum LimitType { - /** - * 默认策略全局限流 - */ - DEFAULT, - - /** - * 根据请求者IP进行限流 - */ - IP, - - /** - * 实例限流(集群多后端实例) - */ - CLUSTER -} diff --git a/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/config/RedisConfig.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/config/RedisConfig.java deleted file mode 100644 index cd57b82d..00000000 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/config/RedisConfig.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.xmzs.common.redis.config; - -import cn.hutool.core.util.ObjectUtil; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xmzs.common.redis.config.properties.RedissonProperties; -import com.xmzs.common.redis.handler.KeyPrefixHandler; -import com.xmzs.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: ${ruoyi.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/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/config/properties/RedissonProperties.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/config/properties/RedissonProperties.java deleted file mode 100644 index 18c5d212..00000000 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/config/properties/RedissonProperties.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/handler/KeyPrefixHandler.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/handler/KeyPrefixHandler.java deleted file mode 100644 index 2d06db47..00000000 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/handler/KeyPrefixHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.xmzs.common.redis.handler; - -import com.xmzs.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/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/manager/PlusSpringCacheManager.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/manager/PlusSpringCacheManager.java deleted file mode 100644 index ce618d93..00000000 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/manager/PlusSpringCacheManager.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * 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 com.xmzs.common.redis.manager; - -import com.xmzs.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 org.springframework.cache.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/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/CacheUtils.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/CacheUtils.java deleted file mode 100644 index 0358d3b5..00000000 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/CacheUtils.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.xmzs.common.redis.utils; - -import com.xmzs.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/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/QueueUtils.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/QueueUtils.java deleted file mode 100644 index 8f1c6505..00000000 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/QueueUtils.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.xmzs.common.redis.utils; - -import com.xmzs.common.core.utils.SpringUtils; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -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/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/RedisUtils.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/RedisUtils.java deleted file mode 100644 index c549d1e9..00000000 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/xmzs/common/redis/utils/RedisUtils.java +++ /dev/null @@ -1,462 +0,0 @@ -package com.xmzs.common.redis.utils; - -import com.xmzs.common.core.utils.SpringUtils; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -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/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/config/SaTokenConfig.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/config/SaTokenConfig.java deleted file mode 100644 index c947ab61..00000000 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/config/SaTokenConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xmzs.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 com.xmzs.common.satoken.core.dao.PlusSaTokenDao; -import com.xmzs.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/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/core/dao/PlusSaTokenDao.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/core/dao/PlusSaTokenDao.java deleted file mode 100644 index 6defa1a9..00000000 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/core/dao/PlusSaTokenDao.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.xmzs.common.satoken.core.dao; - -import cn.dev33.satoken.dao.SaTokenDao; -import cn.dev33.satoken.util.SaFoxUtil; -import com.xmzs.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/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/core/service/SaPermissionImpl.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/core/service/SaPermissionImpl.java deleted file mode 100644 index a6770480..00000000 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/core/service/SaPermissionImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.xmzs.common.satoken.core.service; - -import cn.dev33.satoken.stp.StpInterface; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.enums.UserType; -import com.xmzs.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/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/listener/UserActionListener.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/listener/UserActionListener.java deleted file mode 100644 index 3ab2097c..00000000 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/listener/UserActionListener.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheConstants; -import com.xmzs.common.core.domain.dto.UserOnlineDTO; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.enums.UserType; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.common.core.utils.ip.AddressUtils; -import com.xmzs.common.core.utils.ServletUtils; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/utils/LoginHelper.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/utils/LoginHelper.java deleted file mode 100644 index af170c9e..00000000 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/com/xmzs/common/satoken/utils/LoginHelper.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.TenantConstants; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.enums.DeviceType; -import com.xmzs.common.core.enums.UserType; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -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; - } - - /** - * 获取用户基于token - */ - public static LoginUser getLoginUser(String token) { - return (LoginUser) StpUtil.getTokenSessionByToken(token).get(LOGIN_USER_KEY); - } - - /** - * 获取用户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/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/config/SecurityConfig.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/config/SecurityConfig.java deleted file mode 100644 index e18cc4a2..00000000 --- a/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/config/SecurityConfig.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.xmzs.common.security.config; - -import cn.dev33.satoken.interceptor.SaInterceptor; -import cn.dev33.satoken.router.SaRouter; -import cn.dev33.satoken.stp.StpUtil; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.security.config.properties.SecurityProperties; -import com.xmzs.common.security.handler.AllUrlHandler; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/config/properties/SecurityProperties.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/config/properties/SecurityProperties.java deleted file mode 100644 index f4cf99fe..00000000 --- a/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/config/properties/SecurityProperties.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/handler/AllUrlHandler.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/handler/AllUrlHandler.java deleted file mode 100644 index a7b396c6..00000000 --- a/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/handler/AllUrlHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.xmzs.common.security.handler; - -import cn.hutool.core.util.ReUtil; -import com.xmzs.common.core.utils.SpringUtils; -import lombok.Data; -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/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/handler/GlobalExceptionHandler.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/handler/GlobalExceptionHandler.java deleted file mode 100644 index 6788ea51..00000000 --- a/ruoyi-common/ruoyi-common-security/src/main/java/com/xmzs/common/security/handler/GlobalExceptionHandler.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.domain.R; -import com.xmzs.common.core.exception.DemoModeException; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.StreamUtils; -import lombok.extern.slf4j.Slf4j; -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; - -import jakarta.servlet.http.HttpServletRequest; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.ConstraintViolationException; - -/** - * 全局异常处理器 - * - * @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/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/annotation/Sensitive.java b/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/annotation/Sensitive.java deleted file mode 100644 index a508f486..00000000 --- a/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/annotation/Sensitive.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xmzs.common.sensitive.annotation; - -import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.xmzs.common.sensitive.core.SensitiveStrategy; -import com.xmzs.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/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/core/SensitiveService.java b/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/core/SensitiveService.java deleted file mode 100644 index 0f935699..00000000 --- a/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/core/SensitiveService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.common.sensitive.core; - -/** - * 脱敏服务 - * 默认管理员不过滤 - * 需自行根据业务重写实现 - * - * @author Lion Li - * @version 3.6.0 - */ -public interface SensitiveService { - - /** - * 是否脱敏 - */ - boolean isSensitive(); - -} diff --git a/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/core/SensitiveStrategy.java b/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/core/SensitiveStrategy.java deleted file mode 100644 index 14e32a6f..00000000 --- a/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/core/SensitiveStrategy.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/handler/SensitiveHandler.java b/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/handler/SensitiveHandler.java deleted file mode 100644 index 10899dd9..00000000 --- a/ruoyi-common/ruoyi-common-sensitive/src/main/java/com/xmzs/common/sensitive/handler/SensitiveHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.sensitive.annotation.Sensitive; -import com.xmzs.common.sensitive.core.SensitiveService; -import com.xmzs.common.sensitive.core.SensitiveStrategy; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/config/SmsConfig.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/config/SmsConfig.java deleted file mode 100644 index 4d33b446..00000000 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/config/SmsConfig.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.common.sms.config; - -import com.xmzs.common.sms.config.properties.SmsProperties; -import com.xmzs.common.sms.core.AliyunSmsTemplate; -import com.xmzs.common.sms.core.SmsTemplate; -import com.xmzs.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/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/config/properties/SmsProperties.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/config/properties/SmsProperties.java deleted file mode 100644 index 52e3413d..00000000 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/config/properties/SmsProperties.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/AliyunSmsTemplate.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/AliyunSmsTemplate.java deleted file mode 100644 index f224ebca..00000000 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/AliyunSmsTemplate.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.sms.config.properties.SmsProperties; -import com.xmzs.common.sms.entity.SmsResult; -import com.xmzs.common.sms.exception.SmsException; -import lombok.SneakyThrows; - -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/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/SmsTemplate.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/SmsTemplate.java deleted file mode 100644 index f214ea82..00000000 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/SmsTemplate.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.common.sms.core; - -import com.xmzs.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/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/TencentSmsTemplate.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/TencentSmsTemplate.java deleted file mode 100644 index fb64d668..00000000 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/core/TencentSmsTemplate.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.xmzs.common.sms.core; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.ArrayUtil; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.sms.config.properties.SmsProperties; -import com.xmzs.common.sms.entity.SmsResult; -import com.xmzs.common.sms.exception.SmsException; -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 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/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/entity/SmsResult.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/entity/SmsResult.java deleted file mode 100644 index 264ae766..00000000 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/entity/SmsResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/exception/SmsException.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/exception/SmsException.java deleted file mode 100644 index 0ecadfbd..00000000 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/xmzs/common/sms/exception/SmsException.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/config/TenantConfig.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/config/TenantConfig.java deleted file mode 100644 index 9ab360b8..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/config/TenantConfig.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.reflect.ReflectUtils; -import com.xmzs.common.mybatis.config.MybatisPlusConfig; -import com.xmzs.common.redis.config.RedisConfig; -import com.xmzs.common.redis.config.properties.RedissonProperties; -import com.xmzs.common.tenant.core.TenantSaTokenDao; -import com.xmzs.common.tenant.handle.PlusTenantLineHandler; -import com.xmzs.common.tenant.handle.TenantKeyPrefixHandler; -import com.xmzs.common.tenant.manager.TenantSpringCacheManager; -import com.xmzs.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/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/core/TenantEntity.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/core/TenantEntity.java deleted file mode 100644 index efe2bf6b..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/core/TenantEntity.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.common.tenant.core; - -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 租户基类 - * - * @author Michelle.Chung - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class TenantEntity extends BaseEntity { - - /** - * 租户编号 - */ - private String tenantId; - -} diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/core/TenantSaTokenDao.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/core/TenantSaTokenDao.java deleted file mode 100644 index 53e267b3..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/core/TenantSaTokenDao.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.xmzs.common.tenant.core; - -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.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/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/exception/TenantException.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/exception/TenantException.java deleted file mode 100644 index 23e549de..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/exception/TenantException.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.common.tenant.exception; - -import com.xmzs.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/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/handle/PlusTenantLineHandler.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/handle/PlusTenantLineHandler.java deleted file mode 100644 index 6d8106ca..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/handle/PlusTenantLineHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.xmzs.common.tenant.handle; - -import cn.hutool.core.collection.ListUtil; -import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.common.tenant.helper.TenantHelper; -import com.xmzs.common.tenant.properties.TenantProperties; -import lombok.AllArgsConstructor; -import net.sf.jsqlparser.expression.Expression; -import net.sf.jsqlparser.expression.NullValue; -import net.sf.jsqlparser.expression.StringValue; - -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/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/handle/TenantKeyPrefixHandler.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/handle/TenantKeyPrefixHandler.java deleted file mode 100644 index 18a49a29..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/handle/TenantKeyPrefixHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.xmzs.common.tenant.handle; - -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.redis.handler.KeyPrefixHandler; -import com.xmzs.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/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/helper/TenantHelper.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/helper/TenantHelper.java deleted file mode 100644 index ba8ca152..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/helper/TenantHelper.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.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/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/manager/TenantSpringCacheManager.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/manager/TenantSpringCacheManager.java deleted file mode 100644 index 966f2c5d..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/manager/TenantSpringCacheManager.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xmzs.common.tenant.manager; - -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.redis.manager.PlusSpringCacheManager; -import com.xmzs.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/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/properties/TenantProperties.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/properties/TenantProperties.java deleted file mode 100644 index 00ad9e8e..00000000 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/xmzs/common/tenant/properties/TenantProperties.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/annotation/Translation.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/annotation/Translation.java deleted file mode 100644 index 256b0388..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/annotation/Translation.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.xmzs.common.translation.annotation; - -import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.xmzs.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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/annotation/TranslationType.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/annotation/TranslationType.java deleted file mode 100644 index 62222356..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/annotation/TranslationType.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.common.translation.annotation; - -import com.xmzs.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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/config/TranslationConfig.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/config/TranslationConfig.java deleted file mode 100644 index 164ee21c..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/config/TranslationConfig.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.xmzs.common.translation.config; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xmzs.common.translation.annotation.TranslationType; -import com.xmzs.common.translation.core.TranslationInterface; -import com.xmzs.common.translation.core.handler.TranslationBeanSerializerModifier; -import com.xmzs.common.translation.core.handler.TranslationHandler; -import jakarta.annotation.PostConstruct; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/constant/TransConstant.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/constant/TransConstant.java deleted file mode 100644 index 2afa6d81..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/constant/TransConstant.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/TranslationInterface.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/TranslationInterface.java deleted file mode 100644 index b3e1dc7c..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/TranslationInterface.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.common.translation.core; - -import com.xmzs.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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/handler/TranslationBeanSerializerModifier.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/handler/TranslationBeanSerializerModifier.java deleted file mode 100644 index c38097d8..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/handler/TranslationBeanSerializerModifier.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/handler/TranslationHandler.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/handler/TranslationHandler.java deleted file mode 100644 index 4d4bcaba..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/handler/TranslationHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.reflect.ReflectUtils; -import com.xmzs.common.translation.annotation.Translation; -import com.xmzs.common.translation.core.TranslationInterface; -import lombok.extern.slf4j.Slf4j; - -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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/DeptNameTranslationImpl.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/DeptNameTranslationImpl.java deleted file mode 100644 index 7c92cb06..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/DeptNameTranslationImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.common.translation.core.impl; - -import com.xmzs.common.core.service.DeptService; -import com.xmzs.common.translation.annotation.TranslationType; -import com.xmzs.common.translation.constant.TransConstant; -import com.xmzs.common.translation.core.TranslationInterface; -import lombok.AllArgsConstructor; - -/** - * 部门翻译实现 - * - * @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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/DictTypeTranslationImpl.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/DictTypeTranslationImpl.java deleted file mode 100644 index 4fb6557a..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/DictTypeTranslationImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.common.translation.core.impl; - -import com.xmzs.common.core.service.DictService; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.translation.annotation.TranslationType; -import com.xmzs.common.translation.constant.TransConstant; -import com.xmzs.common.translation.core.TranslationInterface; -import lombok.AllArgsConstructor; - -/** - * 字典翻译实现 - * - * @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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/OssUrlTranslationImpl.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/OssUrlTranslationImpl.java deleted file mode 100644 index 5337acfc..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/OssUrlTranslationImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.common.translation.core.impl; - -import com.xmzs.common.core.service.OssService; -import com.xmzs.common.translation.annotation.TranslationType; -import com.xmzs.common.translation.constant.TransConstant; -import com.xmzs.common.translation.core.TranslationInterface; -import lombok.AllArgsConstructor; - -/** - * 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/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/UserNameTranslationImpl.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/UserNameTranslationImpl.java deleted file mode 100644 index 5ae02c72..00000000 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/xmzs/common/translation/core/impl/UserNameTranslationImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.xmzs.common.translation.core.impl; - -import com.xmzs.common.core.service.UserService; -import com.xmzs.common.translation.annotation.TranslationType; -import com.xmzs.common.translation.constant.TransConstant; -import com.xmzs.common.translation.core.TranslationInterface; -import lombok.AllArgsConstructor; - -/** - * 用户名翻译实现 - * - * @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/ruoyi-common/ruoyi-common-web/pom.xml b/ruoyi-common/ruoyi-common-web/pom.xml index 04fdb563..97b9351c 100644 --- a/ruoyi-common/ruoyi-common-web/pom.xml +++ b/ruoyi-common/ruoyi-common-web/pom.xml @@ -33,17 +33,21 @@ spring-boot-starter-web - spring-boot-starter-tomcat org.springframework.boot + spring-boot-starter-tomcat + + org.springframework.boot spring-boot-starter-undertow + + org.springframework.boot spring-boot-starter-actuator diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/CaptchaConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/CaptchaConfig.java deleted file mode 100644 index 84f6170a..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/CaptchaConfig.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.xmzs.common.web.config; - -import cn.hutool.captcha.CaptchaUtil; -import cn.hutool.captcha.CircleCaptcha; -import cn.hutool.captcha.LineCaptcha; -import cn.hutool.captcha.ShearCaptcha; -import com.xmzs.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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/FilterConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/FilterConfig.java deleted file mode 100644 index 20962f3e..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/FilterConfig.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.xmzs.common.web.config; - -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.web.config.properties.XssProperties; -import com.xmzs.common.web.filter.RepeatableFilter; -import com.xmzs.common.web.filter.XssFilter; -import jakarta.servlet.DispatcherType; -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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/I18nConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/I18nConfig.java deleted file mode 100644 index e0e5b845..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/I18nConfig.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.xmzs.common.web.config; - -import com.xmzs.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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/ResourcesConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/ResourcesConfig.java deleted file mode 100644 index df747c53..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/ResourcesConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xmzs.common.web.config; - -import com.xmzs.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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/UndertowConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/UndertowConfig.java deleted file mode 100644 index 1d3a4d31..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/UndertowConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/properties/CaptchaProperties.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/properties/CaptchaProperties.java deleted file mode 100644 index 8a83e261..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/properties/CaptchaProperties.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.common.web.config.properties; - -import com.xmzs.common.web.enums.CaptchaCategory; -import com.xmzs.common.web.enums.CaptchaType; -import lombok.Data; -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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/properties/XssProperties.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/properties/XssProperties.java deleted file mode 100644 index 8d381f33..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/config/properties/XssProperties.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/core/BaseController.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/core/BaseController.java deleted file mode 100644 index b5c8732d..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/core/BaseController.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.xmzs.common.web.core; - -import com.xmzs.common.core.domain.R; -import com.xmzs.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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/core/I18nLocaleResolver.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/core/I18nLocaleResolver.java deleted file mode 100644 index f84e21ad..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/core/I18nLocaleResolver.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.xmzs.common.web.core; - -import org.springframework.web.servlet.LocaleResolver; - -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/enums/CaptchaCategory.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/enums/CaptchaCategory.java deleted file mode 100644 index 8f1ce6b3..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/enums/CaptchaCategory.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/enums/CaptchaType.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/enums/CaptchaType.java deleted file mode 100644 index 929d972f..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/enums/CaptchaType.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.common.web.enums; - -import cn.hutool.captcha.generator.CodeGenerator; -import cn.hutool.captcha.generator.RandomGenerator; -import com.xmzs.common.web.utils.UnsignedMathGenerator; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * 验证码类型 - * - * @author Lion Li - */ -@Getter -@AllArgsConstructor -public enum CaptchaType { - - /** - * 数字 - */ - MATH(UnsignedMathGenerator.class), - - /** - * 字符 - */ - CHAR(RandomGenerator.class); - - private final Class clazz; -} diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/RepeatableFilter.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/RepeatableFilter.java deleted file mode 100644 index 25758645..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/RepeatableFilter.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.xmzs.common.web.filter; - -import com.xmzs.common.core.utils.StringUtils; -import org.springframework.http.MediaType; - -import jakarta.servlet.*; -import jakarta.servlet.http.HttpServletRequest; -import java.io.IOException; - -/** - * Repeatable 过滤器 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/RepeatedlyRequestWrapper.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/RepeatedlyRequestWrapper.java deleted file mode 100644 index 3a73d340..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/RepeatedlyRequestWrapper.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.xmzs.common.web.filter; - -import cn.hutool.core.io.IoUtil; -import com.xmzs.common.core.constant.Constants; - -import jakarta.servlet.ReadListener; -import jakarta.servlet.ServletInputStream; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletRequestWrapper; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; - -/** - * 构建可重复读取inputStream的request - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/XssFilter.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/XssFilter.java deleted file mode 100644 index 84e459f5..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/XssFilter.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.xmzs.common.web.filter; - -import com.xmzs.common.core.utils.StringUtils; -import org.springframework.http.HttpMethod; - -import jakarta.servlet.*; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * 防止XSS攻击的过滤器 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/XssHttpServletRequestWrapper.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/XssHttpServletRequestWrapper.java deleted file mode 100644 index 44d8cf81..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/filter/XssHttpServletRequestWrapper.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.xmzs.common.web.filter; - -import cn.hutool.core.io.IoUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HtmlUtil; -import com.xmzs.common.core.utils.StringUtils; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; - -import jakarta.servlet.ReadListener; -import jakarta.servlet.ServletInputStream; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletRequestWrapper; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; - -/** - * XSS过滤处理 - * - * @author ruoyi - */ -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/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/interceptor/PlusWebInvokeTimeInterceptor.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/interceptor/PlusWebInvokeTimeInterceptor.java deleted file mode 100644 index 7f8a4e42..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/interceptor/PlusWebInvokeTimeInterceptor.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.xmzs.common.web.interceptor; - -import cn.hutool.core.io.IoUtil; -import cn.hutool.core.map.MapUtil; -import com.alibaba.ttl.TransmittableThreadLocal; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.web.filter.RepeatedlyRequestWrapper; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.time.StopWatch; -import org.springframework.http.MediaType; -import org.springframework.web.servlet.HandlerInterceptor; -import org.springframework.web.servlet.ModelAndView; - -import java.io.BufferedReader; -import java.util.Map; - -/** - * web的调用时间统计拦截器 - * dev环境有效 - * - * @author Lion Li - * @since 3.3.0 - */ -@Slf4j -public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor { - - private final String prodProfile = "prod"; - - private final TransmittableThreadLocal invokeTimeTL = new TransmittableThreadLocal<>(); - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - if (!prodProfile.equals(SpringUtils.getActiveProfile())) { - String url = request.getMethod() + " " + request.getRequestURI(); - - // 打印请求参数 - 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) throws Exception { - - } - - @Override - public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { -// if (!prodProfile.equals(SpringUtils.getActiveProfile())) { -// StopWatch stopWatch = invokeTimeTL.get(); -// stopWatch.stop(); -// log.debug("[PLUS]结束请求 => URL[{}],耗时:[{}]毫秒", request.getMethod() + " " + request.getRequestURI(), stopWatch.getTime()); -// invokeTimeTL.remove(); -// } - } - - /** - * 判断本次请求的数据类型是否为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; - } - -} diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/utils/UnsignedMathGenerator.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/utils/UnsignedMathGenerator.java deleted file mode 100644 index aec75e5c..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/xmzs/common/web/utils/UnsignedMathGenerator.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.xmzs.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 com.xmzs.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/ruoyi-common/ruoyi-common-wechat/pom.xml b/ruoyi-common/ruoyi-common-wechat/pom.xml index 4d61230e..26ac86cb 100644 --- a/ruoyi-common/ruoyi-common-wechat/pom.xml +++ b/ruoyi-common/ruoyi-common-wechat/pom.xml @@ -1,51 +1,68 @@ - + + + 4.0.0 - com.xmzs + org.ruoyi ruoyi-common ${revision} ../pom.xml - - 4.0.0 - ruoyi-common-wechat - - - ruoyi-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 - - com.xmzs + org.ruoyi ruoyi-common-json + + com.alibaba + fastjson + 1.2.31 + - diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/Wechat.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/Wechat.java deleted file mode 100644 index 59158fc4..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/Wechat.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.common.wechat; - -import com.xmzs.common.wechat.core.MsgCenter; -import com.xmzs.common.wechat.face.IMsgHandlerFace; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - - -public class Wechat { - private static final Logger LOG = LoggerFactory.getLogger(Wechat.class); - private IMsgHandlerFace msgHandler; - - public Wechat(IMsgHandlerFace msgHandler) { - System.setProperty("jsse.enableSNIExtension", "false"); // 防止SSL错误 - this.msgHandler = msgHandler; - } - - public void start() { - LOG.info("+++++++++++++++++++开始消息处理+++++++++++++++++++++"); - new Thread(new Runnable() { - @Override - public void run() { - MsgCenter.handleMsg(msgHandler); - } - }).start(); - } - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/AssistTools.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/AssistTools.java deleted file mode 100644 index 9d3d0327..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/AssistTools.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xmzs.common.wechat.api; - -import java.io.File; -import java.io.IOException; - -import okhttp3.Call; -import okhttp3.MediaType; -import okhttp3.MultipartBody; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -/** - * 辅助工具类,该类暂时未用,请忽略 - * - * @author https://github.com/yaphone - * @date 创建时间:2017年5月22日 下午10:34:46 - * @version 1.0 - * - */ -public class AssistTools { - private static OkHttpClient client = new OkHttpClient(); - private static final MediaType MEDIA_TYPE_PNG = MediaType.parse("image/png"); - - public static boolean sendQrPicToServer(String username, String password, String uploadUrl, String localPath) - throws IOException { - File file = new File(localPath); - RequestBody requestBody = new MultipartBody.Builder().addFormDataPart("username", username) - .addFormDataPart("password", password) - .addFormDataPart("file", file.getName(), RequestBody.create(MEDIA_TYPE_PNG, file)).build(); - Request request = new Request.Builder().url(uploadUrl).post(requestBody).build(); - Call call = client.newCall(request); - try { - Response response = call.execute(); - System.out.println(response.body().string()); - } catch (IOException e) { - e.printStackTrace(); - } - return true; - } - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/WechatTools.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/WechatTools.java deleted file mode 100644 index 1be5e44d..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/WechatTools.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.xmzs.common.wechat.api; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.http.Consts; -import org.apache.http.HttpEntity; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -import com.xmzs.common.wechat.core.Core; -import com.xmzs.common.wechat.utils.enums.StorageLoginInfoEnum; -import com.xmzs.common.wechat.utils.enums.URLEnum; - -/** - * 微信小工具,如获好友列表等 - * - * @author https://github.com/yaphone - * @date 创建时间:2017年5月4日 下午10:49:16 - * @version 1.0 - * - */ -public class WechatTools { - private static Logger LOG = LoggerFactory.getLogger(WechatTools.class); - - private static Core core = Core.getInstance(); - - /** - * 根据用户名发送文本消息 - * - * @author https://github.com/yaphone - * @date 2017年5月4日 下午10:43:14 - * @param msg - * @param toUserName - */ - public static void sendMsgByUserName(String msg, String toUserName) { - MessageTools.sendMsgById(msg, toUserName); - } - - /** - *

- * 通过RealName获取本次UserName - *

- *

- * 如NickName为"yaphone",则获取UserName= - * "@1212d3356aea8285e5bbe7b91229936bc183780a8ffa469f2d638bf0d2e4fc63", - * 可通过UserName发送消息 - *

- * - * @author https://github.com/yaphone - * @date 2017年5月4日 下午10:56:31 - * @param name - * @return - */ - public static String getUserNameByNickName(String nickName) { - for (JSONObject o : core.getContactList()) { - if (o.getString("NickName").equals(nickName)) { - return o.getString("UserName"); - } - } - return null; - } - - /** - * 返回好友昵称列表 - * - * @author https://github.com/yaphone - * @date 2017年5月4日 下午11:37:20 - * @return - */ - public static List getContactNickNameList() { - List contactNickNameList = new ArrayList(); - for (JSONObject o : core.getContactList()) { - contactNickNameList.add(o.getString("NickName")); - } - return contactNickNameList; - } - - /** - * 返回好友完整信息列表 - * - * @date 2017年6月26日 下午9:45:39 - * @return - */ - public static List getContactList() { - return core.getContactList(); - } - - /** - * 返回群列表 - * - * @author https://github.com/yaphone - * @date 2017年5月5日 下午9:55:21 - * @return - */ - public static List getGroupList() { - return core.getGroupList(); - } - - /** - * 获取群ID列表 - * - * @date 2017年6月21日 下午11:42:56 - * @return - */ - public static List getGroupIdList() { - return core.getGroupIdList(); - } - - /** - * 获取群NickName列表 - * - * @date 2017年6月21日 下午11:43:38 - * @return - */ - public static List getGroupNickNameList() { - return core.getGroupNickNameList(); - } - - /** - * 根据groupIdList返回群成员列表 - * - * @date 2017年6月13日 下午11:12:31 - * @param groupId - * @return - */ - public static JSONArray getMemberListByGroupId(String groupId) { - return core.getGroupMemeberMap().get(groupId); - } - - /** - * 退出微信 - * - * @author https://github.com/yaphone - * @date 2017年5月18日 下午11:56:54 - */ - public static void logout() { - webWxLogout(); - } - - private static boolean webWxLogout() { - String url = String.format(URLEnum.WEB_WX_LOGOUT.getUrl(), - core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey())); - List 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()); - } - return false; - } - - public static void setUserInfo() { - 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 userName - * @param remName - */ - public static void remarkNameByNickName(String nickName, String remName) { - String url = String.format(URLEnum.WEB_WX_REMARKNAME.getUrl(), core.getLoginInfo().get("url"), - core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); - Map msgMap = new HashMap(); - Map msgMap_BaseRequest = new HashMap(); - 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() { - return core.isAlive(); - } - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/controller/LoginController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/controller/LoginController.java deleted file mode 100644 index 4748348c..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/controller/LoginController.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.xmzs.common.wechat.controller; - - -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.wechat.utils.SleepUtils; -import com.xmzs.common.wechat.utils.enums.URLEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.xmzs.common.wechat.api.WechatTools; -import com.xmzs.common.wechat.core.Core; -import com.xmzs.common.wechat.service.ILoginService; -import com.xmzs.common.wechat.service.impl.LoginServiceImpl; -import com.xmzs.common.wechat.thread.CheckLoginStatusThread; - -import com.xmzs.common.wechat.utils.tools.CommonTools; - -/** - * 登陆控制器 - * - * @author https://github.com/yaphone - * @version 1.0 - * @date 创建时间:2017年5月13日 下午12:56:07 - */ -public class LoginController { - private static Logger LOG = LoggerFactory.getLogger(LoginController.class); - private ILoginService loginService = new LoginServiceImpl(); - private static Core core = Core.getInstance(); - - - /** - * 获取二维码地址 - * 风险:已登录账号不可调用该接口,会移除当前core信息 - * @return - */ - public String login_1() { - 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(); - } - - - public void login_2() { - LOG.info("3. 请扫描二维码图片,并在手机上确认"); - if (!core.isAlive()) { - loginService.login(); - core.setAlive(true); - LOG.info(("登陆成功")); - } - LOG.info("4. 登陆超时,请重新扫描二维码图片"); - - - LOG.info("5. 登陆成功,微信初始化"); - if (!loginService.webWxInit()) { - LOG.info("6. 微信初始化异常"); - System.exit(0); - } - - LOG.info("6. 开启微信状态通知"); - loginService.wxStatusNotify(); - - LOG.info("7. 清除。。。。"); - CommonTools.clearScreen(); - LOG.info(String.format("欢迎回来, %s", core.getNickName())); - - LOG.info("8. 开始接收消息"); - loginService.startReceiving(); - - LOG.info("9. 获取联系人信息"); - loginService.webWxGetContact(); - - LOG.info("10. 获取群好友及群好友列表"); - loginService.WebWxBatchGetContact(); - - LOG.info("11. 缓存本次登陆好友相关消息"); - WechatTools.setUserInfo(); // 登陆成功后缓存本次登陆好友相关消息(NickName, UserName) - - LOG.info("12.开启微信状态检测线程"); - new Thread(new CheckLoginStatusThread()).start(); - } -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/core/Core.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/core/Core.java deleted file mode 100644 index e9169320..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/core/Core.java +++ /dev/null @@ -1,276 +0,0 @@ -package com.xmzs.common.wechat.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -import com.xmzs.common.wechat.beans.BaseMsg; -import com.xmzs.common.wechat.utils.MyHttpClient; -import com.xmzs.common.wechat.utils.enums.parameters.BaseParaEnum; - -/** - * 核心存储类,全局只保存一份,单例模式 - * - * @author https://github.com/yaphone - * @date 创建时间:2017年4月23日 下午2:33:56 - * @version 1.0 - * - */ -public class Core { - - private static Core instance; - - private Core() { - - } - - public static Core getInstance() { - if (instance == null) { - synchronized (Core.class) { - instance = new Core(); - } - } - return instance; - } - - boolean alive = false; - private int memberCount = 0; - - private String indexUrl; - - private String userName; - private String nickName; - private List msgList = new ArrayList(); - - private JSONObject userSelf; // 登陆账号自身信息 - private List memberList = new ArrayList(); // 好友+群聊+公众号+特殊账号 - private List contactList = new ArrayList();// 好友 - private List groupList = new ArrayList();; // 群 - private Map groupMemeberMap = new HashMap(); // 群聊成员字典 - private List publicUsersList = new ArrayList();;// 公众号/服务号 - private List specialUsersList = new ArrayList();;// 特殊账号 - private List groupIdList = new ArrayList(); // 群ID列表 - private List groupNickNameList = new ArrayList(); // 群NickName列表 - - private Map userInfoMap = new HashMap(); - - Map loginInfo = new HashMap(); - // CloseableHttpClient httpClient = HttpClients.createDefault(); - MyHttpClient myHttpClient = MyHttpClient.getInstance(); - String uuid = null; - - boolean useHotReload = false; - String hotReloadDir = "itchat.pkl"; - int receivingRetryCount = 5; - - private long lastNormalRetcodeTime; // 最后一次收到正常retcode的时间,秒为单位 - - /** - * 请求参数 - */ - public Map getParamMap() { - return new HashMap(1) { - /** - * - */ - private static final long serialVersionUID = 1L; - - { - Map map = new HashMap(); - for (BaseParaEnum baseRequest : BaseParaEnum.values()) { - map.put(baseRequest.para(), getLoginInfo().get(baseRequest.value()).toString()); - } - put("BaseRequest", map); - } - }; - } - - public boolean isAlive() { - return alive; - } - - public void setAlive(boolean alive) { - this.alive = alive; - } - - public List getMemberList() { - return memberList; - } - - public void setMemberList(List memberList) { - this.memberList = memberList; - } - - public Map getLoginInfo() { - return loginInfo; - } - - public void setLoginInfo(Map loginInfo) { - this.loginInfo = loginInfo; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public int getMemberCount() { - return memberCount; - } - - public void setMemberCount(int memberCount) { - this.memberCount = memberCount; - } - - public boolean isUseHotReload() { - return useHotReload; - } - - public void setUseHotReload(boolean useHotReload) { - this.useHotReload = useHotReload; - } - - public String getHotReloadDir() { - return hotReloadDir; - } - - public void setHotReloadDir(String hotReloadDir) { - this.hotReloadDir = hotReloadDir; - } - - public int getReceivingRetryCount() { - return receivingRetryCount; - } - - public void setReceivingRetryCount(int receivingRetryCount) { - this.receivingRetryCount = receivingRetryCount; - } - - public MyHttpClient getMyHttpClient() { - return myHttpClient; - } - - public List getMsgList() { - return msgList; - } - - public void setMsgList(List msgList) { - this.msgList = msgList; - } - - public void setMyHttpClient(MyHttpClient myHttpClient) { - this.myHttpClient = myHttpClient; - } - - public List getGroupIdList() { - return groupIdList; - } - - public void setGroupIdList(List groupIdList) { - this.groupIdList = groupIdList; - } - - 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 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 JSONObject getUserSelf() { - return userSelf; - } - - public void setUserSelf(JSONObject userSelf) { - this.userSelf = userSelf; - } - - public Map getUserInfoMap() { - return userInfoMap; - } - - public void setUserInfoMap(Map userInfoMap) { - this.userInfoMap = userInfoMap; - } - - public synchronized long getLastNormalRetcodeTime() { - return lastNormalRetcodeTime; - } - - public synchronized void setLastNormalRetcodeTime(long lastNormalRetcodeTime) { - this.lastNormalRetcodeTime = lastNormalRetcodeTime; - } - - public List getGroupNickNameList() { - return groupNickNameList; - } - - public void setGroupNickNameList(List groupNickNameList) { - this.groupNickNameList = groupNickNameList; - } - - public Map getGroupMemeberMap() { - return groupMemeberMap; - } - - public void setGroupMemeberMap(Map groupMemeberMap) { - this.groupMemeberMap = groupMemeberMap; - } - - public String getIndexUrl() { - return indexUrl; - } - - public void setIndexUrl(String indexUrl) { - this.indexUrl = indexUrl; - } - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/core/MsgCenter.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/core/MsgCenter.java deleted file mode 100644 index 4a5a7665..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/core/MsgCenter.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.xmzs.common.wechat.core; - -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; - -import com.xmzs.common.wechat.utils.enums.MsgCodeEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -import com.xmzs.common.wechat.api.MessageTools; -import com.xmzs.common.wechat.beans.BaseMsg; -import com.xmzs.common.wechat.face.IMsgHandlerFace; - -import com.xmzs.common.wechat.utils.enums.MsgTypeEnum; -import com.xmzs.common.wechat.utils.tools.CommonTools; - -/** - * 消息处理中心 - * - * @author https://github.com/yaphone - * @date 创建时间:2017年5月14日 下午12:47:50 - * @version 1.0 - * - */ -public class MsgCenter { - private static Logger LOG = LoggerFactory.getLogger(MsgCenter.class); - - private static Core core = Core.getInstance(); - - /** - * 接收消息,放入队列 - * - * @author https://github.com/yaphone - * @date 2017年4月23日 下午2:30:48 - * @param msgList - * @return - */ - public static JSONArray produceMsg(JSONArray msgList) { - JSONArray result = new JSONArray(); - for (int i = 0; i < msgList.size(); i++) { - JSONObject msg = new JSONObject(); - JSONObject m = msgList.getJSONObject(i); - m.put("groupMsg", false);// 是否是群消息 - if (m.getString("FromUserName").contains("@@") || m.getString("ToUserName").contains("@@")) { // 群聊消息 - if (m.getString("FromUserName").contains("@@") - && !core.getGroupIdList().contains(m.getString("FromUserName"))) { - core.getGroupIdList().add((m.getString("FromUserName"))); - } else if (m.getString("ToUserName").contains("@@") - && !core.getGroupIdList().contains(m.getString("ToUserName"))) { - core.getGroupIdList().add((m.getString("ToUserName"))); - } - // 群消息与普通消息不同的是在其消息体(Content)中会包含发送者id及":
"消息,这里需要处理一下,去掉多余信息,只保留消息内容 - if (m.getString("Content").contains("
")) { - String content = m.getString("Content").substring(m.getString("Content").indexOf("
") + 5); - m.put("Content", content); - m.put("groupMsg", true); - } - } else { - CommonTools.msgFormatter(m, "Content"); - } - if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_TEXT.getCode())) { // words - // 文本消息 - if (m.getString("Url").length() != 0) { - String regEx = "(.+?\\(.+?\\))"; - Matcher matcher = CommonTools.getMatcher(regEx, m.getString("Content")); - String data = "Map"; - if (matcher.find()) { - data = matcher.group(1); - } - msg.put("Type", "Map"); - msg.put("Text", data); - } else { - msg.put("Type", MsgTypeEnum.TEXT.getType()); - msg.put("Text", m.getString("Content")); - } - m.put("Type", msg.getString("Type")); - m.put("Text", msg.getString("Text")); - } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_IMAGE.getCode()) - || m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_EMOTICON.getCode())) { // 图片消息 - m.put("Type", MsgTypeEnum.PIC.getType()); - } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_VOICE.getCode())) { // 语音消息 - m.put("Type", MsgTypeEnum.VOICE.getType()); - } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_VERIFYMSG.getCode())) {// friends - // 好友确认消息 - // MessageTools.addFriend(core, userName, 3, ticket); // 确认添加好友 - m.put("Type", MsgTypeEnum.VERIFYMSG.getType()); - - } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_SHARECARD.getCode())) { // 共享名片 - m.put("Type", MsgTypeEnum.NAMECARD.getType()); - - } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_VIDEO.getCode()) - || m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_MICROVIDEO.getCode())) {// viedo - m.put("Type", MsgTypeEnum.VIEDO.getType()); - } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_MEDIA.getCode())) { // 多媒体消息 - m.put("Type", MsgTypeEnum.MEDIA.getType()); - } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_STATUSNOTIFY.getCode())) {// phone - // init - // 微信初始化消息 - - } 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())) { // 撤回消息 - - } else { - LOG.info("Useless msg"); - } - LOG.info("收到消息一条,来自: " + m.getString("FromUserName")); - result.add(m); - } - return result; - } - - /** - * 消息处理 - * - * @author https://github.com/yaphone - * @date 2017年5月14日 上午10:52:34 - * @param msgHandler - */ - public static void handleMsg(IMsgHandlerFace msgHandler) { - while (true) { - 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())) { - String result = msgHandler.textMsgHandle(msg); - MessageTools.sendMsgById(result, core.getMsgList().get(0).getFromUserName()); - } else if (msg.getType().equals(MsgTypeEnum.PIC.getType())) { - - String result = msgHandler.picMsgHandle(msg); - MessageTools.sendMsgById(result, core.getMsgList().get(0).getFromUserName()); - } else if (msg.getType().equals(MsgTypeEnum.VOICE.getType())) { - String result = msgHandler.voiceMsgHandle(msg); - MessageTools.sendMsgById(result, core.getMsgList().get(0).getFromUserName()); - } else if (msg.getType().equals(MsgTypeEnum.VIEDO.getType())) { - String result = msgHandler.viedoMsgHandle(msg); - MessageTools.sendMsgById(result, core.getMsgList().get(0).getFromUserName()); - } else if (msg.getType().equals(MsgTypeEnum.NAMECARD.getType())) { - String result = msgHandler.nameCardMsgHandle(msg); - MessageTools.sendMsgById(result, core.getMsgList().get(0).getFromUserName()); - } else if (msg.getType().equals(MsgTypeEnum.SYS.getType())) { // 系统消息 - msgHandler.sysMsgHandle(msg); - } else if (msg.getType().equals(MsgTypeEnum.VERIFYMSG.getType())) { // 确认添加好友消息 - String result = msgHandler.verifyAddFriendMsgHandle(msg); - MessageTools.sendMsgById(result, - core.getMsgList().get(0).getRecommendInfo().getUserName()); - } else if (msg.getType().equals(MsgTypeEnum.MEDIA.getType())) { // 多媒体消息 - String result = msgHandler.mediaMsgHandle(msg); - MessageTools.sendMsgById(result, core.getMsgList().get(0).getFromUserName()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - core.getMsgList().remove(0); - } - try { - TimeUnit.MILLISECONDS.sleep(1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/service/impl/LoginServiceImpl.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/service/impl/LoginServiceImpl.java deleted file mode 100644 index a286a1e2..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/service/impl/LoginServiceImpl.java +++ /dev/null @@ -1,687 +0,0 @@ -package com.xmzs.common.wechat.service.impl; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Random; -import java.util.regex.Matcher; - -import com.xmzs.common.wechat.utils.SleepUtils; -import org.apache.http.Consts; -import org.apache.http.HttpEntity; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -import com.xmzs.common.wechat.beans.BaseMsg; -import com.xmzs.common.wechat.core.Core; -import com.xmzs.common.wechat.core.MsgCenter; -import com.xmzs.common.wechat.service.ILoginService; -import com.xmzs.common.wechat.utils.Config; -import com.xmzs.common.wechat.utils.MyHttpClient; - -import com.xmzs.common.wechat.utils.enums.ResultEnum; -import com.xmzs.common.wechat.utils.enums.RetCodeEnum; -import com.xmzs.common.wechat.utils.enums.StorageLoginInfoEnum; -import com.xmzs.common.wechat.utils.enums.URLEnum; -import com.xmzs.common.wechat.utils.enums.parameters.BaseParaEnum; -import com.xmzs.common.wechat.utils.enums.parameters.LoginParaEnum; -import com.xmzs.common.wechat.utils.enums.parameters.StatusNotifyParaEnum; -import com.xmzs.common.wechat.utils.enums.parameters.UUIDParaEnum; -import com.xmzs.common.wechat.utils.tools.CommonTools; - -/** - * 登陆服务实现类 - * - * @author https://github.com/yaphone - * @date 创建时间:2017年5月13日 上午12:09:35 - * @version 1.0 - * - */ -public class LoginServiceImpl implements ILoginService { - private static Logger LOG = LoggerFactory.getLogger(LoginServiceImpl.class); - - private Core core = Core.getInstance(); - private MyHttpClient httpClient = core.getMyHttpClient(); - - private MyHttpClient myHttpClient = core.getMyHttpClient(); - - public LoginServiceImpl() { - - } - - @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; - while (!isLogin) { - // SleepUtils.sleep(time += 1000); - 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 = httpClient.doGet(URLEnum.LOGIN_URL.getUrl(), params, true, null); - - try { - String result = EntityUtils.toString(entity); - String status = checklogin(result); - - if (ResultEnum.SUCCESS.getCode().equals(status)) { - processLoginInfo(result); // 处理结果 - isLogin = true; - core.setAlive(isLogin); - break; - } - if (ResultEnum.WAIT_CONFIRM.getCode().equals(status)) { - LOG.info("请点击微信确认按钮,进行登陆"); - } - - } catch (Exception e) { - LOG.error("微信登陆异常!", e); - } - } - 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.REDIRECT_URL.para(), - UUIDParaEnum.REDIRECT_URL.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 = httpClient.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); - 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(); - } - - @Override - public boolean getQR(String qrPath) { - qrPath = qrPath + File.separator + "QR.jpg"; - String qrUrl = URLEnum.QRCODE_URL.getUrl() + core.getUuid(); - HttpEntity entity = myHttpClient.doGet(qrUrl, null, true, null); - try { - OutputStream out = new FileOutputStream(qrPath); - byte[] bytes = EntityUtils.toByteArray(entity); - out.write(bytes); - out.flush(); - out.close(); - try { - CommonTools.printQr(qrPath); // 打开登陆二维码图片 - } catch (Exception e) { - LOG.info(e.getMessage()); - } - - } catch (Exception e) { - LOG.info(e.getMessage()); - return false; - } - - return true; - } - - @Override - public boolean webWxInit() { - core.setAlive(true); - core.setLastNormalRetcodeTime(System.currentTimeMillis()); - // 组装请求URL和参数 - String url = String.format(URLEnum.INIT_URL.getUrl(), - core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey()), - String.valueOf(System.currentTimeMillis() / 3158L), - core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); - - Map paramMap = core.getParamMap(); - - // 请求初始化接口 - HttpEntity entity = httpClient.doPost(url, JSON.toJSONString(paramMap)); - try { - String result = EntityUtils.toString(entity, Consts.UTF_8); - 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));// 1_656161336|2_656161626|3_656161313|11_656159955|13_656120033|201_1492273724|1000_1492265953|1001_1492250432|1004_1491805192 - core.setUserName(user.getString("UserName")); - core.setNickName(user.getString("NickName")); - core.setUserSelf(obj.getJSONObject("User")); - - String chatSet = obj.getString("ChatSet"); - String[] chatSetArray = chatSet.split(","); - for (int i = 0; i < chatSetArray.length; i++) { - if (chatSetArray[i].indexOf("@@") != -1) { - // 更新GroupIdList - core.getGroupIdList().add(chatSetArray[i]); // - } - } - // JSONArray contactListArray = obj.getJSONArray("ContactList"); - // for (int i = 0; i < contactListArray.size(); i++) { - // JSONObject o = contactListArray.getJSONObject(i); - // if (o.getString("UserName").indexOf("@@") != -1) { - // core.getGroupIdList().add(o.getString("UserName")); // - // // 更新GroupIdList - // core.getGroupList().add(o); // 更新GroupList - // core.getGroupNickNameList().add(o.getString("NickName")); - // } - // } - } catch (Exception e) { - e.printStackTrace(); - 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 = httpClient.doPost(url, paramStr); - EntityUtils.toString(entity, Consts.UTF_8); - } catch (Exception e) { - LOG.error("微信状态通知接口失败!", e); - } - - } - - @Override - public void startReceiving() { - core.setAlive(true); - new Thread(new Runnable() { - int retryCount = 0; - - @Override - public void run() { - while (core.isAlive()) { - try { - Map resultMap = syncCheck(); - LOG.info(JSONObject.toJSONString(resultMap)); - String retcode = resultMap.get("retcode"); - String selector = resultMap.get("selector"); - if (retcode.equals(RetCodeEnum.UNKOWN.getCode())) { - LOG.info(RetCodeEnum.UNKOWN.getType()); - continue; - } else if (retcode.equals(RetCodeEnum.LOGIN_OUT.getCode())) { // 退出 - LOG.info(RetCodeEnum.LOGIN_OUT.getType()); - break; - } else if (retcode.equals(RetCodeEnum.LOGIN_OTHERWHERE.getCode())) { // 其它地方登陆 - LOG.info(RetCodeEnum.LOGIN_OTHERWHERE.getType()); - break; - } else if (retcode.equals(RetCodeEnum.MOBILE_LOGIN_OUT.getCode())) { // 移动端退出 - LOG.info(RetCodeEnum.MOBILE_LOGIN_OUT.getType()); - break; - } else if (retcode.equals(RetCodeEnum.NORMAL.getCode())) { - core.setLastNormalRetcodeTime(System.currentTimeMillis()); // 最后收到正常报文时间 - JSONObject msgObj = webWxSync(); - if (selector.equals("2")) { - if (msgObj != null) { - try { - JSONArray msgList = new JSONArray(); - msgList = msgObj.getJSONArray("AddMsgList"); - msgList = MsgCenter.produceMsg(msgList); - for (int j = 0; j < msgList.size(); j++) { - BaseMsg baseMsg = JSON.toJavaObject(msgList.getJSONObject(j), - BaseMsg.class); - core.getMsgList().add(baseMsg); - } - } catch (Exception e) { - LOG.info(e.getMessage()); - } - } - } else if (selector.equals("7")) { - webWxSync(); - } else if (selector.equals("4")) { - continue; - } else if (selector.equals("3")) { - continue; - } else if (selector.equals("6")) { - if (msgObj != null) { - try { - JSONArray msgList = new JSONArray(); - msgList = msgObj.getJSONArray("AddMsgList"); - JSONArray modContactList = msgObj.getJSONArray("ModContactList"); // 存在删除或者新增的好友信息 - msgList = MsgCenter.produceMsg(msgList); - for (int j = 0; j < msgList.size(); j++) { - JSONObject userInfo = modContactList.getJSONObject(j); - // 存在主动加好友之后的同步联系人到本地 - core.getContactList().add(userInfo); - } - } catch (Exception e) { - LOG.info(e.getMessage()); - } - } - - } - } else { - JSONObject obj = webWxSync(); - } - } catch (Exception e) { - LOG.info(e.getMessage()); - retryCount += 1; - if (core.getReceivingRetryCount() < retryCount) { - core.setAlive(false); - } else { - try { - Thread.sleep(1000); - } catch (InterruptedException e1) { - LOG.info(e.getMessage()); - } - } - } - - } - } - }).start(); - - } - - @Override - public void webWxGetContact() { - String url = String.format(URLEnum.WEB_WX_GET_CONTACT.getUrl(), - core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey())); - Map paramMap = core.getParamMap(); - HttpEntity entity = httpClient.doPost(url, JSON.toJSONString(paramMap)); - - try { - String result = EntityUtils.toString(entity, Consts.UTF_8); - JSONObject fullFriendsJsonList = JSON.parseObject(result); - // 查看seq是否为0,0表示好友列表已全部获取完毕,若大于0,则表示好友列表未获取完毕,当前的字节数(断点续传) - long seq = 0; - long currentTime = 0L; - List params = new ArrayList(); - if (fullFriendsJsonList.get("Seq") != null) { - seq = fullFriendsJsonList.getLong("Seq"); - currentTime = new Date().getTime(); - } - core.setMemberCount(fullFriendsJsonList.getInteger(StorageLoginInfoEnum.MemberCount.getKey())); - JSONArray member = fullFriendsJsonList.getJSONArray(StorageLoginInfoEnum.MemberList.getKey()); - // 循环获取seq直到为0,即获取全部好友列表 ==0:好友获取完毕 >0:好友未获取完毕,此时seq为已获取的字节数 - while (seq > 0) { - // 设置seq传参 - params.add(new BasicNameValuePair("r", String.valueOf(currentTime))); - params.add(new BasicNameValuePair("seq", String.valueOf(seq))); - entity = httpClient.doGet(url, params, false, null); - - params.remove(new BasicNameValuePair("r", String.valueOf(currentTime))); - params.remove(new BasicNameValuePair("seq", String.valueOf(seq))); - - result = EntityUtils.toString(entity, Consts.UTF_8); - fullFriendsJsonList = JSON.parseObject(result); - - if (fullFriendsJsonList.get("Seq") != null) { - seq = fullFriendsJsonList.getLong("Seq"); - currentTime = new Date().getTime(); - } - - // 累加好友列表 - member.addAll(fullFriendsJsonList.getJSONArray(StorageLoginInfoEnum.MemberList.getKey())); - } - core.setMemberCount(member.size()); - for (Iterator iterator = member.iterator(); iterator.hasNext();) { - JSONObject o = (JSONObject) iterator.next(); - if ((o.getInteger("VerifyFlag") & 8) != 0) { // 公众号/服务号 - core.getPublicUsersList().add(o); - } else if (Config.API_SPECIAL_USER.contains(o.getString("UserName"))) { // 特殊账号 - core.getSpecialUsersList().add(o); - } else if (o.getString("UserName").indexOf("@@") != -1) { // 群聊 - if (!core.getGroupIdList().contains(o.getString("UserName"))) { - core.getGroupNickNameList().add(o.getString("NickName")); - core.getGroupIdList().add(o.getString("UserName")); - core.getGroupList().add(o); - } - } else if (o.getString("UserName").equals(core.getUserSelf().getString("UserName"))) { // 自己 - core.getContactList().remove(o); - } else { // 普通联系人 - core.getContactList().add(o); - } - } - return; - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - return; - } - - @Override - public void WebWxBatchGetContact() { - String url = String.format(URLEnum.WEB_WX_BATCH_GET_CONTACT.getUrl(), - core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey()), new Date().getTime(), - core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); - Map paramMap = core.getParamMap(); - paramMap.put("Count", core.getGroupIdList().size()); - List> list = new ArrayList>(); - for (int i = 0; i < core.getGroupIdList().size(); i++) { - HashMap map = new HashMap(); - map.put("UserName", core.getGroupIdList().get(i)); - map.put("EncryChatRoomId", ""); - list.add(map); - } - paramMap.put("List", list); - HttpEntity entity = httpClient.doPost(url, JSON.toJSONString(paramMap)); - try { - String text = EntityUtils.toString(entity, Consts.UTF_8); - JSONObject obj = JSON.parseObject(text); - JSONArray contactList = obj.getJSONArray("ContactList"); - for (int i = 0; i < contactList.size(); i++) { // 群好友 - if (contactList.getJSONObject(i).getString("UserName").indexOf("@@") > -1) { // 群 - core.getGroupNickNameList().add(contactList.getJSONObject(i).getString("NickName")); // 更新群昵称列表 - core.getGroupList().add(contactList.getJSONObject(i)); // 更新群信息(所有)列表 - core.getGroupMemeberMap().put(contactList.getJSONObject(i).getString("UserName"), - contactList.getJSONObject(i).getJSONArray("MemberList")); // 更新群成员Map - } - } - } 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; - } - - /** - * 处理登陆信息 - * - * @author https://github.com/yaphone - * @date 2017年4月9日 下午12:16:26 - * @param loginContent - */ - private void 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('/')); // https://wx2.qq.com/cgi-bin/mmwebwx-bin - core.getLoginInfo().put("url", url); - Map> possibleUrlMap = this.getPossibleUrlMap(); - Iterator>> iterator = possibleUrlMap.entrySet().iterator(); - Map.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 { - HttpEntity entity = myHttpClient.doGet(originalUrl, null, false, null); - text = EntityUtils.toString(entity); - } catch (Exception e) { - LOG.info(e.getMessage()); - return; - } - //add by 默非默 2017-08-01 22:28:09 - //如果登录被禁止时,则登录返回的message内容不为空,下面代码则判断登录内容是否为空,不为空则退出程序 - String msg = getLoginMessage(text); - if (!"".equals(msg)){ - LOG.info(msg); - System.exit(0); - } - 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()); - } - - } - } - - 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 - * - * @author https://github.com/yaphone - * @date 2017年5月12日 上午12:24:55 - * @return - */ - 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", -new Date().getTime() / 1000); - String paramStr = JSON.toJSONString(paramMap); - try { - HttpEntity entity = myHttpClient.doPost(url, paramStr); - 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(); - 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 - * - * @author https://github.com/yaphone - * @date 2017年4月16日 上午11:11:34 - * @return - * - */ - 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(new Date().getTime()))); - params.add(new BasicNameValuePair("synckey", (String) core.getLoginInfo().get("synckey"))); - params.add(new BasicNameValuePair("_", String.valueOf(new Date().getTime()))); - SleepUtils.sleep(7); - try { - HttpEntity entity = myHttpClient.doGet(url, params, true, null); - 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; - } - - /** - * 解析登录返回的消息,如果成功登录,则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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/thread/CheckLoginStatusThread.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/thread/CheckLoginStatusThread.java deleted file mode 100644 index 3e484d2b..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/thread/CheckLoginStatusThread.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.common.wechat.thread; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.xmzs.common.wechat.core.Core; -import com.xmzs.common.wechat.utils.SleepUtils; - -/** - * 检查微信在线状态 - *

- * 如何来感知微信状态? - * 微信会有心跳包,LoginServiceImpl.syncCheck()正常在线情况下返回的消息中retcode报文应该为"0",心跳间隔一般在25秒, - * 那么可以通过最后收到正常报文的时间来作为判断是否在线的依据。若报文间隔大于60秒,则认为已掉线。 - *

- * - * @author https://github.com/yaphone - * @date 创建时间:2017年5月17日 下午10:53:15 - * @version 1.0 - * - */ -public class CheckLoginStatusThread implements Runnable { - private static Logger LOG = LoggerFactory.getLogger(CheckLoginStatusThread.class); - private Core core = Core.getInstance(); - - @Override - public void run() { - while (core.isAlive()) { - long t1 = System.currentTimeMillis(); // 秒为单位 - if (t1 - core.getLastNormalRetcodeTime() > 60 * 1000) { // 超过60秒,判为离线 - core.setAlive(false); - LOG.info("微信已离线"); - } - SleepUtils.sleep(10 * 1000); // 休眠10秒 - } - } - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/MsgKeywords.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/MsgKeywords.java deleted file mode 100644 index 53e287b2..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/MsgKeywords.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.xmzs.common.wechat.utils; - -public class MsgKeywords { - public static String newFriendStr = "我通过了你的朋友验证请求"; - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/MyHttpClient.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/MyHttpClient.java deleted file mode 100644 index e23ce655..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/MyHttpClient.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.xmzs.common.wechat.utils; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Logger; - -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.HttpClients; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; - -/** - * HTTP访问类,对Apache HttpClient进行简单封装,适配器模式 - * - * @author https://github.com/yaphone - * @date 创建时间:2017年4月9日 下午7:05:04 - * @version 1.0 - * - */ -public class MyHttpClient { - private Logger logger = Logger.getLogger("MyHttpClient"); - - private static CloseableHttpClient httpClient = HttpClients.createDefault(); - - private static MyHttpClient instance = null; - - private static CookieStore cookieStore; - - static { - cookieStore = new BasicCookieStore(); - - // 将CookieStore设置到httpClient中 - httpClient = HttpClients.custom().setDefaultCookieStore(cookieStore).build(); - } - - public static String getCookie(String name) { - List cookies = cookieStore.getCookies(); - for (Cookie cookie : cookies) { - if (cookie.getName().equalsIgnoreCase(name)) { - return cookie.getValue(); - } - } - return null; - - } - - private MyHttpClient() { - - } - - /** - * 获取cookies - * - * @author https://github.com/yaphone - * @date 2017年5月7日 下午8:37:17 - * @return - */ - public static MyHttpClient getInstance() { - if (instance == null) { - synchronized (MyHttpClient.class) { - if (instance == null) { - instance = new MyHttpClient(); - } - } - } - return instance; - } - - /** - * 处理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); - } else { - httpGet = new HttpGet(url); - } - if (!redirect) { - httpGet.setConfig(RequestConfig.custom().setRedirectsEnabled(false).build()); // 禁止重定向 - } - httpGet.setHeader("User-Agent", Config.USER_AGENT); - httpGet.setHeader("client-version", Config.UOS_PATCH_CLIENT_VERSION); - httpGet.setHeader("extspam", Config.UOS_PATCH_EXTSPAM); - httpGet.setHeader("referer", Config.REFERER); - if (headerMap != null) { - Set> entries = headerMap.entrySet(); - for (Entry entry : entries) { - httpGet.setHeader(entry.getKey(), entry.getValue()); - } - } - CloseableHttpResponse response = httpClient.execute(httpGet); - entity = response.getEntity(); - } catch (ClientProtocolException e) { - logger.info(e.getMessage()); - } catch (IOException e) { - logger.info(e.getMessage()); - } - - return entity; - } - - /** - * 处理POST请求 - * - * @author https://github.com/yaphone - * @date 2017年4月9日 下午7:06:35 - * @param url - * @param params - * @return - */ - public HttpEntity doPost(String url, String paramsStr) { - 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); - httpPost.setHeader("client-version", Config.UOS_PATCH_CLIENT_VERSION); - httpPost.setHeader("extspam", Config.UOS_PATCH_EXTSPAM); - httpPost.setHeader("referer", Config.REFERER); - - CloseableHttpResponse response = httpClient.execute(httpPost); - entity = response.getEntity(); - } catch (ClientProtocolException e) { - logger.info(e.getMessage()); - } catch (IOException e) { - logger.info(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.setHeader("client-version", Config.UOS_PATCH_CLIENT_VERSION); - httpPost.setHeader("extspam", Config.UOS_PATCH_EXTSPAM); - httpPost.setHeader("referer", Config.REFERER); - - httpPost.setEntity(reqEntity); - try { - CloseableHttpResponse response = httpClient.execute(httpPost); - entity = response.getEntity(); - - } catch (Exception e) { - logger.info(e.getMessage()); - } - return entity; - } - - public static CloseableHttpClient getHttpClient() { - return httpClient; - } - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/MsgCodeEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/MsgCodeEnum.java deleted file mode 100644 index ec136f33..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/MsgCodeEnum.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.xmzs.common.wechat.utils.enums; - -/** - * 消息类型 - * - * @author https://github.com/yaphone - * @date 创建时间:2017年4月23日 下午12:15:00 - * @version 1.0 - * - */ -public enum MsgCodeEnum { - - // public static final int MSGTYPE_TEXT = 1; // 文本消息类型 - // public static final int MSGTYPE_IMAGE = 3; // 图片消息 - // public static final int MSGTYPE_VOICE = 34; // 语音消息 - // public static final int MSGTYPE_VIDEO = 43; // 小视频消息 - // public static final int MSGTYPE_MICROVIDEO = 62; // 短视频消息 - // public static final int MSGTYPE_EMOTICON = 47; // 表情消息 - // public static final int MSGTYPE_APP = 49; - // public static final int MSGTYPE_VOIPMSG = 50; - // public static final int MSGTYPE_VOIPNOTIFY = 52; - // public static final int MSGTYPE_VOIPINVITE = 53; - // public static final int MSGTYPE_LOCATION = 48; - // public static final int MSGTYPE_STATUSNOTIFY = 51; - // public static final int MSGTYPE_SYSNOTICE = 9999; - // public static final int MSGTYPE_POSSIBLEFRIEND_MSG = 40; - // public static final int MSGTYPE_VERIFYMSG = 37; - // public static final int MSGTYPE_SHARECARD = 42; - // public static final int MSGTYPE_SYS = 10000; - // public static final int MSGTYPE_RECALLED = 10002; - MSGTYPE_TEXT(1, "文本消息类型"), - MSGTYPE_IMAGE(3, "图片消息"), - MSGTYPE_VOICE(34, "语音消息"), - MSGTYPE_VIDEO(43, "小视频消息"), - MSGTYPE_MICROVIDEO(62, "短视频消息"), - MSGTYPE_EMOTICON(47, "表情消息"), - MSGTYPE_MEDIA(49, "多媒体消息"), - MSGTYPE_VOIPMSG(50, ""), - MSGTYPE_VOIPNOTIFY(52, ""), - MSGTYPE_VOIPINVITE(53, ""), - MSGTYPE_LOCATION(48, ""), - MSGTYPE_STATUSNOTIFY(51, ""), - MSGTYPE_SYSNOTICE(9999, ""), - MSGTYPE_POSSIBLEFRIEND_MSG(40, ""), - MSGTYPE_VERIFYMSG(37, "好友请求"), - MSGTYPE_SHARECARD(42, ""), - MSGTYPE_SYS(10000, "系统消息"), - MSGTYPE_RECALLED(10002, "") - - ; - - 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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/ResultEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/ResultEnum.java deleted file mode 100644 index f21b20ab..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/ResultEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.common.wechat.utils.enums; - -/** - * 返回结构枚举类 - *

- * Created by xiaoxiaomo on 2017/5/6. - */ -public enum ResultEnum { - - SUCCESS("200", "成功"), - WAIT_CONFIRM("201", "请在手机上点击确认"), - WAIT_SCAN("400", "请扫描二维码"); - - private String code; - private String msg; - - ResultEnum(String code, String msg) { - this.code = code; - this.msg = msg; - } - - public String getCode() { - return code; - } - -// public static MsgInfoEnum getCode(String code) { -// switch (code) { -// case "Text": -// return MsgInfoEnum.TEXT; -// default: -// return MsgInfoEnum.VIDEO; -// } -// } - -} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/RetCodeEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/RetCodeEnum.java deleted file mode 100644 index f8e8082c..00000000 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/RetCodeEnum.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.common.wechat.utils.enums; - -public enum RetCodeEnum { - - NORMAL("0", "普通"), - LOGIN_OUT("1102", "退出"), - LOGIN_OTHERWHERE("1101", "其它地方登陆"), - MOBILE_LOGIN_OUT("1102", "移动端退出"), - UNKOWN("9999", "未知") - - ; - - - 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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/MessageTools.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/api/MessageTools.java similarity index 56% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/MessageTools.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/api/MessageTools.java index ed0bb4eb..9ed005a7 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/api/MessageTools.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/api/MessageTools.java @@ -1,16 +1,7 @@ -package com.xmzs.common.wechat.api; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import javax.activation.MimetypesFileTypeMap; +package org.ruoyi.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; @@ -18,20 +9,22 @@ 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.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.ruoyi.common.wechat.itchat4j.beans.BaseMsg; +import org.ruoyi.common.wechat.itchat4j.beans.RecommendInfo; +import org.ruoyi.common.wechat.itchat4j.core.Core; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.itchat4j.utils.Config; +import org.ruoyi.common.wechat.itchat4j.utils.LogInterface; +import org.ruoyi.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.ruoyi.common.wechat.itchat4j.utils.enums.StorageLoginInfoEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.URLEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.VerifyFriendEnum; +import org.ruoyi.common.wechat.web.constant.UploadConstant; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import com.xmzs.common.wechat.beans.BaseMsg; -import com.xmzs.common.wechat.beans.RecommendInfo; -import com.xmzs.common.wechat.core.Core; -import com.xmzs.common.wechat.utils.Config; -import com.xmzs.common.wechat.utils.MyHttpClient; -import com.xmzs.common.wechat.utils.enums.StorageLoginInfoEnum; -import com.xmzs.common.wechat.utils.enums.URLEnum; -import com.xmzs.common.wechat.utils.enums.VerifyFriendEnum; +import javax.activation.MimetypesFileTypeMap; +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.*; /** * 消息处理类 @@ -40,41 +33,73 @@ import com.xmzs.common.wechat.utils.enums.VerifyFriendEnum; * @date 创建时间:2017年4月23日 下午2:30:37 * @version 1.0 * + * @author WesleyOne 修改 */ -public class MessageTools { - private static Logger LOG = LoggerFactory.getLogger(MessageTools.class); - private static Core core = Core.getInstance(); - private static MyHttpClient myHttpClient = core.getMyHttpClient(); +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月4日 下午11:17:38 - * @param msg - * @param toUserName - */ - private static void sendMsg(String text, String toUserName) { - if (text == null) { - return; - } - LOG.info(String.format("发送消息 %s: %s", toUserName, text)); - webWxSendMsg(1, text, toUserName); - } - - /** - * 根据ID发送文本消息 - * - * @author https://github.com/yaphone * @date 2017年5月6日 上午11:45:51 * @param text - * @param id + * @param toUserName + * @param uniqueKey */ - public static void sendMsgById(String text, String id) { + public static boolean sendMsgById(String text, String toUserName, String uniqueKey) { if (text == null) { - return; + return false; } - sendMsg(text, id); + return webWxSendMsg(1, text, toUserName, uniqueKey); } /** @@ -85,12 +110,38 @@ public class MessageTools { * @param text * @param nickName */ - public static boolean sendMsgByNickName(String text, String nickName) { + public static boolean sendMsgByNickName(String text, String nickName, String uniqueKey) { if (nickName != null) { - String toUserName = WechatTools.getUserNameByNickName(nickName); + String toUserName = WechatTools.getContactUserNameByNickName(nickName,uniqueKey); if (toUserName != null) { - webWxSendMsg(1, text, toUserName); - return true; + 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; @@ -106,24 +157,30 @@ public class MessageTools { * @param content * @param toUserName */ - public static void webWxSendMsg(int msgType, String content, String 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(); + 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", new Date().getTime() * 10); - msgMap.put("ClientMsgId", new Date().getTime() * 10); + 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 = myHttpClient.doPost(url, paramStr); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); EntityUtils.toString(entity, Consts.UTF_8); + return true; } catch (Exception e) { LOG.error("webWxSendMsg", e); + return false; } } @@ -135,14 +192,15 @@ public class MessageTools { * @param filePath * @return */ - private static JSONObject webWxUploadMedia(String filePath) { - File file = new File(filePath); - if (!file.exists() && file.isFile()) { + 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(file); + String mimeType = new MimetypesFileTypeMap().getContentType(f); String mediaType = ""; if (mimeType == null) { mimeType = "text/plain"; @@ -150,11 +208,11 @@ public class MessageTools { mediaType = mimeType.split("/")[0].equals("image") ? "pic" : "doc"; } String lastModifieDate = new SimpleDateFormat("yyyy MM dd HH:mm:ss").format(new Date()); - long fileSize = file.length(); + long fileSize = f.length(); String passTicket = (String) core.getLoginInfo().get("pass_ticket"); - String clientMediaId = new Date().getTime() + String clientMediaId = String.valueOf(System.currentTimeMillis()) + String.valueOf(new Random().nextLong()).substring(0, 4); - String webwxDataTicket = MyHttpClient.getCookie("webwx_data_ticket"); + String webwxDataTicket = core.getMyHttpClient().getCookie("webwx_data_ticket"); if (webwxDataTicket == null) { LOG.error("get cookie webwx_data_ticket error"); return null; @@ -180,9 +238,9 @@ public class MessageTools { 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", file, ContentType.create(mimeType), filePath); + builder.addBinaryBody("filename", f, ContentType.create(mimeType), filePath); HttpEntity reqEntity = builder.build(); - HttpEntity entity = myHttpClient.doPostFile(url, reqEntity); + HttpEntity entity = core.getMyHttpClient().doPostFile(url, reqEntity); if (entity != null) { try { String result = EntityUtils.toString(entity, Consts.UTF_8); @@ -195,18 +253,45 @@ public class MessageTools { 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 nackName + * @param nickName + * @param filePath * @return */ - public static boolean sendPicMsgByNickName(String nickName, String filePath) { - String toUserName = WechatTools.getUserNameByNickName(nickName); + public static boolean sendPicMsgByNickName(String nickName, String filePath, String uniqueKey) { + String toUserName = WechatTools.getContactUserNameByNickName(nickName,uniqueKey); if (toUserName != null) { - return sendPicMsgByUserId(toUserName, filePath); + 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; } @@ -218,14 +303,15 @@ public class MessageTools { * @date 2017年5月7日 下午10:34:24 * @param userId * @param filePath + * @param uniqueKey * @return */ - public static boolean sendPicMsgByUserId(String userId, String filePath) { - JSONObject responseObj = webWxUploadMedia(filePath); + 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); + return webWxSendMsgImg(userId, mediaId, uniqueKey); } } return false; @@ -238,15 +324,19 @@ public class MessageTools { * @date 2017年5月7日 下午10:38:55 * @return */ - private static boolean webWxSendMsgImg(String userId, String mediaId) { + 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(); + 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(new Date().getTime()) + String clientMsgId = String.valueOf(System.currentTimeMillis()) + String.valueOf(new Random().nextLong()).substring(1, 5); msgMap.put("LocalID", clientMsgId); msgMap.put("ClientMsgId", clientMsgId); @@ -254,7 +344,7 @@ public class MessageTools { paramMap.put("BaseRequest", core.getParamMap().get("BaseRequest")); paramMap.put("Msg", msgMap); String paramStr = JSON.toJSONString(paramMap); - HttpEntity entity = myHttpClient.doPost(url, paramStr); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); if (entity != null) { try { String result = EntityUtils.toString(entity, Consts.UTF_8); @@ -276,25 +366,34 @@ public class MessageTools { * @param filePath * @return */ - public static boolean sendFileMsgByUserId(String userId, String filePath) { + private static boolean sendFileMsgByUserId(String userId, String filePath, String uniqueKey) { String title = new File(filePath).getName(); - Map data = new HashMap(); + 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); + 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); + 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); + } + } + + /** * 根据用户昵称发送文件消息 * @@ -304,10 +403,27 @@ public class MessageTools { * @param filePath * @return */ - public static boolean sendFileMsgByNickName(String nickName, String filePath) { - String toUserName = WechatTools.getUserNameByNickName(nickName); + private static boolean sendFileMsgByNickName(String nickName, String filePath, String uniqueKey) { + String toUserName = WechatTools.getContactUserNameByNickName(nickName,uniqueKey); if (toUserName != null) { - return sendFileMsgByUserId(toUserName, filePath); + 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; } @@ -319,18 +435,23 @@ public class MessageTools { * @date 2017年5月10日 上午12:21:28 * @param userId * @param data + * @param uniqueKey * @return */ - private static boolean webWxSendAppMsg(String userId, Map data) { + 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(new Date().getTime()) + 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(); + Map msgMap = new HashMap(12); msgMap.put("Type", data.get("type")); msgMap.put("Content", content); msgMap.put("FromUserName", core.getUserSelf().getString("UserName")); @@ -350,7 +471,7 @@ public class MessageTools { paramMap.put("Msg", msgMap); paramMap.put("Scene", 0); String paramStr = JSON.toJSONString(paramMap); - HttpEntity entity = myHttpClient.doPost(url, paramStr); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); if (entity != null) { try { String result = EntityUtils.toString(entity, Consts.UTF_8); @@ -370,7 +491,8 @@ public class MessageTools { * @param accept * true 接受 false 拒绝 */ - public static void addFriend(BaseMsg msg, boolean accept) { + private static void addFriend(BaseMsg msg, boolean accept, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); if (!accept) { // 不添加 return; } @@ -407,7 +529,7 @@ public class MessageTools { String result = null; try { String paramStr = JSON.toJSONString(body); - HttpEntity entity = myHttpClient.doPost(url, paramStr); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); result = EntityUtils.toString(entity, Consts.UTF_8); } catch (Exception e) { LOG.error("webWxSendMsg", e); diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/api/WechatTools.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/api/WechatTools.java new file mode 100644 index 00000000..5700a65f --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/api/WechatTools.java @@ -0,0 +1,352 @@ +package org.ruoyi.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.ruoyi.common.wechat.itchat4j.core.Core; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.itchat4j.utils.LogInterface; +import org.ruoyi.common.wechat.itchat4j.utils.enums.StorageLoginInfoEnum; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/AppInfo.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/AppInfo.java similarity index 91% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/AppInfo.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/AppInfo.java index 77e9443a..4f80a301 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/AppInfo.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/AppInfo.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.beans; +package org.ruoyi.common.wechat.itchat4j.beans; import java.io.Serializable; diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/BaseMsg.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/BaseMsg.java similarity index 87% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/BaseMsg.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/BaseMsg.java index 2e3506f5..43146a82 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/BaseMsg.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/BaseMsg.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.beans; +package org.ruoyi.common.wechat.itchat4j.beans; import java.io.Serializable; @@ -46,10 +46,15 @@ public class BaseMsg implements Serializable { 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; @@ -290,4 +295,36 @@ public class BaseMsg implements Serializable { 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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/BaseResponse.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/BaseResponse.java new file mode 100644 index 00000000..063495fb --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/BaseResponse.java @@ -0,0 +1,28 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/Member.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/Member.java new file mode 100644 index 00000000..2a84d254 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/Member.java @@ -0,0 +1,306 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/RecommendInfo.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/RecommendInfo.java similarity index 97% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/RecommendInfo.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/RecommendInfo.java index a2d0cf43..51c82217 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/beans/RecommendInfo.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/RecommendInfo.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.beans; +package org.ruoyi.common.wechat.itchat4j.beans; import java.io.Serializable; diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/SendMsg.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/SendMsg.java new file mode 100644 index 00000000..33661f94 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/SendMsg.java @@ -0,0 +1,59 @@ +package org.ruoyi.common.wechat.itchat4j.beans; + +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/SyncKey.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/SyncKey.java new file mode 100644 index 00000000..de8078cd --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/SyncKey.java @@ -0,0 +1,52 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/User.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/User.java new file mode 100644 index 00000000..750bb5f4 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/User.java @@ -0,0 +1,54 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/WebWxInit.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/WebWxInit.java new file mode 100644 index 00000000..fba7077a --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/beans/WebWxInit.java @@ -0,0 +1,43 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/client/HttpClientManage.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/client/HttpClientManage.java new file mode 100644 index 00000000..7e157865 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/client/HttpClientManage.java @@ -0,0 +1,34 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/client/SingleHttpClient.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/client/SingleHttpClient.java new file mode 100644 index 00000000..7fcc9bfb --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/client/SingleHttpClient.java @@ -0,0 +1,187 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/controller/LoginController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/controller/LoginController.java new file mode 100644 index 00000000..171f73f3 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/controller/LoginController.java @@ -0,0 +1,148 @@ +package org.ruoyi.common.wechat.itchat4j.controller; + +import org.ruoyi.common.wechat.itchat4j.core.Core; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.itchat4j.core.MsgCenter; +import org.ruoyi.common.wechat.itchat4j.service.ILoginService; +import org.ruoyi.common.wechat.itchat4j.service.impl.LoginServiceImpl; +import org.ruoyi.common.wechat.itchat4j.utils.LogInterface; +import org.ruoyi.common.wechat.itchat4j.utils.SleepUtils; +import org.ruoyi.common.wechat.itchat4j.utils.enums.URLEnum; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/Core.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/Core.java new file mode 100644 index 00000000..a1c65aa0 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/Core.java @@ -0,0 +1,371 @@ +package org.ruoyi.common.wechat.itchat4j.core; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; +import org.ruoyi.common.wechat.itchat4j.beans.BaseMsg; +import org.ruoyi.common.wechat.itchat4j.beans.SendMsg; +import org.ruoyi.common.wechat.itchat4j.beans.User; +import org.ruoyi.common.wechat.itchat4j.client.HttpClientManage; +import org.ruoyi.common.wechat.itchat4j.client.SingleHttpClient; +import org.ruoyi.common.wechat.itchat4j.service.impl.LoginServiceImpl; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/CoreManage.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/CoreManage.java new file mode 100644 index 00000000..140903fa --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/CoreManage.java @@ -0,0 +1,323 @@ +package org.ruoyi.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.ruoyi.common.wechat.itchat4j.beans.SendMsg; +import org.ruoyi.common.wechat.itchat4j.client.HttpClientManage; +import org.ruoyi.common.wechat.itchat4j.controller.LoginController; +import org.ruoyi.common.wechat.itchat4j.utils.LogInterface; +import org.ruoyi.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/MsgCenter.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/MsgCenter.java new file mode 100644 index 00000000..9a8f607c --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/core/MsgCenter.java @@ -0,0 +1,273 @@ +package org.ruoyi.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.ruoyi.common.wechat.itchat4j.api.MessageTools; +import org.ruoyi.common.wechat.itchat4j.api.WechatTools; +import org.ruoyi.common.wechat.itchat4j.beans.BaseMsg; +import org.ruoyi.common.wechat.itchat4j.beans.SendMsg; +import org.ruoyi.common.wechat.itchat4j.face.IMsgHandlerFace; +import org.ruoyi.common.wechat.itchat4j.utils.LogInterface; +import org.ruoyi.common.wechat.itchat4j.utils.MoreConfig; +import org.ruoyi.common.wechat.itchat4j.utils.enums.MsgCodeEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.MsgTypeEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/face/IMsgHandlerFace.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/face/IMsgHandlerFace.java similarity index 73% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/face/IMsgHandlerFace.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/face/IMsgHandlerFace.java index 18542dba..31e2c2a9 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/face/IMsgHandlerFace.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/face/IMsgHandlerFace.java @@ -1,6 +1,6 @@ -package com.xmzs.common.wechat.face; +package org.ruoyi.common.wechat.itchat4j.face; -import com.xmzs.common.wechat.beans.BaseMsg; +import org.ruoyi.common.wechat.itchat4j.beans.BaseMsg; /** * 消息处理接口 @@ -9,8 +9,10 @@ import com.xmzs.common.wechat.beans.BaseMsg; * @date 创建时间:2017年4月20日 上午12:13:49 * @version 1.0 * + * @author WesleyOne 修改 */ public interface IMsgHandlerFace { + /** * * @author https://github.com/yaphone @@ -18,7 +20,7 @@ public interface IMsgHandlerFace { * @param msg * @return */ - public String textMsgHandle(BaseMsg msg); + void textMsgHandle(BaseMsg msg); /** * 处理图片消息 @@ -28,7 +30,7 @@ public interface IMsgHandlerFace { * @param msg * @return */ - public String picMsgHandle(BaseMsg msg); + void picMsgHandle(BaseMsg msg); /** * 处理声音消息 @@ -38,7 +40,7 @@ public interface IMsgHandlerFace { * @param msg * @return */ - public String voiceMsgHandle(BaseMsg msg); + void voiceMsgHandle(BaseMsg msg); /** * 处理小视频消息 @@ -48,7 +50,7 @@ public interface IMsgHandlerFace { * @param msg * @return */ - public String viedoMsgHandle(BaseMsg msg); + void videoMsgHandle(BaseMsg msg); /** * 处理名片消息 @@ -58,7 +60,7 @@ public interface IMsgHandlerFace { * @param msg * @return */ - public String nameCardMsgHandle(BaseMsg msg); + void nameCardMsgHandle(BaseMsg msg); /** * 处理系统消息 @@ -68,7 +70,7 @@ public interface IMsgHandlerFace { * @param msg * @return */ - public void sysMsgHandle(BaseMsg msg); + void sysMsgHandle(BaseMsg msg); /** * 处理确认添加好友消息 @@ -77,7 +79,7 @@ public interface IMsgHandlerFace { * @param msg * @return */ - public String verifyAddFriendMsgHandle(BaseMsg msg); + void verifyAddFriendMsgHandle(BaseMsg msg); /** * 处理收到的文件消息 @@ -86,6 +88,6 @@ public interface IMsgHandlerFace { * @param msg * @return */ - public String mediaMsgHandle(BaseMsg msg); + void mediaMsgHandle(BaseMsg msg); } diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/service/ILoginService.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/service/ILoginService.java similarity index 90% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/service/ILoginService.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/service/ILoginService.java index 4ee3ecdd..97a7cb51 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/service/ILoginService.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/service/ILoginService.java @@ -1,4 +1,6 @@ -package com.xmzs.common.wechat.service; +package org.ruoyi.common.wechat.itchat4j.service; + + /** * 登陆服务接口 @@ -7,6 +9,7 @@ package com.xmzs.common.wechat.service; * @date 创建时间:2017年5月13日 上午12:07:21 * @version 1.0 * + * @author WesleyOne 修改 */ public interface ILoginService { @@ -24,19 +27,19 @@ public interface ILoginService { * * @author https://github.com/yaphone * @date 2017年5月13日 上午12:21:40 - * @param qrPath * @return */ String getUuid(); /** * 获取二维码图片 - * + * (直接获取图片链接,不下载文件) * @author https://github.com/yaphone * @date 2017年5月13日 上午12:13:51 * @param qrPath * @return */ + @Deprecated boolean getQR(String qrPath); /** diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/service/impl/LoginServiceImpl.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/service/impl/LoginServiceImpl.java new file mode 100644 index 00000000..9e1d021a --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/service/impl/LoginServiceImpl.java @@ -0,0 +1,894 @@ +package org.ruoyi.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.ruoyi.common.wechat.itchat4j.beans.BaseMsg; +import org.ruoyi.common.wechat.itchat4j.beans.Member; +import org.ruoyi.common.wechat.itchat4j.beans.WebWxInit; +import org.ruoyi.common.wechat.itchat4j.core.Core; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.itchat4j.core.MsgCenter; +import org.ruoyi.common.wechat.itchat4j.service.ILoginService; +import org.ruoyi.common.wechat.itchat4j.utils.LogInterface; +import org.ruoyi.common.wechat.itchat4j.utils.SleepUtils; +import org.ruoyi.common.wechat.itchat4j.utils.enums.*; +import org.ruoyi.common.wechat.itchat4j.utils.enums.parameters.BaseParaEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.parameters.LoginParaEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.parameters.StatusNotifyParaEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.parameters.UUIDParaEnum; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/Config.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/Config.java similarity index 63% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/Config.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/Config.java index bc5bc6a1..af88ac30 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/Config.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/Config.java @@ -1,13 +1,12 @@ -package com.xmzs.common.wechat.utils; +package org.ruoyi.common.wechat.itchat4j.utils; -import com.xmzs.common.wechat.utils.enums.OsNameEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.OsNameEnum; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; - /** * 配置信息 * @@ -20,20 +19,18 @@ public class Config { public static final String API_WXAPPID = "API_WXAPPID"; - public static final String picDir = "D://itchat4j"; - public static final String VERSION = "1.4.1"; + public static final String picDir = "D://org.ruoyi.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 REFERER = "https://wx.qq.com/?&lang=zh_CN&target=t"; 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"; - public static final String UOS_PATCH_CLIENT_VERSION = "2.0.0"; - - public static final String UOS_PATCH_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=="; - + /** + * 仅仅用于参考 + */ + @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", diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/ConstantConfigEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/ConstantConfigEnum.java similarity index 96% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/ConstantConfigEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/ConstantConfigEnum.java index 2b227772..95bd1166 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/ConstantConfigEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/ConstantConfigEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils; +package org.ruoyi.common.wechat.itchat4j.utils; /** * 常量 diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/LogInterface.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/LogInterface.java new file mode 100644 index 00000000..176c2793 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/LogInterface.java @@ -0,0 +1,13 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/MoreConfig.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/MoreConfig.java new file mode 100644 index 00000000..88d125cb --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/MoreConfig.java @@ -0,0 +1,12 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/SleepUtils.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/SleepUtils.java similarity index 86% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/SleepUtils.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/SleepUtils.java index b945606d..bff19010 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/SleepUtils.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/SleepUtils.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils; +package org.ruoyi.common.wechat.itchat4j.utils; /** * Created by xiaoxiaomo on 2017/5/6. diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/MsgCodeEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/MsgCodeEnum.java new file mode 100644 index 00000000..b8a5f239 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/MsgCodeEnum.java @@ -0,0 +1,64 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/MsgTypeEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/MsgTypeEnum.java similarity index 86% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/MsgTypeEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/MsgTypeEnum.java index 63ef4501..66c0907a 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/MsgTypeEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/MsgTypeEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils.enums; +package org.ruoyi.common.wechat.itchat4j.utils.enums; /** @@ -11,12 +11,15 @@ package com.xmzs.common.wechat.utils.enums; */ public enum MsgTypeEnum { TEXT("Text", "文本消息"), + MAP("MAP", "地理位置"), PIC("Pic", "图片消息"), VOICE("Voice", "语音消息"), VIEDO("Viedo", "小视频消息"), NAMECARD("NameCard", "名片消息"), SYS("Sys", "系统消息"), VERIFYMSG("VerifyMsg", "添加好友"), + + // 地址分享 MEDIA("app", "文件消息"); private String type; diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/OsNameEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/OsNameEnum.java similarity index 78% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/OsNameEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/OsNameEnum.java index 1a00a43a..0272d76e 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/OsNameEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/OsNameEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils.enums; +package org.ruoyi.common.wechat.itchat4j.utils.enums; /** * 系统平台 diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/ResultEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/ResultEnum.java new file mode 100644 index 00000000..8c4cdaa3 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/ResultEnum.java @@ -0,0 +1,25 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/RetCodeEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/RetCodeEnum.java new file mode 100644 index 00000000..e4628f2e --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/RetCodeEnum.java @@ -0,0 +1,49 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/SelectorEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/SelectorEnum.java new file mode 100644 index 00000000..99b3048d --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/SelectorEnum.java @@ -0,0 +1,48 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/SendMsgType.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/SendMsgType.java new file mode 100644 index 00000000..4a424365 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/SendMsgType.java @@ -0,0 +1,65 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/StorageLoginInfoEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/StorageLoginInfoEnum.java similarity index 81% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/StorageLoginInfoEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/StorageLoginInfoEnum.java index fa68b3bf..a9722ee0 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/StorageLoginInfoEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/StorageLoginInfoEnum.java @@ -1,11 +1,8 @@ -package com.xmzs.common.wechat.utils.enums; +package org.ruoyi.common.wechat.itchat4j.utils.enums; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import java.util.HashMap; -import java.util.Map; - /** * Created by xiaoxiaomo on 2017/5/7. */ @@ -15,8 +12,8 @@ public enum StorageLoginInfoEnum { url("url",new String()), fileUrl("fileUrl",new String()), syncUrl("syncUrl",new String()), - - deviceid("deviceid",new String()), //生成15位随机数 + //生成15位随机数 + deviceid("deviceid",new String()), //baseRequest skey("skey",new String()), @@ -25,7 +22,8 @@ public enum StorageLoginInfoEnum { pass_ticket("pass_ticket",new String()), - InviteStartCount("InviteStartCount",0), + InviteStartCount("InviteStartCount",new Integer(0)), + // 登录用户登录时信息 User("User",new JSONObject()), SyncKey("SyncKey",new JSONObject()), synckey("synckey",new String()), diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/URLEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/URLEnum.java similarity index 91% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/URLEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/URLEnum.java index 06348eff..2f713c12 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/URLEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/URLEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils.enums; +package org.ruoyi.common.wechat.itchat4j.utils.enums; /** * URL @@ -15,7 +15,7 @@ public enum URLEnum { 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","web微信消息同步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", "上传文件到服务器"), diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/VerifyFriendEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/VerifyFriendEnum.java similarity index 88% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/VerifyFriendEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/VerifyFriendEnum.java index 1ea22139..8ff1ea1b 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/VerifyFriendEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/VerifyFriendEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils.enums; +package org.ruoyi.common.wechat.itchat4j.utils.enums; /** * 确认添加好友Enum diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/BaseParaEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/BaseParaEnum.java similarity index 89% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/BaseParaEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/BaseParaEnum.java index 9bdd7e7c..7631ff37 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/BaseParaEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/BaseParaEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils.enums.parameters; +package org.ruoyi.common.wechat.itchat4j.utils.enums.parameters; /** * diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/LoginParaEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/LoginParaEnum.java similarity index 88% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/LoginParaEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/LoginParaEnum.java index da06b325..507c87ef 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/LoginParaEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/LoginParaEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils.enums.parameters; +package org.ruoyi.common.wechat.itchat4j.utils.enums.parameters; /** * 登陆 diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/StatusNotifyParaEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/StatusNotifyParaEnum.java similarity index 80% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/StatusNotifyParaEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/StatusNotifyParaEnum.java index c70a481c..6e105e63 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/StatusNotifyParaEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/StatusNotifyParaEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils.enums.parameters; +package org.ruoyi.common.wechat.itchat4j.utils.enums.parameters; /** * 状态通知 @@ -10,7 +10,8 @@ public enum StatusNotifyParaEnum { CODE("Code", "3"), FROM_USERNAME("FromUserName", ""), TO_USERNAME("ToUserName", ""), - CLIENT_MSG_ID("ClientMsgId", ""); //时间戳 + //时间戳 + CLIENT_MSG_ID("ClientMsgId", ""); private String para; private String value; diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/UUIDParaEnum.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/UUIDParaEnum.java similarity index 73% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/UUIDParaEnum.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/UUIDParaEnum.java index 6805b54d..5d002587 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/enums/parameters/UUIDParaEnum.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/enums/parameters/UUIDParaEnum.java @@ -1,4 +1,4 @@ -package com.xmzs.common.wechat.utils.enums.parameters; +package org.ruoyi.common.wechat.itchat4j.utils.enums.parameters; /** * UUID @@ -10,11 +10,8 @@ public enum UUIDParaEnum { APP_ID("appid", "wx782c26e4c19acffb"), FUN("fun", "new"), LANG("lang", "zh_CN"), - REDIRECT_URL("redirect_uri", - "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage?mod=desktop"), _1("_", "时间戳"); - private String para; private String value; diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/tools/CommonTools.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/tools/CommonTools.java similarity index 73% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/tools/CommonTools.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/tools/CommonTools.java index 6bb567df..17b2aff8 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/tools/CommonTools.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/tools/CommonTools.java @@ -1,27 +1,20 @@ -package com.xmzs.common.wechat.utils.tools; - -import java.io.StringReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.xml.sax.InputSource; +package org.ruoyi.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.ruoyi.common.wechat.itchat4j.utils.Config; +import org.ruoyi.common.wechat.itchat4j.utils.enums.OsNameEnum; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; -import com.xmzs.common.wechat.utils.Config; -import com.xmzs.common.wechat.utils.enums.OsNameEnum; +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; /** * 常用工具类 @@ -196,7 +189,8 @@ public class CommonTools { * @param k */ public static void emojiFormatter(JSONObject d, String k) { - Matcher matcher = getMatcher("", d.getString(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; @@ -224,6 +218,40 @@ public class CommonTools { } + /** + * 转化成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); + } + + } + /** * 消息格式化 * @@ -240,4 +268,34 @@ public class CommonTools { } + 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/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/tools/DownloadTools.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/tools/DownloadTools.java similarity index 75% rename from ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/tools/DownloadTools.java rename to ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/tools/DownloadTools.java index 88166cab..3b1f3600 100644 --- a/ruoyi-common/ruoyi-common-wechat/src/main/java/com/xmzs/common/wechat/utils/tools/DownloadTools.java +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/itchat4j/utils/tools/DownloadTools.java @@ -1,4 +1,14 @@ -package com.xmzs.common.wechat.utils.tools; +package org.ruoyi.common.wechat.itchat4j.utils.tools; + +import org.apache.http.HttpEntity; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.ruoyi.common.wechat.itchat4j.beans.BaseMsg; +import org.ruoyi.common.wechat.itchat4j.core.Core; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.itchat4j.utils.LogInterface; +import org.ruoyi.common.wechat.itchat4j.utils.enums.MsgTypeEnum; +import org.ruoyi.common.wechat.itchat4j.utils.enums.URLEnum; import java.io.FileOutputStream; import java.io.OutputStream; @@ -8,16 +18,6 @@ import java.util.List; import java.util.Map; import java.util.logging.Logger; -import org.apache.http.HttpEntity; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; - -import com.xmzs.common.wechat.beans.BaseMsg; -import com.xmzs.common.wechat.core.Core; -import com.xmzs.common.wechat.utils.MyHttpClient; -import com.xmzs.common.wechat.utils.enums.MsgTypeEnum; -import com.xmzs.common.wechat.utils.enums.URLEnum; - /** * 下载工具类 * @@ -26,22 +26,21 @@ import com.xmzs.common.wechat.utils.enums.URLEnum; * @version 1.0 * */ -public class DownloadTools { - private static Logger logger = Logger.getLogger("DownloadTools"); - private static Core core = Core.getInstance(); - private static MyHttpClient myHttpClient = core.getMyHttpClient(); +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 url - * @param msgId + * @param msg + * @param type * @param path * @return */ - public static Object getDownloadFn(BaseMsg msg, String type, String path) { + 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 = ""; @@ -61,15 +60,13 @@ public class DownloadTools { } params.add(new BasicNameValuePair("msgid", msg.getNewMsgId())); params.add(new BasicNameValuePair("skey", (String) core.getLoginInfo().get("skey"))); - HttpEntity entity = myHttpClient.doGet(url, params, true, headerMap); + 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(); - // Tools.printQr(path); - } catch (Exception e) { logger.info(e.getMessage()); return false; diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/annotation/UnCheckLogin.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/annotation/UnCheckLogin.java new file mode 100644 index 00000000..22ec06c4 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/annotation/UnCheckLogin.java @@ -0,0 +1,11 @@ +package org.ruoyi.common.wechat.web.annotation; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * 不检查登录 + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface UnCheckLogin { +} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseError.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseError.java new file mode 100644 index 00000000..41c263cb --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseError.java @@ -0,0 +1,56 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseException.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseException.java new file mode 100644 index 00000000..aecd571b --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseException.java @@ -0,0 +1,40 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseResponse.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseResponse.java new file mode 100644 index 00000000..c8468a4d --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/base/BaseResponse.java @@ -0,0 +1,85 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/cache/UserSession.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/cache/UserSession.java new file mode 100644 index 00000000..a915d7ff --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/cache/UserSession.java @@ -0,0 +1,30 @@ +package org.ruoyi.common.wechat.web.cache; + +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/MyConfig.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/MyConfig.java new file mode 100644 index 00000000..779f1a5b --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/MyConfig.java @@ -0,0 +1,153 @@ +package org.ruoyi.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.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.web.constant.UploadConstant; +import org.ruoyi.common.wechat.web.interceptor.ExceptionInterceptor; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/MyRoute.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/MyRoute.java new file mode 100644 index 00000000..b4b89fb3 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/MyRoute.java @@ -0,0 +1,30 @@ +package org.ruoyi.common.wechat.web.common; + +import com.jfinal.config.Routes; +import org.ruoyi.common.wechat.web.controller.*; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/OutRoute.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/OutRoute.java new file mode 100644 index 00000000..979389f7 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/common/OutRoute.java @@ -0,0 +1,21 @@ +package org.ruoyi.common.wechat.web.common; + +import com.jfinal.config.Routes; +import org.ruoyi.common.wechat.web.controller.ExtendController; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/constant/ConfigKeys.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/constant/ConfigKeys.java new file mode 100644 index 00000000..76577c4d --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/constant/ConfigKeys.java @@ -0,0 +1,21 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/constant/UploadConstant.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/constant/UploadConstant.java new file mode 100644 index 00000000..3155faff --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/constant/UploadConstant.java @@ -0,0 +1,21 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/ExtendController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/ExtendController.java new file mode 100644 index 00000000..dcd0f4ed --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/ExtendController.java @@ -0,0 +1,125 @@ +package org.ruoyi.common.wechat.web.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.ruoyi.common.wechat.web.model.WxRobRelation; +import org.ruoyi.common.wechat.web.utils.IpUtil; + +/** + * 对外接口 + * @author WesleyOne + * @create 2018/12/16 + */ +public class ExtendController extends _BaseController { + + + /** + * 对外通用规则发消息 + * 参数: + * ok 外接唯一码 + * msg 消息列表 + * 类型参考@see org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RelateController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RelateController.java new file mode 100644 index 00000000..139d2720 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RelateController.java @@ -0,0 +1,179 @@ +package org.ruoyi.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.ruoyi.common.wechat.itchat4j.api.WechatTools; +import org.ruoyi.common.wechat.web.model.WxRobRelation; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RobotController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RobotController.java new file mode 100644 index 00000000..56e122bc --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RobotController.java @@ -0,0 +1,223 @@ +package org.ruoyi.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.ruoyi.common.wechat.itchat4j.core.Core; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.web.base.BaseException; +import org.ruoyi.common.wechat.web.model.WxRobConfig; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RobotWorkController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RobotWorkController.java new file mode 100644 index 00000000..3fdcd5d5 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/RobotWorkController.java @@ -0,0 +1,179 @@ +package org.ruoyi.common.wechat.web.controller; + +import com.alibaba.fastjson.JSONObject; +import org.ruoyi.common.wechat.itchat4j.api.WechatTools; +import org.ruoyi.common.wechat.itchat4j.controller.LoginController; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.itchat4j.service.impl.LoginServiceImpl; +import org.ruoyi.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/ToolController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/ToolController.java new file mode 100644 index 00000000..904b378d --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/ToolController.java @@ -0,0 +1,14 @@ +package org.ruoyi.common.wechat.web.controller; + +/** + * 通用工具 + * @author WesleyOne + * @create 2018/12/24 + */ +public class ToolController extends _BaseController { + + public void index(){ + renderTemplate("index.html"); + } + +} diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/UploadController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/UploadController.java new file mode 100644 index 00000000..c694b758 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/UploadController.java @@ -0,0 +1,47 @@ +package org.ruoyi.common.wechat.web.controller; + +import com.jfinal.upload.UploadFile; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/_BaseController.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/_BaseController.java new file mode 100644 index 00000000..f1c5c216 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/controller/_BaseController.java @@ -0,0 +1,199 @@ +package org.ruoyi.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.ruoyi.common.wechat.web.base.BaseError; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/enums/KeyMsgValueType.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/enums/KeyMsgValueType.java new file mode 100644 index 00000000..c28609e0 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/enums/KeyMsgValueType.java @@ -0,0 +1,45 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/ExceptionInterceptor.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/ExceptionInterceptor.java new file mode 100644 index 00000000..bbca0a71 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/ExceptionInterceptor.java @@ -0,0 +1,52 @@ +package org.ruoyi.common.wechat.web.interceptor; + +import com.jfinal.aop.Interceptor; +import com.jfinal.aop.Invocation; +import org.ruoyi.common.wechat.web.base.BaseError; +import org.ruoyi.common.wechat.web.base.BaseException; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/VisitLogInterceptor.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/VisitLogInterceptor.java new file mode 100644 index 00000000..0b03c8f7 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/VisitLogInterceptor.java @@ -0,0 +1,79 @@ +package org.ruoyi.common.wechat.web.interceptor; + + +import com.jfinal.aop.Interceptor; +import com.jfinal.aop.Invocation; +import org.ruoyi.common.wechat.web.annotation.UnCheckLogin; +import org.ruoyi.common.wechat.web.cache.UserSession; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/VisitLogInterceptor4down.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/VisitLogInterceptor4down.java new file mode 100644 index 00000000..61d2ee16 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/interceptor/VisitLogInterceptor4down.java @@ -0,0 +1,26 @@ +package org.ruoyi.common.wechat.web.interceptor; + +import com.jfinal.aop.Interceptor; +import com.jfinal.aop.Invocation; +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobConfig.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobConfig.java new file mode 100644 index 00000000..280776ef --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobConfig.java @@ -0,0 +1,21 @@ +package org.ruoyi.common.wechat.web.model; + +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobKeyword.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobKeyword.java new file mode 100644 index 00000000..aceeac43 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobKeyword.java @@ -0,0 +1,11 @@ +package org.ruoyi.common.wechat.web.model; + +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobRelation.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobRelation.java new file mode 100644 index 00000000..2f2aff6b --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/WxRobRelation.java @@ -0,0 +1,11 @@ +package org.ruoyi.common.wechat.web.model; + +import org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/_JFinalDemoGenerator.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/_JFinalDemoGenerator.java new file mode 100644 index 00000000..3502c597 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/_JFinalDemoGenerator.java @@ -0,0 +1,72 @@ +package org.ruoyi.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.ruoyi.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.ruoyi.common.wechat.web.model.base"; + // base model 文件保存路径 + String baseModelOutputDir = PathKit.getWebRootPath() + "/src/main/java/org.ruoyi.common.wechat/web/model/base"; + + // model 所使用的包名 (MappingKit 默认使用的包名) + String modelPackageName = "org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/_MappingKit.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/_MappingKit.java new file mode 100644 index 00000000..9426b066 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/_MappingKit.java @@ -0,0 +1,24 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobConfig.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobConfig.java new file mode 100644 index 00000000..352f0511 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobConfig.java @@ -0,0 +1,111 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobKeyword.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobKeyword.java new file mode 100644 index 00000000..98e01a13 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobKeyword.java @@ -0,0 +1,93 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobRelation.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobRelation.java new file mode 100644 index 00000000..2c0186b2 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/model/base/BaseWxRobRelation.java @@ -0,0 +1,84 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/Base64Util.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/Base64Util.java new file mode 100644 index 00000000..09dcb9cb --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/Base64Util.java @@ -0,0 +1,30 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/IpUtil.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/IpUtil.java new file mode 100644 index 00000000..b9b3073f --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/IpUtil.java @@ -0,0 +1,35 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/LRUCache.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/LRUCache.java new file mode 100644 index 00000000..80fc03f7 --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/LRUCache.java @@ -0,0 +1,26 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/MD5Util.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/MD5Util.java new file mode 100644 index 00000000..1748c30a --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/MD5Util.java @@ -0,0 +1,68 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/UUIDShortUtil.java b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/UUIDShortUtil.java new file mode 100644 index 00000000..ae4e476c --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/java/org/ruoyi/common/wechat/web/utils/UUIDShortUtil.java @@ -0,0 +1,33 @@ +package org.ruoyi.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/ruoyi-common/ruoyi-common-wechat/src/main/resources/appConfig.properties b/ruoyi-common/ruoyi-common-wechat/src/main/resources/appConfig.properties new file mode 100644 index 00000000..5ccffeaa --- /dev/null +++ b/ruoyi-common/ruoyi-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/ruoyi-common/ruoyi-common-wechat/src/main/resources/passport.properties b/ruoyi-common/ruoyi-common-wechat/src/main/resources/passport.properties new file mode 100644 index 00000000..0e375b7f --- /dev/null +++ b/ruoyi-common/ruoyi-common-wechat/src/main/resources/passport.properties @@ -0,0 +1 @@ +wxwobot = C9ah2BEPliU2EzPV/VAn9Q== \ No newline at end of file diff --git a/ruoyi-common/ruoyi-common-wechat/src/main/resources/undertow.txt b/ruoyi-common/ruoyi-common-wechat/src/main/resources/undertow.txt new file mode 100644 index 00000000..cdcd10ba --- /dev/null +++ b/ruoyi-common/ruoyi-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/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml index 94d0df76..d7696fb1 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -20,6 +20,8 @@ ruoyi-demo ruoyi-fusion ruoyi-system + ruoyi-live + ruoyi-knowledge
diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/MailController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/MailController.java deleted file mode 100644 index c6d5fcc4..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/MailController.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.common.core.domain.R; -import com.xmzs.common.mail.utils.MailUtils; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisCacheController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisCacheController.java deleted file mode 100644 index ba5caf45..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisCacheController.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.redis.utils.RedisUtils; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisLockController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisLockController.java deleted file mode 100644 index 2876aa01..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisLockController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.domain.R; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisPubSubController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisPubSubController.java deleted file mode 100644 index 29e8801d..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisPubSubController.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.common.core.domain.R; -import com.xmzs.common.redis.utils.RedisUtils; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisRateLimiterController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisRateLimiterController.java deleted file mode 100644 index d5dc3ecf..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/RedisRateLimiterController.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.common.core.domain.R; -import com.xmzs.common.ratelimiter.annotation.RateLimiter; -import com.xmzs.common.ratelimiter.enums.LimitType; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/SmsController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/SmsController.java deleted file mode 100644 index 311cb797..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/SmsController.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.sms.config.properties.SmsProperties; -import com.xmzs.common.sms.core.SmsTemplate; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/Swagger3DemoController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/Swagger3DemoController.java deleted file mode 100644 index 560674b3..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/Swagger3DemoController.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestBatchController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestBatchController.java deleted file mode 100644 index bdf3733e..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestBatchController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.xmzs.demo.controller; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.demo.domain.TestDemo; -import com.xmzs.demo.mapper.TestDemoMapper; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestDemoController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestDemoController.java deleted file mode 100644 index 788afe05..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestDemoController.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.xmzs.demo.controller; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.ValidatorUtils; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.core.validate.QueryGroup; -import com.xmzs.common.excel.core.ExcelResult; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.idempotent.annotation.RepeatSubmit; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.demo.domain.TestDemo; -import com.xmzs.demo.domain.bo.TestDemoBo; -import com.xmzs.demo.domain.bo.TestDemoImportVo; -import com.xmzs.demo.domain.vo.TestDemoVo; -import com.xmzs.demo.service.ITestDemoService; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestEncryptController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestEncryptController.java deleted file mode 100644 index 4f7fd868..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestEncryptController.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.common.core.domain.R; -import com.xmzs.demo.domain.TestDemoEncrypt; -import com.xmzs.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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestExcelController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestExcelController.java deleted file mode 100644 index 8209f300..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestExcelController.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.xmzs.demo.controller; - -import cn.hutool.core.collection.CollUtil; -import com.xmzs.common.excel.utils.ExcelUtil; -import jakarta.servlet.http.HttpServletResponse; -import lombok.AllArgsConstructor; -import lombok.Data; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestI18nController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestI18nController.java deleted file mode 100644 index 6cd52aa4..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestI18nController.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.utils.MessageUtils; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestSensitiveController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestSensitiveController.java deleted file mode 100644 index 2c5f1a71..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestSensitiveController.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.xmzs.demo.controller; - -import com.xmzs.common.core.domain.R; -import com.xmzs.common.sensitive.annotation.Sensitive; -import com.xmzs.common.sensitive.core.SensitiveService; -import com.xmzs.common.sensitive.core.SensitiveStrategy; -import com.xmzs.common.web.core.BaseController; -import lombok.Data; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestTreeController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestTreeController.java deleted file mode 100644 index 2d1873b5..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/TestTreeController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.xmzs.demo.controller; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.core.validate.QueryGroup; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.idempotent.annotation.RepeatSubmit; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.demo.domain.bo.TestTreeBo; -import com.xmzs.demo.domain.vo.TestTreeVo; -import com.xmzs.demo.service.ITestTreeService; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/BoundedQueueController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/BoundedQueueController.java deleted file mode 100644 index 204e61e3..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/BoundedQueueController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.xmzs.demo.controller.queue; - -import com.xmzs.common.core.domain.R; -import com.xmzs.common.redis.utils.QueueUtils; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/DelayedQueueController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/DelayedQueueController.java deleted file mode 100644 index cdfc9c6a..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/DelayedQueueController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.xmzs.demo.controller.queue; - -import com.xmzs.common.core.domain.R; -import com.xmzs.common.redis.utils.QueueUtils; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/PriorityDemo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/PriorityDemo.java deleted file mode 100644 index 7ba2125b..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/PriorityDemo.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/PriorityQueueController.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/PriorityQueueController.java deleted file mode 100644 index ba68f240..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/controller/queue/PriorityQueueController.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.xmzs.demo.controller.queue; - -import cn.hutool.core.util.RandomUtil; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.redis.utils.QueueUtils; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestDemo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestDemo.java deleted file mode 100644 index 2774b5e3..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestDemo.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.xmzs.demo.domain; - -import com.baomidou.mybatisplus.annotation.*; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestDemoEncrypt.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestDemoEncrypt.java deleted file mode 100644 index b8cb213f..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestDemoEncrypt.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.demo.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.encrypt.annotation.EncryptField; -import com.xmzs.common.encrypt.enumd.AlgorithmType; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestTree.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestTree.java deleted file mode 100644 index d8bb0c09..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/TestTree.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.xmzs.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 com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestDemoBo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestDemoBo.java deleted file mode 100644 index 716b0336..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestDemoBo.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xmzs.demo.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.demo.domain.TestDemo; -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 测试单表业务对象 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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestDemoImportVo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestDemoImportVo.java deleted file mode 100644 index 695971a7..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestDemoImportVo.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestTreeBo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestTreeBo.java deleted file mode 100644 index baf5d6d7..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/bo/TestTreeBo.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.xmzs.demo.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.demo.domain.TestTree; -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 测试树表业务对象 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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/package-info.java deleted file mode 100644 index 3ceb1f96..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.xmzs.demo.domain; diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/vo/TestDemoVo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/vo/TestDemoVo.java deleted file mode 100644 index ff340faa..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/vo/TestDemoVo.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.xmzs.demo.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.translation.annotation.Translation; -import com.xmzs.common.translation.constant.TransConstant; -import com.xmzs.demo.domain.TestDemo; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/vo/TestTreeVo.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/vo/TestTreeVo.java deleted file mode 100644 index 3f1cf8a9..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/domain/vo/TestTreeVo.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.xmzs.demo.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.demo.domain.TestTree; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestDemoEncryptMapper.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestDemoEncryptMapper.java deleted file mode 100644 index da018456..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestDemoEncryptMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.xmzs.demo.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.demo.domain.TestDemoEncrypt; - -/** - * 测试加密功能 - * - * @author Lion Li - */ -public interface TestDemoEncryptMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestDemoMapper.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestDemoMapper.java deleted file mode 100644 index 50cd21b8..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestDemoMapper.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.xmzs.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 com.xmzs.common.mybatis.annotation.DataColumn; -import com.xmzs.common.mybatis.annotation.DataPermission; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.demo.domain.TestDemo; -import com.xmzs.demo.domain.vo.TestDemoVo; -import org.apache.ibatis.annotations.Param; - -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestTreeMapper.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestTreeMapper.java deleted file mode 100644 index 3c5f7fb7..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/TestTreeMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.demo.mapper; - -import com.xmzs.common.mybatis.annotation.DataColumn; -import com.xmzs.common.mybatis.annotation.DataPermission; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.demo.domain.TestTree; -import com.xmzs.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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/package-info.java deleted file mode 100644 index 0f77326f..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/mapper/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.xmzs.demo.mapper; diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/ITestDemoService.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/ITestDemoService.java deleted file mode 100644 index 21fcf50d..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/ITestDemoService.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.xmzs.demo.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.demo.domain.TestDemo; -import com.xmzs.demo.domain.bo.TestDemoBo; -import com.xmzs.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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/ITestTreeService.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/ITestTreeService.java deleted file mode 100644 index fe51e7f2..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/ITestTreeService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xmzs.demo.service; - -import com.xmzs.demo.domain.bo.TestTreeBo; -import com.xmzs.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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/TestDemoServiceImpl.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/TestDemoServiceImpl.java deleted file mode 100644 index 3782d4cc..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/TestDemoServiceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.demo.domain.TestDemo; -import com.xmzs.demo.domain.bo.TestDemoBo; -import com.xmzs.demo.domain.vo.TestDemoVo; -import com.xmzs.demo.mapper.TestDemoMapper; -import com.xmzs.demo.service.ITestDemoService; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/TestTreeServiceImpl.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/TestTreeServiceImpl.java deleted file mode 100644 index ecca17fd..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/TestTreeServiceImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.xmzs.demo.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.demo.domain.TestTree; -import com.xmzs.demo.domain.bo.TestTreeBo; -import com.xmzs.demo.domain.vo.TestTreeVo; -import com.xmzs.demo.mapper.TestTreeMapper; -import com.xmzs.demo.service.ITestTreeService; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/package-info.java deleted file mode 100644 index f73f3f3e..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/impl/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.xmzs.demo.service.impl; diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/package-info.java b/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/package-info.java deleted file mode 100644 index badcad43..00000000 --- a/ruoyi-modules/ruoyi-demo/src/main/java/com/xmzs/demo/service/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.xmzs.demo.service; diff --git a/ruoyi-modules/ruoyi-fusion/pom.xml b/ruoyi-modules/ruoyi-fusion/pom.xml index a5fd1a9a..07439a15 100644 --- a/ruoyi-modules/ruoyi-fusion/pom.xml +++ b/ruoyi-modules/ruoyi-fusion/pom.xml @@ -11,7 +11,7 @@ ruoyi-fusion - AI绘画 + 三方API接入 @@ -29,10 +29,7 @@ - - org.springframework.boot - spring-boot-starter-web - + org.springframework.boot spring-boot-starter-data-redis @@ -114,6 +111,10 @@ org.ruoyi ruoyi-system + + org.ruoyi + ruoyi-knowledge + diff --git a/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/ChatController.java b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/ChatController.java index 0f717edf..dc5592f3 100644 --- a/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/ChatController.java +++ b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/ChatController.java @@ -17,7 +17,9 @@ import org.ruoyi.common.core.exception.base.BaseException; import org.ruoyi.common.mybatis.core.page.PageQuery; import org.ruoyi.common.mybatis.core.page.TableDataInfo; import org.ruoyi.common.satoken.utils.LoginHelper; +import org.ruoyi.knowledge.service.EmbeddingService; import org.ruoyi.system.domain.bo.ChatMessageBo; +import org.ruoyi.system.domain.request.translation.TranslationRequest; import org.ruoyi.system.domain.vo.ChatMessageVo; import org.ruoyi.system.service.IChatMessageService; import org.ruoyi.system.service.ISseService; @@ -46,12 +48,16 @@ public class ChatController { private final IChatMessageService chatMessageService; + private final EmbeddingService embeddingService; /** * 聊天接口 */ @PostMapping("/send") @ResponseBody public SseEmitter sseChat(@RequestBody @Valid ChatRequest chatRequest, HttpServletRequest request) { + if (chatRequest.getModel().startsWith("ollama")) { + return ISseService.ollamaChat(chatRequest); + } return ISseService.sseChat(chatRequest,request); } @@ -89,6 +95,17 @@ public class ChatController { return ISseService.textToSpeed(textToSpeech); } + /** + * 文本翻译 + * + * @param + */ + @PostMapping("/translation") + @ResponseBody + public String translation(@RequestBody TranslationRequest translationRequest) { + return ISseService.translation(translationRequest); + } + @PostMapping("/dall3") @ResponseBody public R> dall3(@RequestBody @Valid Dall3Request request) { diff --git a/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/CoverController.java b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/CoverController.java new file mode 100644 index 00000000..395156b2 --- /dev/null +++ b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/CoverController.java @@ -0,0 +1,58 @@ +package org.ruoyi.fusion.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.ruoyi.common.core.domain.R; +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.common.web.core.BaseController; +import org.ruoyi.system.domain.vo.cover.CoverParamVo; +import org.ruoyi.system.domain.vo.cover.CoverVo; +import org.ruoyi.system.domain.vo.cover.CoverCallbackVo; +import org.ruoyi.system.domain.vo.cover.MusicVo; +import org.ruoyi.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/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/LumaController.java b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/LumaController.java index 6e2bf1ce..312d67e7 100644 --- a/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/LumaController.java +++ b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/LumaController.java @@ -32,6 +32,7 @@ public class LumaController { @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"; diff --git a/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/PptController.java b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/PptController.java new file mode 100644 index 00000000..876999ec --- /dev/null +++ b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/PptController.java @@ -0,0 +1,79 @@ +package org.ruoyi.fusion.controller; + +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.ruoyi.common.core.domain.R; +import org.ruoyi.common.web.core.BaseController; +import org.ruoyi.system.domain.vo.ppt.*; +import org.ruoyi.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/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/VoiceController.java b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/VoiceController.java index 0a6b16c0..2909597d 100644 --- a/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/VoiceController.java +++ b/ruoyi-modules/ruoyi-fusion/src/main/java/org/ruoyi/fusion/controller/VoiceController.java @@ -1,31 +1,19 @@ package org.ruoyi.fusion.controller; -import cn.dev33.satoken.annotation.SaCheckPermission; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import org.ruoyi.common.core.domain.R; -import org.ruoyi.common.core.validate.EditGroup; -import org.ruoyi.common.log.annotation.Log; -import org.ruoyi.common.log.enums.BusinessType; -import org.ruoyi.common.satoken.utils.LoginHelper; import org.ruoyi.common.web.core.BaseController; -import org.ruoyi.system.domain.bo.VoiceRoleBo; -import org.ruoyi.system.domain.vo.VoiceRoleVo; import org.ruoyi.system.request.RoleListDto; -import org.ruoyi.system.request.RoleRequest; import org.ruoyi.system.request.SimpleGenerateRequest; import org.ruoyi.system.response.SimpleGenerateDataResponse; -import org.ruoyi.system.response.rolelist.RoleListVO; -import org.ruoyi.system.service.IVoiceRoleService; -import org.springframework.validation.annotation.Validated; +import org.ruoyi.system.response.rolelist.ChatAppStoreVO; +import org.ruoyi.system.service.IChatAppStoreService; import org.springframework.web.bind.annotation.*; -import java.util.ArrayList; import java.util.List; /** - * 配音角色 + * 应用市场 * * @author Lion Li * @date 2024-03-19 @@ -35,63 +23,7 @@ import java.util.List; @RequestMapping("/system/voice") public class VoiceController extends BaseController { - private final IVoiceRoleService voiceRoleService; - - /** - * 查询配音角色列表 - */ - @GetMapping("/list") - public List list(VoiceRoleBo bo) { - if(LoginHelper.getUserId() == null){ - return new ArrayList<>(); - } - bo.setCreateBy(LoginHelper.getUserId()); - return voiceRoleService.queryList(bo); - } - - /** - * 获取配音角色详细信息 - * - * @param id 主键 - */ - @SaCheckPermission("system:role:query") - @GetMapping("/{id}") - public R getInfo(@NotNull(message = "主键不能为空") - @PathVariable Long id) { - return R.ok(voiceRoleService.queryById(id)); - } - - - /** - * 新增配音角色 - */ - @Log(title = "配音角色", businessType = BusinessType.INSERT) - @PostMapping("/add") - public R add(@RequestBody RoleRequest roleRequest) { - return toAjax(voiceRoleService.insertByBo(roleRequest)); - } - - /** - * 修改配音角色 - */ - @SaCheckPermission("system:role:edit") - @Log(title = "配音角色", businessType = BusinessType.UPDATE) - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody VoiceRoleBo bo) { - return toAjax(voiceRoleService.updateByBo(bo)); - } - - /** - * 删除配音角色 - * - * @param ids 主键串 - */ - @Log(title = "配音角色", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable Long[] ids) { - return toAjax(voiceRoleService.deleteWithValidByIds(List.of(ids), true)); - } + private final IChatAppStoreService voiceRoleService; /** * 实时语音生成 @@ -105,7 +37,7 @@ public class VoiceController extends BaseController { * 角色市场 */ @GetMapping("/roleList") - public R> roleList() { + public R> roleList() { return R.ok(voiceRoleService.roleList()); } diff --git a/ruoyi-modules/ruoyi-generator/pom.xml b/ruoyi-modules/ruoyi-generator/pom.xml deleted file mode 100644 index 5d7f0410..00000000 --- a/ruoyi-modules/ruoyi-generator/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - com.xmzs - ruoyi-modules - ${revision} - ../pom.xml - - 4.0.0 - - ruoyi-generator - - - generator 代码生成 - - - - - - com.xmzs - ruoyi-common-core - - - - com.xmzs - ruoyi-common-doc - - - - com.xmzs - ruoyi-common-mybatis - - - - com.xmzs - ruoyi-common-web - - - - com.xmzs - ruoyi-common-log - - - - - org.apache.velocity - velocity-engine-core - - - - diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/config/GenConfig.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/config/GenConfig.java deleted file mode 100644 index 0f9a98b0..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/config/GenConfig.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.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 ruoyi - */ -@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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/constant/GenConstants.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/constant/GenConstants.java deleted file mode 100644 index 3be7f780..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/constant/GenConstants.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.xmzs.generator.constant; - -/** - * 代码生成通用常量 - * - * @author ruoyi - */ -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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/controller/GenController.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/controller/GenController.java deleted file mode 100644 index 74d37f0b..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/controller/GenController.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.xmzs.generator.controller; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.hutool.core.convert.Convert; -import cn.hutool.core.io.IoUtil; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.generator.domain.GenTable; -import com.xmzs.generator.domain.GenTableColumn; -import com.xmzs.generator.service.IGenTableService; -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=\"ruoyi.zip\""); - response.addHeader("Content-Length", "" + data.length); - response.setContentType("application/octet-stream; charset=UTF-8"); - IoUtil.write(response.getOutputStream(), false, data); - } -} diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/domain/GenTable.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/domain/GenTable.java deleted file mode 100644 index 59ab3899..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/domain/GenTable.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.generator.constant.GenConstants; -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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/domain/GenTableColumn.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/domain/GenTableColumn.java deleted file mode 100644 index f107b0e9..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/domain/GenTableColumn.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.StringUtils; -import com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/mapper/GenTableColumnMapper.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/mapper/GenTableColumnMapper.java deleted file mode 100644 index 286fc182..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/mapper/GenTableColumnMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xmzs.generator.mapper; - -import com.baomidou.mybatisplus.annotation.InterceptorIgnore; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.generator.domain.GenTableColumn; - -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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/mapper/GenTableMapper.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/mapper/GenTableMapper.java deleted file mode 100644 index e43567c6..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/mapper/GenTableMapper.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.xmzs.generator.mapper; - -import com.baomidou.mybatisplus.annotation.InterceptorIgnore; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/service/GenTableServiceImpl.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/service/GenTableServiceImpl.java deleted file mode 100644 index f2c6c64c..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/service/GenTableServiceImpl.java +++ /dev/null @@ -1,459 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.Constants; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.file.FileUtils; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.generator.constant.GenConstants; -import com.xmzs.generator.domain.GenTable; -import com.xmzs.generator.domain.GenTableColumn; -import com.xmzs.generator.mapper.GenTableColumnMapper; -import com.xmzs.generator.mapper.GenTableMapper; -import com.xmzs.generator.util.GenUtils; -import com.xmzs.generator.util.VelocityInitializer; -import com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/service/IGenTableService.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/service/IGenTableService.java deleted file mode 100644 index 0df97e72..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/service/IGenTableService.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.xmzs.generator.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.generator.domain.GenTable; -import com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/GenUtils.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/GenUtils.java deleted file mode 100644 index 46da7844..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/GenUtils.java +++ /dev/null @@ -1,233 +0,0 @@ -package com.xmzs.generator.util; - -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.generator.config.GenConfig; -import com.xmzs.generator.constant.GenConstants; -import com.xmzs.generator.domain.GenTable; -import com.xmzs.generator.domain.GenTableColumn; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.RegExUtils; - -import java.util.Arrays; - -/** - * 代码生成器 工具类 - * - * @author ruoyi - */ -@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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/VelocityInitializer.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/VelocityInitializer.java deleted file mode 100644 index 8485ff3f..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/VelocityInitializer.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xmzs.generator.util; - -import com.xmzs.common.core.constant.Constants; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.velocity.app.Velocity; - -import java.util.Properties; - -/** - * VelocityEngine工厂 - * - * @author ruoyi - */ -@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/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/VelocityUtils.java b/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/VelocityUtils.java deleted file mode 100644 index 47ca1841..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/java/com/xmzs/generator/util/VelocityUtils.java +++ /dev/null @@ -1,338 +0,0 @@ -package com.xmzs.generator.util; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.convert.Convert; -import cn.hutool.core.lang.Dict; -import com.xmzs.common.core.utils.DateUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.mybatis.helper.DataBaseHelper; -import com.xmzs.generator.constant.GenConstants; -import com.xmzs.generator.domain.GenTable; -import com.xmzs.generator.domain.GenTableColumn; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.velocity.VelocityContext; - -import java.util.*; - -/** - * 模板处理工具类 - * - * @author ruoyi - */ -@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/ruoyi-modules/ruoyi-generator/src/main/resources/generator.yml b/ruoyi-modules/ruoyi-generator/src/main/resources/generator.yml deleted file mode 100644 index 5dc7a190..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/generator.yml +++ /dev/null @@ -1,10 +0,0 @@ -# 代码生成 -gen: - # 作者 - author: Lion Li - # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool - packageName: com.xmzs.system - # 自动去除表前缀,默认是false - autoRemovePre: false - # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) - tablePrefix: sys_ diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml deleted file mode 100644 index 5749189f..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml deleted file mode 100644 index 6684c9e5..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/package-info.md b/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/package-info.md deleted file mode 100644 index c938b1e5..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/mapper/package-info.md +++ /dev/null @@ -1,3 +0,0 @@ -java包使用 `.` 分割 resource 目录使用 `/` 分割 -
-此文件目的 防止文件夹粘连找不到 `xml` 文件 \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/bo.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/bo.java.vm deleted file mode 100644 index a838fffd..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/bo.java.vm +++ /dev/null @@ -1,48 +0,0 @@ -package ${packageName}.domain.bo; - -import ${packageName}.domain.${ClassName}; -import com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/controller.java.vm deleted file mode 100644 index 48eb6b80..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/controller.java.vm +++ /dev/null @@ -1,115 +0,0 @@ -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.com.xmzs.RepeatSubmit; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.log.enums.BusinessType; -import utils.excel.common.com.xmzs.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 com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm deleted file mode 100644 index f78f35c9..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/domain.java.vm +++ /dev/null @@ -1,59 +0,0 @@ -package ${packageName}.domain; - -#foreach ($column in $columns) -#if($column.javaField=='tenantId') -#set($IsTenant=1) -#end -#end -#if($IsTenant==1) -import core.tenant.common.com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm deleted file mode 100644 index d8095956..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm +++ /dev/null @@ -1,15 +0,0 @@ -package ${packageName}.mapper; - -import ${packageName}.domain.${ClassName}; -import ${packageName}.domain.vo.${ClassName}Vo; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; - -/** - * ${functionName}Mapper接口 - * - * @author ${author} - * @date ${datetime} - */ -public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}, ${ClassName}Vo> { - -} diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/service.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/service.java.vm deleted file mode 100644 index c53469a6..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/service.java.vm +++ /dev/null @@ -1,53 +0,0 @@ -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 com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm deleted file mode 100644 index c9ca78ee..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm +++ /dev/null @@ -1,133 +0,0 @@ -package ${packageName}.service.impl; - -import com.xmzs.common.core.utils.MapstructUtils; - #if($table.crud || $table.sub) -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/vo.java.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/vo.java.vm deleted file mode 100644 index 97800e1b..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/java/vo.java.vm +++ /dev/null @@ -1,59 +0,0 @@ -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.com.xmzs.ExcelDictFormat; -import convert.excel.common.com.xmzs.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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/js/api.js.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/js/api.js.vm deleted file mode 100644 index 9295524a..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/js/api.js.vm +++ /dev/null @@ -1,44 +0,0 @@ -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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/oracle/sql.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/oracle/sql.vm deleted file mode 100644 index f6638be5..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/oracle/sql.vm +++ /dev/null @@ -1,19 +0,0 @@ --- 菜单 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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/postgres/sql.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/postgres/sql.vm deleted file mode 100644 index 09233923..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/postgres/sql.vm +++ /dev/null @@ -1,20 +0,0 @@ --- 菜单 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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sql.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sql.vm deleted file mode 100644 index 01824c27..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sql.vm +++ /dev/null @@ -1,19 +0,0 @@ --- 菜单 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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sqlserver/sql.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sqlserver/sql.vm deleted file mode 100644 index bdf166e5..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/sql/sqlserver/sql.vm +++ /dev/null @@ -1,19 +0,0 @@ --- 菜单 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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/ts/api.ts.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/ts/api.ts.vm deleted file mode 100644 index 9ef9ff4a..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/ts/api.ts.vm +++ /dev/null @@ -1,63 +0,0 @@ -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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/ts/types.ts.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/ts/types.ts.vm deleted file mode 100644 index 99359e02..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/ts/types.ts.vm +++ /dev/null @@ -1,44 +0,0 @@ -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/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm deleted file mode 100644 index dda1b467..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ /dev/null @@ -1,502 +0,0 @@ - - - diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm deleted file mode 100644 index 6847f3b0..00000000 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ /dev/null @@ -1,475 +0,0 @@ - - - diff --git a/ruoyi-modules/ruoyi-job/pom.xml b/ruoyi-modules/ruoyi-job/pom.xml deleted file mode 100644 index 7dafc399..00000000 --- a/ruoyi-modules/ruoyi-job/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - com.xmzs - ruoyi-modules - ${revision} - ../pom.xml - - 4.0.0 - jar - ruoyi-job - - - 任务调度 - - - - - - - com.xmzs - ruoyi-common-core - - - - - com.xmzs - ruoyi-common-job - - - - - - diff --git a/ruoyi-modules/ruoyi-job/src/main/java/com/xmzs/job/service/SampleService.java b/ruoyi-modules/ruoyi-job/src/main/java/com/xmzs/job/service/SampleService.java deleted file mode 100644 index 857a209f..00000000 --- a/ruoyi-modules/ruoyi-job/src/main/java/com/xmzs/job/service/SampleService.java +++ /dev/null @@ -1,252 +0,0 @@ -package com.xmzs.job.service; - -import com.xxl.job.core.context.XxlJobHelper; -import com.xxl.job.core.handler.annotation.XxlJob; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.DataOutputStream; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.Arrays; - -/** - * XxlJob开发示例(Bean模式) - *

- * 开发步骤: - * 1、任务开发:在Spring Bean实例中,开发Job方法; - * 2、注解配置:为Job方法添加注解 "@XxlJob(value="自定义jobhandler名称", init = "JobHandler初始化方法", destroy = "JobHandler销毁方法")",注解value值对应的是调度中心新建任务的JobHandler属性的值。 - * 3、执行日志:需要通过 "XxlJobHelper.log" 打印执行日志; - * 4、任务结果:默认任务结果为 "成功" 状态,不需要主动设置;如有诉求,比如设置任务结果为失败,可以通过 "XxlJobHelper.handleFail/handleSuccess" 自主设置任务结果; - * - * @author xuxueli 2019-12-11 21:52:51 - */ -@Slf4j -@Service -public class SampleService { - - - /** - * 1、简单任务示例(Bean模式) - */ - @XxlJob("demoJobHandler") - public void demoJobHandler() throws Exception { - XxlJobHelper.log("XXL-JOB, Hello World."); - - for (int i = 0; i < 5; i++) { - XxlJobHelper.log("beat at:" + i); - } - // default success - } - - - /** - * 2、分片广播任务 - */ - @XxlJob("shardingJobHandler") - public void shardingJobHandler() throws Exception { - - // 分片参数 - int shardIndex = XxlJobHelper.getShardIndex(); - int shardTotal = XxlJobHelper.getShardTotal(); - - XxlJobHelper.log("分片参数:当前分片序号 = {}, 总分片数 = {}", shardIndex, shardTotal); - - // 业务逻辑 - for (int i = 0; i < shardTotal; i++) { - if (i == shardIndex) { - XxlJobHelper.log("第 {} 片, 命中分片开始处理", i); - } else { - XxlJobHelper.log("第 {} 片, 忽略", i); - } - } - - } - - - /** - * 3、命令行任务 - */ - @XxlJob("commandJobHandler") - public void commandJobHandler() throws Exception { - String command = XxlJobHelper.getJobParam(); - int exitValue = -1; - - BufferedReader bufferedReader = null; - try { - // command process - ProcessBuilder processBuilder = new ProcessBuilder(); - processBuilder.command(command); - processBuilder.redirectErrorStream(true); - - Process process = processBuilder.start(); - //Process process = Runtime.getRuntime().exec(command); - - BufferedInputStream bufferedInputStream = new BufferedInputStream(process.getInputStream()); - bufferedReader = new BufferedReader(new InputStreamReader(bufferedInputStream)); - - // command log - String line; - while ((line = bufferedReader.readLine()) != null) { - XxlJobHelper.log(line); - } - - // command exit - process.waitFor(); - exitValue = process.exitValue(); - } catch (Exception e) { - XxlJobHelper.log(e); - } finally { - if (bufferedReader != null) { - bufferedReader.close(); - } - } - - if (exitValue == 0) { - // default success - } else { - XxlJobHelper.handleFail("command exit value(" + exitValue + ") is failed"); - } - - } - - - /** - * 4、跨平台Http任务 - * 参数示例: - * "url: http://www.baidu.com\n" + - * "method: get\n" + - * "data: content\n"; - */ - @XxlJob("httpJobHandler") - public void httpJobHandler() throws Exception { - - // param parse - String param = XxlJobHelper.getJobParam(); - if (param == null || param.trim().length() == 0) { - XxlJobHelper.log("param[" + param + "] invalid."); - - XxlJobHelper.handleFail(); - return; - } - - String[] httpParams = param.split("\n"); - String url = null; - String method = null; - String data = null; - for (String httpParam : httpParams) { - if (httpParam.startsWith("url:")) { - url = httpParam.substring(httpParam.indexOf("url:") + 4).trim(); - } - if (httpParam.startsWith("method:")) { - method = httpParam.substring(httpParam.indexOf("method:") + 7).trim().toUpperCase(); - } - if (httpParam.startsWith("data:")) { - data = httpParam.substring(httpParam.indexOf("data:") + 5).trim(); - } - } - - // param valid - if (url == null || url.trim().length() == 0) { - XxlJobHelper.log("url[" + url + "] invalid."); - - XxlJobHelper.handleFail(); - return; - } - if (method == null || !Arrays.asList("GET", "POST").contains(method)) { - XxlJobHelper.log("method[" + method + "] invalid."); - - XxlJobHelper.handleFail(); - return; - } - boolean isPostMethod = method.equals("POST"); - - // request - HttpURLConnection connection = null; - BufferedReader bufferedReader = null; - try { - // connection - URL realUrl = new URL(url); - connection = (HttpURLConnection) realUrl.openConnection(); - - // connection setting - connection.setRequestMethod(method); - connection.setDoOutput(isPostMethod); - connection.setDoInput(true); - connection.setUseCaches(false); - connection.setReadTimeout(5 * 1000); - connection.setConnectTimeout(3 * 1000); - connection.setRequestProperty("connection", "Keep-Alive"); - connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); - connection.setRequestProperty("Accept-Charset", "application/json;charset=UTF-8"); - - // do connection - connection.connect(); - - // data - if (isPostMethod && data != null && data.trim().length() > 0) { - DataOutputStream dataOutputStream = new DataOutputStream(connection.getOutputStream()); - dataOutputStream.write(data.getBytes("UTF-8")); - dataOutputStream.flush(); - dataOutputStream.close(); - } - - // valid StatusCode - int statusCode = connection.getResponseCode(); - if (statusCode != 200) { - throw new RuntimeException("Http Request StatusCode(" + statusCode + ") Invalid."); - } - - // result - bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); - StringBuilder result = new StringBuilder(); - String line; - while ((line = bufferedReader.readLine()) != null) { - result.append(line); - } - String responseMsg = result.toString(); - - XxlJobHelper.log(responseMsg); - - return; - } catch (Exception e) { - XxlJobHelper.log(e); - - XxlJobHelper.handleFail(); - return; - } finally { - try { - if (bufferedReader != null) { - bufferedReader.close(); - } - if (connection != null) { - connection.disconnect(); - } - } catch (Exception e2) { - XxlJobHelper.log(e2); - } - } - - } - - /** - * 5、生命周期任务示例:任务初始化与销毁时,支持自定义相关逻辑; - */ - @XxlJob(value = "demoJobHandler2", init = "init", destroy = "destroy") - public void demoJobHandler2() throws Exception { - XxlJobHelper.log("XXL-JOB, Hello World."); - } - - public void init() { - log.info("init"); - } - - public void destroy() { - log.info("destory"); - } - - -} diff --git a/ruoyi-modules/ruoyi-knowledge/pom.xml b/ruoyi-modules/ruoyi-knowledge/pom.xml new file mode 100644 index 00000000..dcba1990 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/pom.xml @@ -0,0 +1,200 @@ + + + 4.0.0 + + org.ruoyi + ruoyi-modules + ${revision} + ../pom.xml + + + ruoyi-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 + ruoyi-system + + + + + + + diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/CodeFileLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/CodeFileLoader.java new file mode 100644 index 00000000..0ca7ea6e --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/CodeFileLoader.java @@ -0,0 +1,37 @@ +package org.ruoyi.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.ruoyi.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){ + return textSplitter.split(content); + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/CsvFileLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/CsvFileLoader.java new file mode 100644 index 00000000..5bedf5b7 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/CsvFileLoader.java @@ -0,0 +1,16 @@ +package org.ruoyi.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) { + return null; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/FolderLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/FolderLoader.java new file mode 100644 index 00000000..4682fee9 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/FolderLoader.java @@ -0,0 +1,16 @@ +package org.ruoyi.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) { + return null; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/GithubLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/GithubLoader.java new file mode 100644 index 00000000..ae86ac42 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/GithubLoader.java @@ -0,0 +1,16 @@ +package org.ruoyi.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) { + return null; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/JsonFileLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/JsonFileLoader.java new file mode 100644 index 00000000..5cd1d6e0 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/JsonFileLoader.java @@ -0,0 +1,16 @@ +package org.ruoyi.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) { + return null; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/MarkDownFileLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/MarkDownFileLoader.java new file mode 100644 index 00000000..cecdf052 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/MarkDownFileLoader.java @@ -0,0 +1,37 @@ +package org.ruoyi.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.ruoyi.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){ + return textSplitter.split(content); + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/PdfFileLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/PdfFileLoader.java new file mode 100644 index 00000000..83566de3 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/PdfFileLoader.java @@ -0,0 +1,34 @@ +package org.ruoyi.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.text.PDFTextStripper; +import org.ruoyi.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) { + return characterTextSplitter.split(content); + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/ResourceLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/ResourceLoader.java new file mode 100644 index 00000000..32f41305 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/ResourceLoader.java @@ -0,0 +1,12 @@ +package org.ruoyi.knowledge.chain.loader; + +import java.io.InputStream; +import java.util.List; + +/** + * 资源载入 + */ +public interface ResourceLoader { + String getContent(InputStream inputStream); + List getChunkList(String content); +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/ResourceLoaderFactory.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/ResourceLoaderFactory.java new file mode 100644 index 00000000..6a29b25c --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/ResourceLoaderFactory.java @@ -0,0 +1,33 @@ +package org.ruoyi.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import org.ruoyi.knowledge.chain.split.CharacterTextSplitter; +import org.ruoyi.knowledge.chain.split.CodeTextSplitter; +import org.ruoyi.knowledge.chain.split.MarkdownTextSplitter; +import org.ruoyi.knowledge.chain.split.TokenTextSplitter; +import org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/TextFileLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/TextFileLoader.java new file mode 100644 index 00000000..a2e74fa0 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/TextFileLoader.java @@ -0,0 +1,37 @@ +package org.ruoyi.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.ruoyi.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){ + return textSplitter.split(content); + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/WordLoader.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/WordLoader.java new file mode 100644 index 00000000..7b9d9200 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/loader/WordLoader.java @@ -0,0 +1,37 @@ +package org.ruoyi.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.ruoyi.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) { + return textSplitter.split(content); + } + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/retrieve/PromptRetrieverProperties.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/retrieve/PromptRetrieverProperties.java new file mode 100644 index 00000000..3b62c6b6 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/retrieve/PromptRetrieverProperties.java @@ -0,0 +1,16 @@ +package org.ruoyi.knowledge.chain.retrieve; + +import lombok.Data; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Data +@Component +public class PromptRetrieverProperties { + /** + * 从知识库中检索的条数,limits 应大于 num + */ + @Value("${chain.limits}") + private int limits; + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/CharacterTextSplitter.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/CharacterTextSplitter.java new file mode 100644 index 00000000..12db5139 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/CharacterTextSplitter.java @@ -0,0 +1,51 @@ +package org.ruoyi.knowledge.chain.split; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Component +@AllArgsConstructor +@Slf4j +@Primary +public class CharacterTextSplitter implements TextSplitter{ + private final SplitterProperties splitterProperties; + @Override + public List split(String content) { + List chunkList = new ArrayList<>(); + if (content.contains(splitterProperties.getEndspliter())){ + // 按自定义分隔符切分 + String[] chunks = content.split(splitterProperties.getEndspliter()); + 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*splitterProperties.getSize() - splitterProperties.getOverlay(); + if (begin < indexMin){ + begin = indexMin; + } + int end = splitterProperties.getSize()*(i+1) + splitterProperties.getOverlay(); + if (end > len){ + end = len; + } + String chunk = content.substring(begin,end); + chunkList.add(chunk); + i++; + right = right + splitterProperties.getSize(); + }else { + break; + } + } + } + return chunkList; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/CodeTextSplitter.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/CodeTextSplitter.java new file mode 100644 index 00000000..e68d61cc --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/CodeTextSplitter.java @@ -0,0 +1,17 @@ +package org.ruoyi.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) { + return null; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/MarkdownTextSplitter.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/MarkdownTextSplitter.java new file mode 100644 index 00000000..5c447813 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/MarkdownTextSplitter.java @@ -0,0 +1,17 @@ +package org.ruoyi.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) { + return null; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/SplitterProperties.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/SplitterProperties.java new file mode 100644 index 00000000..d0d9f5f0 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/SplitterProperties.java @@ -0,0 +1,30 @@ +package org.ruoyi.knowledge.chain.split; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Data +@Component +@ConfigurationProperties(prefix = "chain.split.chunk") +public class SplitterProperties { + /** + * 分段标识符 + */ + private String endspliter; + + /** + * 提问分段标识符 + */ + private String qaspliter; + + /** + * 分块文本大小 + */ + private int size; + + /** + * 相邻块之间重叠的字符数(避免边界信息丢失) + */ + private int overlay; +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/TextSplitter.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/TextSplitter.java new file mode 100644 index 00000000..5d3d71b5 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/TextSplitter.java @@ -0,0 +1,11 @@ +package org.ruoyi.knowledge.chain.split; + +import java.util.List; + +/** + * 文本切分 + */ +public interface TextSplitter { + + List split(String content); +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/TokenTextSplitter.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/TokenTextSplitter.java new file mode 100644 index 00000000..dedc631a --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/split/TokenTextSplitter.java @@ -0,0 +1,17 @@ +package org.ruoyi.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) { + return null; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/OpenAiVectorization.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/OpenAiVectorization.java new file mode 100644 index 00000000..2ac01435 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/OpenAiVectorization.java @@ -0,0 +1,60 @@ +package org.ruoyi.knowledge.chain.vectorizer; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.ruoyi.common.chat.config.ChatConfig; +import org.ruoyi.common.chat.entity.embeddings.Embedding; + +import org.ruoyi.common.chat.entity.embeddings.EmbeddingResponse; +import org.ruoyi.common.chat.openai.OpenAiStreamClient; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Component +@Slf4j +@RequiredArgsConstructor +public class OpenAiVectorization implements Vectorization { + + @Value("${chain.vector.model}") + private String embeddingModel; + + @Getter + private OpenAiStreamClient openAiStreamClient; + + private final ChatConfig chatConfig; + + @Override + public List> batchVectorization(List chunkList) { + openAiStreamClient = chatConfig.getOpenAiStreamClient(); + + Embedding embedding = Embedding.builder() + .input(chunkList) + .model(embeddingModel) + .build(); + EmbeddingResponse embeddings = openAiStreamClient.embeddings(embedding); + List> vectorList = new ArrayList<>(); + embeddings.getData().forEach(data -> { + List vector = data.getEmbedding(); + List doubleVector = new ArrayList<>(); + for (BigDecimal bd : vector) { + doubleVector.add(bd.doubleValue()); + } + vectorList.add(doubleVector); + }); + return vectorList; + } + + @Override + public List singleVectorization(String chunk) { + List chunkList = new ArrayList<>(); + chunkList.add(chunk); + List> vectorList = batchVectorization(chunkList); + return vectorList.get(0); + } + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/Vectorization.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/Vectorization.java new file mode 100644 index 00000000..c770a16c --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/Vectorization.java @@ -0,0 +1,11 @@ +package org.ruoyi.knowledge.chain.vectorizer; + +import java.util.List; + +/** + * 向量化 + */ +public interface Vectorization { + List> batchVectorization(List chunkList); + List singleVectorization(String chunk); +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/VectorizationFactory.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/VectorizationFactory.java new file mode 100644 index 00000000..05993ac6 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/VectorizationFactory.java @@ -0,0 +1,23 @@ +package org.ruoyi.knowledge.chain.vectorizer; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * 文本向量化 + * @author huangkh + */ +@Component +@Slf4j +public class VectorizationFactory { + + private final OpenAiVectorization openAiVectorization; + + public VectorizationFactory(OpenAiVectorization openAiVectorization) { + this.openAiVectorization = openAiVectorization; + } + + public Vectorization getEmbedding(){ + return openAiVectorization; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/VectorizationWrapper.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/VectorizationWrapper.java new file mode 100644 index 00000000..15221487 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorizer/VectorizationWrapper.java @@ -0,0 +1,28 @@ +package org.ruoyi.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) { + Vectorization embedding = vectorizationFactory.getEmbedding(); + return embedding.batchVectorization(chunkList); + } + + @Override + public List singleVectorization(String chunk) { + Vectorization embedding = vectorizationFactory.getEmbedding(); + return embedding.singleVectorization(chunk); + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/MilvusVectorStore.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/MilvusVectorStore.java new file mode 100644 index 00000000..74bef6fc --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/MilvusVectorStore.java @@ -0,0 +1,244 @@ +package org.ruoyi.knowledge.chain.vectorstore; + +import io.milvus.client.MilvusServiceClient; +import io.milvus.grpc.DataType; +import io.milvus.grpc.SearchResults; +import io.milvus.param.ConnectParam; +import io.milvus.param.IndexType; +import io.milvus.param.MetricType; +import io.milvus.param.R; +import io.milvus.param.collection.CreateCollectionParam; +import io.milvus.param.collection.DropCollectionParam; +import io.milvus.param.collection.FieldType; +import io.milvus.param.collection.LoadCollectionParam; +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.partition.CreatePartitionParam; +import io.milvus.response.QueryResultsWrapper; +import io.milvus.response.SearchResultsWrapper; +import jakarta.annotation.PostConstruct; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Service +@Slf4j +public class MilvusVectorStore implements VectorStore{ + + + @Value("${chain.vector.store.milvus.host}") + private String milvusHost; + @Value("${chain.vector.store.milvus.port}") + private Integer milvausPort; + + @Value("${chain.vector.store.milvus.dimension}") + private Integer dimension; + + @Value("${chain.vector.store.milvus.collection}") + private String collectionName; + + private MilvusServiceClient milvusServiceClient; + + @PostConstruct + public void init(){ + milvusServiceClient = new MilvusServiceClient( + ConnectParam.newBuilder() + .withHost(milvusHost) + .withPort(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) { + + if (StringUtils.isNotBlank(docId)){ + milvusServiceClient.createPartition( + CreatePartitionParam.newBuilder() + .withCollectionName(collectionName + kid) + .withPartitionName(docId) + .build() + ); + } + + List> vectorFloatList = new ArrayList<>(); + List kidList = new ArrayList<>(); + List docIdList = new ArrayList<>(); + for (int i = 0; i < chunkList.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(collectionName + kid) + .withPartitionName(docId) + .withFields(fields) + .build(); + milvusServiceClient.insert(insertParam); + // milvus在将数据装载到内存后才能进行向量计算 + milvusServiceClient.loadCollection(LoadCollectionParam.newBuilder().withCollectionName(collectionName + kid).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) { + 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(); + R respSearch = milvusServiceClient.search(searchParam); + SearchResultsWrapper wrapperSearch = new SearchResultsWrapper(respSearch.getData().getResults()); + List rowRecords = wrapperSearch.getRowRecords(); + + List resultList = new ArrayList<>(); + if (resultList!=null && resultList.size() > 0){ + for (int i = 0; i < rowRecords.size(); i++) { + String content = rowRecords.get(i).get("content").toString(); + resultList.add(content); + } + } + return resultList; + } + + /** + * milvus 不支持通过文本检索相似性 + * @param query + * @param kid + * @return + */ + @Override + public List nearest(String query, String kid) { + return null; + } + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStore.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStore.java new file mode 100644 index 00000000..6852cfd7 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStore.java @@ -0,0 +1,18 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStoreFactory.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStoreFactory.java new file mode 100644 index 00000000..34782296 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStoreFactory.java @@ -0,0 +1,31 @@ +package org.ruoyi.knowledge.chain.vectorstore; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class VectorStoreFactory { + + @Value("${chain.vector.store.type}") + private String type; + + private final WeaviateVectorStore weaviateVectorStore; + + private final MilvusVectorStore milvusVectorStore; + + public VectorStoreFactory(WeaviateVectorStore weaviateVectorStore, MilvusVectorStore milvusVectorStore) { + this.weaviateVectorStore = weaviateVectorStore; + this.milvusVectorStore = milvusVectorStore; + } + + public VectorStore getVectorStore(){ + if ("weaviate".equals(type)){ + return weaviateVectorStore; + }else if ("milvus".equals(type)){ + return milvusVectorStore; + } + return null; + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStoreWrapper.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStoreWrapper.java new file mode 100644 index 00000000..2c0a7325 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/VectorStoreWrapper.java @@ -0,0 +1,58 @@ +package org.ruoyi.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(); + vectorStore.storeEmbeddings(chunkList, vectorList, kid, docId, fidList); + } + + @Override + public void removeByDocId(String kid, String docId) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(); + vectorStore.removeByDocId(kid,docId); + } + + @Override + public void removeByKid(String kid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(); + vectorStore.removeByKid(kid); + } + + @Override + public List nearest(List queryVector, String kid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(); + return vectorStore.nearest(queryVector,kid); + } + + @Override + public List nearest(String query, String kid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(); + return vectorStore.nearest(query, kid); + } + + @Override + public void newSchema(String kid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(); + vectorStore.newSchema(kid); + } + + @Override + public void removeByKidAndFid(String kid, String fid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(); + vectorStore.removeByKidAndFid(kid, fid); + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/WeaviateVectorStore.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/WeaviateVectorStore.java new file mode 100644 index 00000000..335e4edb --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/chain/vectorstore/WeaviateVectorStore.java @@ -0,0 +1,372 @@ +package org.ruoyi.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 lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.ruoyi.knowledge.chain.retrieve.PromptRetrieverProperties; +import org.springframework.beans.factory.annotation.Value; +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{ + + @Value("${chain.vector.store.weaviate.protocol}") + private String protocol; + @Value("${chain.vector.store.weaviate.host}") + private String host; + + @Value("${chain.vector.store.weaviate.classname}") + private String className; + + private final PromptRetrieverProperties promptRetrieverProperties; + + public WeaviateVectorStore(PromptRetrieverProperties promptRetrieverProperties) { + this.promptRetrieverProperties = promptRetrieverProperties; + } + + 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 < chunkList.size(); i++) { + if (vectorList != null) { + List vector = vectorList.get(i); + Float[] vf = new Float[vector.size()]; + for (int j = 0; j < vector.size(); j++) { + Double value = vector.get(j); + vf[j] = value.floatValue(); + } + 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(true).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(); + Result result = client.graphQL().get() + .withClassName(className + kid) + .withFields(contentField,_additional) + .withNearVector(nearVector) + .withLimit(promptRetrieverProperties.getLimits()) + .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(); + + Result result = client.graphQL().get() + .withClassName(className + kid) + .withFields(contentField,_additional) + .withNearText(nearText) + .withLimit(promptRetrieverProperties.getLimits()) + .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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/constant/FileType.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/constant/FileType.java new file mode 100644 index 00000000..6a9451a6 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/constant/FileType.java @@ -0,0 +1,91 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeAttach.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeAttach.java new file mode 100644 index 00000000..059a5cb3 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeAttach.java @@ -0,0 +1,60 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeFragment.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeFragment.java new file mode 100644 index 00000000..1ef3208c --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeFragment.java @@ -0,0 +1,62 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeInfo.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeInfo.java new file mode 100644 index 00000000..0d9b51e3 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/KnowledgeInfo.java @@ -0,0 +1,63 @@ +package org.ruoyi.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; + + /** + * 描述 + */ + private String description; + + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeAttachBo.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeAttachBo.java new file mode 100644 index 00000000..497e7173 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeAttachBo.java @@ -0,0 +1,56 @@ +package org.ruoyi.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.ruoyi.common.mybatis.core.domain.BaseEntity; +import org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeFragmentBo.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeFragmentBo.java new file mode 100644 index 00000000..be6bca18 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeFragmentBo.java @@ -0,0 +1,59 @@ +package org.ruoyi.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.ruoyi.common.mybatis.core.domain.BaseEntity; +import org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeInfoBo.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeInfoBo.java new file mode 100644 index 00000000..bea7b25b --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/bo/KnowledgeInfoBo.java @@ -0,0 +1,53 @@ +package org.ruoyi.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.ruoyi.common.mybatis.core.domain.BaseEntity; +import org.ruoyi.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 description; + + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/req/KnowledgeInfoUploadRequest.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/req/KnowledgeInfoUploadRequest.java new file mode 100644 index 00000000..866119da --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/req/KnowledgeInfoUploadRequest.java @@ -0,0 +1,13 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/request.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/request.java new file mode 100644 index 00000000..9a84995a --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/request.java @@ -0,0 +1,4 @@ +package org.ruoyi.knowledge.domain; + +public class request { +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeAttachVo.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeAttachVo.java new file mode 100644 index 00000000..bd0b141f --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeAttachVo.java @@ -0,0 +1,63 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeFragmentVo.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeFragmentVo.java new file mode 100644 index 00000000..630bbe06 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeFragmentVo.java @@ -0,0 +1,62 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeInfoVo.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeInfoVo.java new file mode 100644 index 00000000..c541a823 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/domain/vo/KnowledgeInfoVo.java @@ -0,0 +1,57 @@ +package org.ruoyi.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.ruoyi.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; + + /** + * 描述 + */ + @ExcelProperty(value = "描述") + private String description; + + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeAttachMapper.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeAttachMapper.java new file mode 100644 index 00000000..ec7d2641 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeAttachMapper.java @@ -0,0 +1,15 @@ +package org.ruoyi.knowledge.mapper; + +import org.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; +import org.ruoyi.knowledge.domain.KnowledgeAttach; +import org.ruoyi.knowledge.domain.vo.KnowledgeAttachVo; + +/** + * 知识库附件Mapper接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface KnowledgeAttachMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeFragmentMapper.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeFragmentMapper.java new file mode 100644 index 00000000..92d9ccbc --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeFragmentMapper.java @@ -0,0 +1,15 @@ +package org.ruoyi.knowledge.mapper; + +import org.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; +import org.ruoyi.knowledge.domain.KnowledgeFragment; +import org.ruoyi.knowledge.domain.vo.KnowledgeFragmentVo; + +/** + * 知识片段Mapper接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface KnowledgeFragmentMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeInfoMapper.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeInfoMapper.java new file mode 100644 index 00000000..1984e0ae --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/mapper/KnowledgeInfoMapper.java @@ -0,0 +1,15 @@ +package org.ruoyi.knowledge.mapper; + +import org.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; +import org.ruoyi.knowledge.domain.KnowledgeInfo; +import org.ruoyi.knowledge.domain.vo.KnowledgeInfoVo; + +/** + * 知识库Mapper接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface KnowledgeInfoMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/EmbeddingService.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/EmbeddingService.java new file mode 100644 index 00000000..739c7e6a --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/EmbeddingService.java @@ -0,0 +1,20 @@ +package org.ruoyi.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); + + void createSchema(String kid); + + void removeByKidAndFid(String kid, String fid); + + void saveFragment(String kid, String docId, String fid, String content); +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeAttachService.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeAttachService.java new file mode 100644 index 00000000..04698880 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeAttachService.java @@ -0,0 +1,56 @@ +package org.ruoyi.knowledge.service; + +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.knowledge.domain.bo.KnowledgeAttachBo; +import org.ruoyi.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); + + + /** + * 删除知识附件 + * + * @return + */ + void removeKnowledgeAttach(String kid); +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeFragmentService.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeFragmentService.java new file mode 100644 index 00000000..7546a1d5 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeFragmentService.java @@ -0,0 +1,48 @@ +package org.ruoyi.knowledge.service; + +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.knowledge.domain.bo.KnowledgeFragmentBo; +import org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeInfoService.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeInfoService.java new file mode 100644 index 00000000..0c1b0909 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/IKnowledgeInfoService.java @@ -0,0 +1,58 @@ +package org.ruoyi.knowledge.service; + +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.knowledge.domain.KnowledgeAttach; +import org.ruoyi.knowledge.domain.bo.KnowledgeAttachBo; +import org.ruoyi.knowledge.domain.bo.KnowledgeInfoBo; +import org.ruoyi.knowledge.domain.req.KnowledgeInfoUploadRequest; +import org.ruoyi.knowledge.domain.vo.KnowledgeInfoVo; + +import java.util.Collection; +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); +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/EmbeddingServiceImpl.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/EmbeddingServiceImpl.java new file mode 100644 index 00000000..8850311f --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/EmbeddingServiceImpl.java @@ -0,0 +1,65 @@ +package org.ruoyi.knowledge.service.impl; + +import lombok.AllArgsConstructor; +import org.ruoyi.knowledge.chain.vectorizer.Vectorization; +import org.ruoyi.knowledge.chain.vectorstore.VectorStore; +import org.ruoyi.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); + 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) { + List queryVector = vectorization.singleVectorization(query); + return queryVector; + } + + @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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeAttachServiceImpl.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeAttachServiceImpl.java new file mode 100644 index 00000000..07812d48 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeAttachServiceImpl.java @@ -0,0 +1,125 @@ +package org.ruoyi.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.ruoyi.common.core.utils.MapstructUtils; +import org.ruoyi.common.core.utils.StringUtils; +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.knowledge.domain.KnowledgeAttach; +import org.ruoyi.knowledge.domain.bo.KnowledgeAttachBo; +import org.ruoyi.knowledge.domain.vo.KnowledgeAttachVo; +import org.ruoyi.knowledge.mapper.KnowledgeAttachMapper; +import org.ruoyi.knowledge.mapper.KnowledgeFragmentMapper; +import org.ruoyi.knowledge.service.IKnowledgeAttachService; +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; + + /** + * 查询知识库附件 + */ + @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 kid) { + HashMap map = new HashMap<>(); + map.put("kid", kid); + baseMapper.deleteByMap(map); + fragmentMapper.deleteByMap(map); + } +} diff --git a/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeFragmentServiceImpl.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeFragmentServiceImpl.java new file mode 100644 index 00000000..ff6efcc7 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeFragmentServiceImpl.java @@ -0,0 +1,113 @@ +package org.ruoyi.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.ruoyi.common.core.utils.MapstructUtils; +import org.ruoyi.common.core.utils.StringUtils; +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.knowledge.domain.KnowledgeFragment; +import org.ruoyi.knowledge.domain.bo.KnowledgeFragmentBo; +import org.ruoyi.knowledge.domain.vo.KnowledgeFragmentVo; +import org.ruoyi.knowledge.mapper.KnowledgeFragmentMapper; +import org.ruoyi.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/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeInfoServiceImpl.java b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeInfoServiceImpl.java new file mode 100644 index 00000000..0f2b8421 --- /dev/null +++ b/ruoyi-modules/ruoyi-knowledge/src/main/java/org/ruoyi/knowledge/service/impl/KnowledgeInfoServiceImpl.java @@ -0,0 +1,218 @@ +package org.ruoyi.knowledge.service.impl; + +import cn.hutool.core.util.RandomUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import io.github.ollama4j.OllamaAPI; +import io.github.ollama4j.exceptions.OllamaBaseException; +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.chat.OllamaChatResult; +import lombok.RequiredArgsConstructor; +import org.ruoyi.common.core.utils.MapstructUtils; +import org.ruoyi.common.core.utils.StringUtils; +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.common.satoken.utils.LoginHelper; +import org.ruoyi.knowledge.chain.loader.ResourceLoader; +import org.ruoyi.knowledge.chain.loader.ResourceLoaderFactory; +import org.ruoyi.knowledge.domain.KnowledgeAttach; +import org.ruoyi.knowledge.domain.KnowledgeFragment; +import org.ruoyi.knowledge.domain.KnowledgeInfo; +import org.ruoyi.knowledge.domain.bo.KnowledgeAttachBo; +import org.ruoyi.knowledge.domain.bo.KnowledgeFragmentBo; +import org.ruoyi.knowledge.domain.bo.KnowledgeInfoBo; +import org.ruoyi.knowledge.domain.req.KnowledgeInfoUploadRequest; +import org.ruoyi.knowledge.domain.vo.KnowledgeInfoVo; +import org.ruoyi.knowledge.mapper.KnowledgeAttachMapper; +import org.ruoyi.knowledge.mapper.KnowledgeFragmentMapper; +import org.ruoyi.knowledge.mapper.KnowledgeInfoMapper; +import org.ruoyi.knowledge.service.EmbeddingService; +import org.ruoyi.knowledge.service.IKnowledgeAttachService; +import org.ruoyi.knowledge.service.IKnowledgeFragmentService; +import org.ruoyi.knowledge.service.IKnowledgeInfoService; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.*; + +/** + * 知识库Service业务层处理 + * + * @author Lion Li + * @date 2024-10-21 + */ +@RequiredArgsConstructor +@Service +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) { + Map params = bo.getParams(); + 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()); + 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 + 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(kid); + }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); + 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()); + fragmentMapper.insert(knowledgeFragment); + } + } catch (IOException e) { + e.printStackTrace(); + } + knowledgeAttach.setContent(content); + knowledgeAttach.setCreateTime(new Date()); + attachMapper.insert(knowledgeAttach); + embeddingService.storeEmbeddings(chunkList,kid,docId,fids); + } + + @Override + public void removeKnowledge(String id) { + + Map map = new HashMap<>(); + map.put("kid",id); + // 删除知识库 + baseMapper.deleteByMap(map); + // 删除附件和知识片段 + fragmentMapper.deleteByMap(map); + attachMapper.deleteByMap(map); + // 删除向量库信息 + embeddingService.removeByKid(id); + } + + /** + * 将文本块转换为预训练数据 + * @param chunk 解析文本块 + */ + public String convertTextBlockToPretrainData(String chunk){ + String host = "http://localhost:11434/"; + OllamaAPI ollama = new OllamaAPI(host); + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance("qwen2.5:7b"); + // 设置超时时间 + ollama.setRequestTimeoutSeconds(100); + // create first user question + String json = "instruction:用户指令,根据语义提取一个关键词;input:用户输入,根据语义提取多个关键词;output:输出文本内容"; + + OllamaChatRequestModel requestModel = builder.withMessage + (OllamaChatMessageRole.USER, "文本:"+chunk+"理解文本内容,并且将文本内容转换为:"+json+",输出JSON格式,不要包含其他无关内容,内部使用无需脱敏") + .build(); + + // start conversation with model + OllamaChatResult chatResult = null; + try { + chatResult = ollama.chat(requestModel); + } catch (Exception e) { + System.out.println("解析失败!"); + } + return chatResult.getResponse(); + } + +} diff --git a/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/pom.xml new file mode 100644 index 00000000..76af3458 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/constant/Constants.java b/ruoyi-modules/ruoyi-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 00000000..faf4a699 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/exception/BaseException.java b/ruoyi-modules/ruoyi-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 00000000..71248e7e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IBaseConnectionListener.java b/ruoyi-modules/ruoyi-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 00000000..4398cf9b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IBaseMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..7230d9dd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IDanmuMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..52b8dac1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IEnterRoomMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..931f35f8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IGiftMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..f486b961 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/ILikeMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..42cc886a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/ISuperChatMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..1a70b60a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/BaseCmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..734c4b6b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/BaseMsg.java b/ruoyi-modules/ruoyi-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 00000000..2135fa49 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ICmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..7a0b2cf1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IDanmuMsg.java b/ruoyi-modules/ruoyi-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 00000000..7a4745c7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IEnterRoomMsg.java b/ruoyi-modules/ruoyi-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 00000000..a914e63f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IGiftMsg.java b/ruoyi-modules/ruoyi-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 00000000..9b8d35d7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ILikeMsg.java b/ruoyi-modules/ruoyi-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 00000000..c10fe97b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IMsg.java b/ruoyi-modules/ruoyi-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 00000000..c02a3367 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ISuperChatMsg.java b/ruoyi-modules/ruoyi-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 00000000..58c94916 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-client/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-client/pom.xml new file mode 100644 index 00000000..f25c8226 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/BaseLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..f442b9c8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/IBaseLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..951b4bca --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/config/BaseLiveChatClientConfig.java b/ruoyi-modules/ruoyi-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 00000000..1fee0f74 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/enums/ClientStatusEnums.java b/ruoyi-modules/ruoyi-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 00000000..29d2c753 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-util/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-util/pom.xml new file mode 100644 index 00000000..190ca516 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatCookieUtil.java b/ruoyi-modules/ruoyi-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 00000000..9ec118fc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatNumberUtil.java b/ruoyi-modules/ruoyi-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 00000000..969cf003 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatReflectUtil.java b/ruoyi-modules/ruoyi-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 00000000..a4d8a5dd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLocalDateTimeUtil.java b/ruoyi-modules/ruoyi-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 00000000..b09cdedd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-commons/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-client-commons/pom.xml new file mode 100644 index 00000000..3324cb80 --- /dev/null +++ b/ruoyi-modules/ruoyi-live/live-chat-client-commons/pom.xml @@ -0,0 +1,44 @@ + + + + 4.0.0 + + org.ruoyi + ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-servers/live-chat-client-servers-netty-client/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-client-servers/live-chat-client-servers-netty-client/pom.xml new file mode 100644 index 00000000..9ea335d6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..c342b5bc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..c0ebf52b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..278ce3f4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..a9903f17 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-servers/live-chat-client-servers-netty/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-client-servers/live-chat-client-servers-netty/pom.xml new file mode 100644 index 00000000..1e4259a9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..984960a0 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..c7a683f3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..724dca41 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-client-servers/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-client-servers/pom.xml new file mode 100644 index 00000000..eb12c8ac --- /dev/null +++ b/ruoyi-modules/ruoyi-live/live-chat-client-servers/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.ruoyi + ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/pom.xml new file mode 100644 index 00000000..dcd4706d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/BilibiliApis.java b/ruoyi-modules/ruoyi-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 00000000..5fd081e8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/request/BilibiliLikeReportV3Request.java b/ruoyi-modules/ruoyi-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 00000000..5979d891 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/request/BilibiliSendMsgRequest.java b/ruoyi-modules/ruoyi-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 00000000..eca8d7b8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/client/BilibiliLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..6bca3870 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/config/BilibiliLiveChatClientConfig.java b/ruoyi-modules/ruoyi-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 00000000..0f0b3b9d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/BilibiliCmdEnum.java b/ruoyi-modules/ruoyi-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 00000000..1b6edbc5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/OperationEnum.java b/ruoyi-modules/ruoyi-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 00000000..296abc31 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/ProtoverEnum.java b/ruoyi-modules/ruoyi-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 00000000..bee3f2a7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/listener/IBilibiliConnectionListener.java b/ruoyi-modules/ruoyi-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 00000000..74248b1c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/listener/IBilibiliMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..bb62956b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/AuthMsg.java b/ruoyi-modules/ruoyi-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 00000000..6a30d3b3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/AuthReplyMsg.java b/ruoyi-modules/ruoyi-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 00000000..5bb76ea1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/DanmuMsgMsg.java b/ruoyi-modules/ruoyi-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 00000000..8bf093c6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/HeartbeatMsg.java b/ruoyi-modules/ruoyi-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 00000000..dff52fc0 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/HeartbeatReplyMsg.java b/ruoyi-modules/ruoyi-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 00000000..535aadd1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/InteractWordMsg.java b/ruoyi-modules/ruoyi-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 00000000..8ef298a8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/LikeInfoV3ClickMsg.java b/ruoyi-modules/ruoyi-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 00000000..191aab2a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SendGiftMsg.java b/ruoyi-modules/ruoyi-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 00000000..8879c8c5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SendSmsReplyMsg.java b/ruoyi-modules/ruoyi-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 00000000..ae2c52d9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SuperChatMessageMsg.java b/ruoyi-modules/ruoyi-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 00000000..1842b78c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/BaseBilibiliCmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..5dd624f4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/BaseBilibiliMsg.java b/ruoyi-modules/ruoyi-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 00000000..16ca652d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/IBilibiliMsg.java b/ruoyi-modules/ruoyi-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 00000000..ff12eedf --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/dto/MedalInfo.java b/ruoyi-modules/ruoyi-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 00000000..15cd17a3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/AuthWebSocketFrame.java b/ruoyi-modules/ruoyi-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 00000000..c6436e28 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/HeartbeatWebSocketFrame.java b/ruoyi-modules/ruoyi-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 00000000..f2abecfc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/base/BaseBilibiliWebSocketFrame.java b/ruoyi-modules/ruoyi-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 00000000..a3556f6c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/factory/BilibiliWebSocketFrameFactory.java b/ruoyi-modules/ruoyi-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 00000000..63e62d75 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/handler/BilibiliBinaryFrameHandler.java b/ruoyi-modules/ruoyi-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 00000000..d79efd03 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/handler/BilibiliConnectionHandler.java b/ruoyi-modules/ruoyi-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 00000000..8bd886ec --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/Dm_v2Proto.java b/ruoyi-modules/ruoyi-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 00000000..5666f45a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/Dm_v2_20Proto.java b/ruoyi-modules/ruoyi-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 00000000..fab53e09 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2.java b/ruoyi-modules/ruoyi-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 00000000..97292775 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2OrBuilder.java b/ruoyi-modules/ruoyi-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 00000000..f219e9e3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2_20.java b/ruoyi-modules/ruoyi-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 00000000..a10e7d3e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2_20OrBuilder.java b/ruoyi-modules/ruoyi-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 00000000..d6345678 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/util/BilibiliCodecUtil.java b/ruoyi-modules/ruoyi-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 00000000..9841cae7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2.proto new file mode 100644 index 00000000..53bf69c4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2_20.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2_20.proto new file mode 100644 index 00000000..3cb87799 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/test/java/tech/ordinaryroad/live/chat/client/bilibili/api/BilibiliApisTest.java b/ruoyi-modules/ruoyi-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 00000000..f602e368 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-bilibili/src/test/java/tech/ordinaryroad/live/chat/client/bilibili/client/BilibiliLiveChatClientTest.java b/ruoyi-modules/ruoyi-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 00000000..1d3f6ca3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/pom.xml new file mode 100644 index 00000000..a3690f87 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/ClientModeExample.java b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/ClientModeExample.java new file mode 100644 index 00000000..c2c8678b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/api/DouyinApis.java b/ruoyi-modules/ruoyi-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 00000000..d361e3a1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/client/DouyinLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..47767a1c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/config/DouyinLiveChatClientConfig.java b/ruoyi-modules/ruoyi-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 00000000..6958bb0c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/constant/DouyinCmdEnum.java b/ruoyi-modules/ruoyi-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 00000000..d7335cde --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/listener/IDouyinConnectionListener.java b/ruoyi-modules/ruoyi-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 00000000..9be4cea7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/listener/IDouyinMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..8f1c86ff --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinDanmuMsg.java b/ruoyi-modules/ruoyi-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 00000000..32bb5301 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinEnterRoomMsg.java b/ruoyi-modules/ruoyi-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 00000000..6c394f56 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinGiftMsg.java b/ruoyi-modules/ruoyi-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 00000000..0bd35354 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinLikeMsg.java b/ruoyi-modules/ruoyi-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 00000000..ce029979 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/base/IDouyinCmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..aa264a16 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/base/IDouyinMsg.java b/ruoyi-modules/ruoyi-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 00000000..6dc10954 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/netty/handler/DouyinBinaryFrameHandler.java b/ruoyi-modules/ruoyi-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 00000000..bddf8de0 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/netty/handler/DouyinConnectionHandler.java b/ruoyi-modules/ruoyi-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 00000000..1b9c6f8f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_cmd_msgProto.java b/ruoyi-modules/ruoyi-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 00000000..f5ed4b41 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..4e5a46d7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..69ed4f92 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..ccdb0088 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_websocket_frameProto.java b/ruoyi-modules/ruoyi-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 00000000..620d99e3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_cmd_msg.java b/ruoyi-modules/ruoyi-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 00000000..44f8e78b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_cmd_msgOrBuilder.java b/ruoyi-modules/ruoyi-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 00000000..ed0175d5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..ae1a4d49 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..961938ed --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..d4098dd6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..48301993 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..8e79778c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..b5b088a5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..153557b6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..63c75d62 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-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 00000000..52d111be --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame.java b/ruoyi-modules/ruoyi-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 00000000..8caffe8a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frameOrBuilder.java b/ruoyi-modules/ruoyi-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 00000000..9bf36f73 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msg.java b/ruoyi-modules/ruoyi-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 00000000..5037b9fe --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msgOrBuilder.java b/ruoyi-modules/ruoyi-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 00000000..e90332f8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msgProto.java b/ruoyi-modules/ruoyi-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 00000000..607d3eda --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/CommonOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..17c17c41 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/DoubleLikeDetailOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..20a7381c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/GiftIMPriorityOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..79765e30 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/GiftStructOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..e4e15b38 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/ImageOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..4a30d6e7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/PatternRefOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..378b1fcd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/PublicAreaCommonOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..6585a114 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextEffectDetailOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..9e29e90a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextEffectOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..9fffc74a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextFormatOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..d3fc3455 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..4ff0f8d6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceGiftOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..7e8d34f2 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceHeartOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..7e4c99c7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceImageOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..8d3adcb3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..3eecce98 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPiecePatternRefOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..1a928e54 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceUserOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..2d0fc474 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/UserOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..e8d3b539 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Common.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Common.proto new file mode 100644 index 00000000..a09a395b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/DoubleLikeDetail.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/DoubleLikeDetail.proto new file mode 100644 index 00000000..de0b28a5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftIMPriority.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftIMPriority.proto new file mode 100644 index 00000000..3b8db33a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftStruct.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftStruct.proto new file mode 100644 index 00000000..3031acca --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Image.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Image.proto new file mode 100644 index 00000000..1f487296 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PatternRef.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PatternRef.proto new file mode 100644 index 00000000..5caa0e47 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PublicAreaCommon.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PublicAreaCommon.proto new file mode 100644 index 00000000..01358fd1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Text.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Text.proto new file mode 100644 index 00000000..60f985cf --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffect.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffect.proto new file mode 100644 index 00000000..662e1682 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffectDetail.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffectDetail.proto new file mode 100644 index 00000000..6d1146a4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextFormat.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextFormat.proto new file mode 100644 index 00000000..8ca8ab55 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiece.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiece.proto new file mode 100644 index 00000000..e76d1ce4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceGift.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceGift.proto new file mode 100644 index 00000000..5ed59e23 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceHeart.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceHeart.proto new file mode 100644 index 00000000..6528fd14 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceImage.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceImage.proto new file mode 100644 index 00000000..6f507145 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiecePatternRef.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiecePatternRef.proto new file mode 100644 index 00000000..c3a51aa9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceUser.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceUser.proto new file mode 100644 index 00000000..c46ae9ad --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/User.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/User.proto new file mode 100644 index 00000000..4a296841 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_cmd_msg.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_cmd_msg.proto new file mode 100644 index 00000000..41a71eb4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_chat_message_msg.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_chat_message_msg.proto new file mode 100644 index 00000000..4866a3b4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_gift_message_msg.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_gift_message_msg.proto new file mode 100644 index 00000000..fcd1d786 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_like_message_msg.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_like_message_msg.proto new file mode 100644 index 00000000..2a617397 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_member_message_msg.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_member_message_msg.proto new file mode 100644 index 00000000..f892a74c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame.proto new file mode 100644 index 00000000..fe01e9ab --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame_msg.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame_msg.proto new file mode 100644 index 00000000..808bb2fb --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/test/java/tech/ordinaryroad/live/chat/client/douyin/api/DouyinApisTest.java b/ruoyi-modules/ruoyi-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 00000000..fe217bcc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyin/src/test/java/tech/ordinaryroad/live/chat/client/douyin/client/DouyinLiveChatClientTest.java b/ruoyi-modules/ruoyi-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 00000000..a80ec93d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/README.md b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/README.md new file mode 100644 index 00000000..0b71bda0 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/pom.xml new file mode 100644 index 00000000..d051f935 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/api/DouyuApis.java b/ruoyi-modules/ruoyi-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 00000000..32c53664 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuDanmuLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..a780acaf --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..4e183a14 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuWsLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..e6d50621 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/base/BaseDouyuLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..799eab2f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/config/DouyuLiveChatClientConfig.java b/ruoyi-modules/ruoyi-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 00000000..685cd8d5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/constant/DouyuClientModeEnum.java b/ruoyi-modules/ruoyi-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 00000000..dbdc8b22 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/constant/DouyuCmdEnum.java b/ruoyi-modules/ruoyi-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 00000000..9078fcda --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/listener/IDouyuConnectionListener.java b/ruoyi-modules/ruoyi-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 00000000..cc3d33da --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/listener/IDouyuMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..782c884e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/ChatmessageMsg.java b/ruoyi-modules/ruoyi-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 00000000..1e801cee --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/ChatmsgMsg.java b/ruoyi-modules/ruoyi-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 00000000..052954e3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/DgbMsg.java b/ruoyi-modules/ruoyi-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 00000000..a8c54164 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/DouyuCmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..dcef8803 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5ckreqMsg.java b/ruoyi-modules/ruoyi-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 00000000..3736591c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5csMsg.java b/ruoyi-modules/ruoyi-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 00000000..29b0957a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5gkcreqMsg.java b/ruoyi-modules/ruoyi-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 00000000..7e5a8b9f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/HeartbeatMsg.java b/ruoyi-modules/ruoyi-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 00000000..934e9531 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/HeartbeatReplyMsg.java b/ruoyi-modules/ruoyi-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 00000000..37eaa904 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/JoingroupMsg.java b/ruoyi-modules/ruoyi-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 00000000..9d2694f2 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/KeepliveMsg.java b/ruoyi-modules/ruoyi-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 00000000..e7a0ff39 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/LoginreqMsg.java b/ruoyi-modules/ruoyi-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 00000000..f180e8ce --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/LoginresMsg.java b/ruoyi-modules/ruoyi-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 00000000..8db0f3cc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/MapkbMsg.java b/ruoyi-modules/ruoyi-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 00000000..e81b7649 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/MsgrepeaterproxylistMsg.java b/ruoyi-modules/ruoyi-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 00000000..0bfdb5f2 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/SubMsg.java b/ruoyi-modules/ruoyi-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 00000000..c642c28f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/UenterMsg.java b/ruoyi-modules/ruoyi-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 00000000..91b6b2e4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/base/BaseDouyuCmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..90e7478e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/base/IDouyuMsg.java b/ruoyi-modules/ruoyi-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 00000000..dac7d08d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftListInfo.java b/ruoyi-modules/ruoyi-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 00000000..03f2ee3e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftPropInfo.java b/ruoyi-modules/ruoyi-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 00000000..64e3e28f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftPropSingle.java b/ruoyi-modules/ruoyi-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 00000000..de9ebe67 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/AuthWebSocketFrame.java b/ruoyi-modules/ruoyi-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 00000000..6293b94e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/HeartbeatWebSocketFrame.java b/ruoyi-modules/ruoyi-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 00000000..1dd882eb --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/KeepliveWebSocketFrame.java b/ruoyi-modules/ruoyi-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 00000000..43e88af2 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/base/BaseDouyuWebSocketFrame.java b/ruoyi-modules/ruoyi-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 00000000..da484fed --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/factory/DouyuWebSocketFrameFactory.java b/ruoyi-modules/ruoyi-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 00000000..64bf90b0 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/handler/DouyuBinaryFrameHandler.java b/ruoyi-modules/ruoyi-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 00000000..f7d3e551 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/handler/DouyuConnectionHandler.java b/ruoyi-modules/ruoyi-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 00000000..e878c2b7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/util/DouyuCodecUtil.java b/ruoyi-modules/ruoyi-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 00000000..dad8a581 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/api/DouyuApisTest.java b/ruoyi-modules/ruoyi-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 00000000..cf828401 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatChoice.java b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatChoice.java similarity index 92% rename from ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatChoice.java rename to ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatChoice.java index b3a1644a..7919ad15 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatChoice.java +++ b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatChoice.java @@ -1,4 +1,4 @@ -package com.xmzs.common.chat.entity.chat; +package tech.ordinaryroad.live.chat.client.douyu.client; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletionResponse.java b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatCompletionResponse.java similarity index 84% rename from ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletionResponse.java rename to ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatCompletionResponse.java index 170e74dd..3134d4ee 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/ChatCompletionResponse.java +++ b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatCompletionResponse.java @@ -1,10 +1,8 @@ -package com.xmzs.common.chat.entity.chat; +package tech.ordinaryroad.live.chat.client.douyu.client; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.xmzs.common.chat.entity.common.Usage; import lombok.Data; - import java.io.Serializable; import java.util.List; diff --git a/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuLiveChatClientTest.java b/ruoyi-modules/ruoyi-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 00000000..56cc6d0e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Message.java b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Message.java similarity index 77% rename from ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Message.java rename to ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Message.java index 3738ebba..7ab7d80b 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/chat/Message.java +++ b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Message.java @@ -1,14 +1,12 @@ -package com.xmzs.common.chat.entity.chat; +package tech.ordinaryroad.live.chat.client.douyu.client; 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 java.io.Serializable; -import java.util.List; /** * 描述: @@ -31,9 +29,6 @@ public class Message implements Serializable { private String name; - @JsonProperty("function_call") - private FunctionCall functionCall; - public static Builder builder() { return new Builder(); } @@ -44,13 +39,11 @@ public class Message implements Serializable { * @param role 角色 * @param content 描述主题信息 * @param name name - * @param functionCall functionCall */ - public Message(String role, String content, String name, FunctionCall functionCall) { + public Message(String role, String content, String name) { this.role = role; this.content = content; this.name = name; - this.functionCall = functionCall; } public Message() { @@ -60,7 +53,6 @@ public class Message implements Serializable { setRole(builder.role); setContent(builder.content); setName(builder.name); - setFunctionCall(builder.functionCall); } @@ -80,7 +72,6 @@ public class Message implements Serializable { private String role; private String content; private String name; - private FunctionCall functionCall; public Builder() { } @@ -105,10 +96,6 @@ public class Message implements Serializable { return this; } - public Builder functionCall(FunctionCall functionCall) { - this.functionCall = functionCall; - return this; - } public Message build() { return new Message(this); diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/Usage.java b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Usage.java similarity index 90% rename from ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/Usage.java rename to ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Usage.java index 9802aa76..5595bc08 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/com/xmzs/common/chat/entity/common/Usage.java +++ b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Usage.java @@ -1,4 +1,4 @@ -package com.xmzs.common.chat.entity.common; +package tech.ordinaryroad.live.chat.client.douyu.client; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/util/DouyuCodecUtilTest.java b/ruoyi-modules/ruoyi-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 00000000..b4d72604 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/pom.xml new file mode 100644 index 00000000..ff7529a5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/api/HuyaApis.java b/ruoyi-modules/ruoyi-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 00000000..bd891301 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/client/HuyaLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..ecad0b3c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/config/HuyaLiveChatClientConfig.java b/ruoyi-modules/ruoyi-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 00000000..176bc74d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaClientTemplateTypeEnum.java b/ruoyi-modules/ruoyi-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 00000000..48ddedfc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaCmdEnum.java b/ruoyi-modules/ruoyi-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 00000000..e47b2c26 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaDecorationAppTypeEnum.java b/ruoyi-modules/ruoyi-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 00000000..834af679 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaDecorationViewTypeEnum.java b/ruoyi-modules/ruoyi-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 00000000..3e1318bd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaGenderEnum.java b/ruoyi-modules/ruoyi-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 00000000..830c6f46 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaLiveSource.java b/ruoyi-modules/ruoyi-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 00000000..ce93ab6a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaOperationEnum.java b/ruoyi-modules/ruoyi-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 00000000..dca59798 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaStreamLineTypeEnum.java b/ruoyi-modules/ruoyi-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 00000000..3696532e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaWupFunctionEnum.java b/ruoyi-modules/ruoyi-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 00000000..c7e9906e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/listener/IHuyaConnectionListener.java b/ruoyi-modules/ruoyi-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 00000000..caa46741 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/listener/IHuyaMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..48e656db --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/BaseWup.java b/ruoyi-modules/ruoyi-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 00000000..9a924f36 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/ConnectParaInfo.java b/ruoyi-modules/ruoyi-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 00000000..75e55e6f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/LiveLaunchRsp.java b/ruoyi-modules/ruoyi-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 00000000..71ed2cc9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/MessageNoticeMsg.java b/ruoyi-modules/ruoyi-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 00000000..a0178e5a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/PushMessage.java b/ruoyi-modules/ruoyi-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 00000000..9008d882 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/PushMessage_V2.java b/ruoyi-modules/ruoyi-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 00000000..a9aa3b16 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/RegisterGroupRsp.java b/ruoyi-modules/ruoyi-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 00000000..1060ae58 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/RegisterRsp.java b/ruoyi-modules/ruoyi-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 00000000..20ab1b03 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/SendItemSubBroadcastPacketMsg.java b/ruoyi-modules/ruoyi-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 00000000..0fd03757 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/UserInfo.java b/ruoyi-modules/ruoyi-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 00000000..b8ef2ab3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/VerifyCookieRsp.java b/ruoyi-modules/ruoyi-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 00000000..c080d6e6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/VipEnterBannerMsg.java b/ruoyi-modules/ruoyi-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 00000000..7fbfe949 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/WebSocketCommand.java b/ruoyi-modules/ruoyi-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 00000000..6c71ae5b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/WupRsp.java b/ruoyi-modules/ruoyi-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 00000000..443866c5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/BaseHuyaCmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..2b5c1cff --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/BaseHuyaMsg.java b/ruoyi-modules/ruoyi-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 00000000..b0dd169f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/IHuyaCmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..41ab6e20 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/IHuyaMsg.java b/ruoyi-modules/ruoyi-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 00000000..0fc8aa0e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ACEnterBanner.java b/ruoyi-modules/ruoyi-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 00000000..e9076757 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BadgeInfo.java b/ruoyi-modules/ruoyi-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 00000000..e9233b0b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BulletBorderGroundFormat.java b/ruoyi-modules/ruoyi-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 00000000..61fabb2f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BulletFormat.java b/ruoyi-modules/ruoyi-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 00000000..5f81da9f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ChannelPair.java b/ruoyi-modules/ruoyi-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 00000000..4bb796a8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/CommEnterBanner.java b/ruoyi-modules/ruoyi-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 00000000..900178d4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ContentFormat.java b/ruoyi-modules/ruoyi-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 00000000..594baf1c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/CustomBadgeDynamicExternal.java b/ruoyi-modules/ruoyi-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 00000000..bb8d5aae --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DIYBigGiftEffect.java b/ruoyi-modules/ruoyi-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 00000000..b93da5ab --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DecorationInfo.java b/ruoyi-modules/ruoyi-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 00000000..747518db --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DecorationInfoRsp.java b/ruoyi-modules/ruoyi-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 00000000..9c93cc42 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DeviceInfo.java b/ruoyi-modules/ruoyi-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 00000000..8e8d93b0 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DisplayInfo.java b/ruoyi-modules/ruoyi-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 00000000..1a23b3f8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/FaithInfo.java b/ruoyi-modules/ruoyi-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 00000000..1faa752e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/FaithPresenter.java b/ruoyi-modules/ruoyi-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 00000000..ad78b3db --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/GuardInfo.java b/ruoyi-modules/ruoyi-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 00000000..badff469 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ItemEffectInfo.java b/ruoyi-modules/ruoyi-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 00000000..4a4478ff --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveAppUAEx.java b/ruoyi-modules/ruoyi-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 00000000..b7b9b839 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveProxyValue.java b/ruoyi-modules/ruoyi-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 00000000..619eb18a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveUserbase.java b/ruoyi-modules/ruoyi-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 00000000..b6595a2d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MessageContentExpand.java b/ruoyi-modules/ruoyi-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 00000000..4afd6c58 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MessageTagInfo.java b/ruoyi-modules/ruoyi-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 00000000..bb8c0e72 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MsgItem.java b/ruoyi-modules/ruoyi-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 00000000..22f85aa4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MsgStatInfo.java b/ruoyi-modules/ruoyi-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 00000000..d4d229ed --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleInfo.java b/ruoyi-modules/ruoyi-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 00000000..db8adc1f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleLevelAttr.java b/ruoyi-modules/ruoyi-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 00000000..e9199afe --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleLevelInfo.java b/ruoyi-modules/ruoyi-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 00000000..0555b658 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NoblePetAttr.java b/ruoyi-modules/ruoyi-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 00000000..a9d26187 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PresenterChannelInfo.java b/ruoyi-modules/ruoyi-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 00000000..0204bcab --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropView.java b/ruoyi-modules/ruoyi-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 00000000..d017b796 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropsIdentity.java b/ruoyi-modules/ruoyi-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 00000000..ee1dba6a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropsItem.java b/ruoyi-modules/ruoyi-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 00000000..0c53ad40 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SendMessageFormat.java b/ruoyi-modules/ruoyi-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 00000000..a35a6863 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SenderInfo.java b/ruoyi-modules/ruoyi-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 00000000..79ef4a58 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SpecialInfo.java b/ruoyi-modules/ruoyi-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 00000000..055914c3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SuperFansInfo.java b/ruoyi-modules/ruoyi-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 00000000..cd1bd7af --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UidNickName.java b/ruoyi-modules/ruoyi-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 00000000..8f36cc1f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserId.java b/ruoyi-modules/ruoyi-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 00000000..56faee89 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserIdentityInfo.java b/ruoyi-modules/ruoyi-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 00000000..813943d9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserRidePetInfo.java b/ruoyi-modules/ruoyi-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 00000000..f74bb5a9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/WeekRankInfo.java b/ruoyi-modules/ruoyi-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 00000000..501273d6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetLivingInfoReq.java b/ruoyi-modules/ruoyi-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 00000000..81a7b3cb --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetPropsListReq.java b/ruoyi-modules/ruoyi-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 00000000..e619dc3d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetPropsListRsp.java b/ruoyi-modules/ruoyi-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 00000000..afc55ed9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/LaunchReq.java b/ruoyi-modules/ruoyi-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 00000000..eaad9830 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/LiveLaunchReq.java b/ruoyi-modules/ruoyi-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 00000000..1c4ccd89 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/RegisterGroupReq.java b/ruoyi-modules/ruoyi-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 00000000..bcb5b24f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/SendMessageReq.java b/ruoyi-modules/ruoyi-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 00000000..d21ebbd3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/UpdateUserInfoReq.java b/ruoyi-modules/ruoyi-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 00000000..0a621f93 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/UserHeartBeatReq.java b/ruoyi-modules/ruoyi-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 00000000..a0293665 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/VerifyCookieReq.java b/ruoyi-modules/ruoyi-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 00000000..cea49ccd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/WupReq.java b/ruoyi-modules/ruoyi-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 00000000..90fe256f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/frame/factory/HuyaWebSocketFrameFactory.java b/ruoyi-modules/ruoyi-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 00000000..2c21b346 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/handler/HuyaBinaryFrameHandler.java b/ruoyi-modules/ruoyi-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 00000000..81a4f436 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/handler/HuyaConnectionHandler.java b/ruoyi-modules/ruoyi-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 00000000..ad052fcd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/util/HuyaCodecUtil.java b/ruoyi-modules/ruoyi-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 00000000..e5b479ea --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/api/HuyaApisTest.java b/ruoyi-modules/ruoyi-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 00000000..3de00e25 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/client/HuyaLiveChatClientTest.java b/ruoyi-modules/ruoyi-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 00000000..e8b83892 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/util/HuyaCodecUtilTest.java b/ruoyi-modules/ruoyi-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 00000000..aabfed7e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/pom.xml new file mode 100644 index 00000000..5522cffd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/ClientModeExample.java b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/ClientModeExample.java new file mode 100644 index 00000000..7809fda8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/api/KuaishouApis.java b/ruoyi-modules/ruoyi-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 00000000..114f6970 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/client/KuaishouLiveChatClient.java b/ruoyi-modules/ruoyi-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 00000000..7c52bdc4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/config/KuaishouLiveChatClientConfig.java b/ruoyi-modules/ruoyi-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 00000000..d46ad215 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/listener/IKuaishouConnectionListener.java b/ruoyi-modules/ruoyi-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 00000000..56a73428 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/listener/IKuaishouMsgListener.java b/ruoyi-modules/ruoyi-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 00000000..d280e060 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouDanmuMsg.java b/ruoyi-modules/ruoyi-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 00000000..fe4dabdb --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouGiftMsg.java b/ruoyi-modules/ruoyi-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 00000000..5ac39d94 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouLikeMsg.java b/ruoyi-modules/ruoyi-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 00000000..01bcefb6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/base/IKuaishouCmdMsg.java b/ruoyi-modules/ruoyi-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 00000000..eaaa8bc6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/base/IKuaishouMsg.java b/ruoyi-modules/ruoyi-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 00000000..12ae6cdf --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/netty/handler/KuaishouBinaryFrameHandler.java b/ruoyi-modules/ruoyi-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 00000000..d6bcb6dc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/netty/handler/KuaishouConnectionHandler.java b/ruoyi-modules/ruoyi-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 00000000..977710dc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/AuditAudienceMaskOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..7030eae1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSErrorOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..d1727084 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSHeartbeatOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..635a5777 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSPingOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..1062bdc4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebEnterRoomOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..8a6b1558 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebErrorOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..7eacbd52 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebHeartbeatOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..f2c5d4e9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebUserExitOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..ebd72e51 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebUserPauseOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..a5527f18 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ClientIdOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..41434dea --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ConfigSwitchItemOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..f73716d1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ConfigSwitchTypeOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..0a53ef22 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/GzoneNameplateOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..318cd1d5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveAudienceStateOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..b5f94ecb --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveCdnNodeViewOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..683bf82e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveFansGroupStateOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..6ba076fa --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PSHostInfoOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..73bc328a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PayloadTypeOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..5711bf4c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PicUrlOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..935c3bbe --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCEchoOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..c39aa9cb --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCErrorOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..4bb004ee --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCHeartbeatAckOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..c2f9a231 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCInfoOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..8191432a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCLiveWarningMaskStatusChangedAudienceOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..507aad29 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCPingAckOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..68e4df33 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebAuthorPauseOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..c2e6f94f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebAuthorResumeOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..77e3c124 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebBetChangedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..2aa5e587 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebBetClosedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..5fa5356c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebCurrentRedPackFeedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..fc3d24a5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebEnterRoomAckOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..bc9092d2 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebErrorOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..e033d815 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebFeedPushOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..ab940c61 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebGuessClosedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..7ee548d8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebGuessOpenedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..952322d7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebHeartbeatAckOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..24932928 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebLiveSpecialAccountConfigStateOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..3aa0095b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebLiveWatchingUsersOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..5a39e0ba --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebPipEndedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..150867cc --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebPipStartedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..4b4e9ffa --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebRefreshWalletOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..44f11b18 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebRideChangedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..4e6cd79a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebSuspectedViolationOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..dabcda89 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SimpleUserInfoOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..e1b66661 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SocketMessageOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..ded05b95 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/UserInfoOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..f09acea2 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebComboCommentFeedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..49a905a6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebCommentFeedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..efa98705 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebCommentFeedShowTypeOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..74cc9385 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebGiftFeedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..4e94afd5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebLikeFeedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..67eff240 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebLiveAssistantTypeOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..066422c6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebPauseTypeOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..28c8879d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebRedPackCoverTypeOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..6b03df29 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebRedPackInfoOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..72ffc45a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebShareFeedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..97d78171 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebSystemNoticeFeedOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..b633443c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebUserPauseTypeOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..e86bfabf --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebWatchingUserInfoOuterClass.java b/ruoyi-modules/ruoyi-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 00000000..15e9bb2e --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/AuditAudienceMask.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/AuditAudienceMask.proto new file mode 100644 index 00000000..8ffa40ce --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSError.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSError.proto new file mode 100644 index 00000000..0e179c2b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSHeartbeat.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSHeartbeat.proto new file mode 100644 index 00000000..0b379093 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSPing.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSPing.proto new file mode 100644 index 00000000..a7b66fbd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebEnterRoom.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebEnterRoom.proto new file mode 100644 index 00000000..3b88423c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebError.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebError.proto new file mode 100644 index 00000000..e49d4d4a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebHeartbeat.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebHeartbeat.proto new file mode 100644 index 00000000..bde62487 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserExit.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserExit.proto new file mode 100644 index 00000000..348f3aa0 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserPause.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserPause.proto new file mode 100644 index 00000000..5987e019 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ClientId.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ClientId.proto new file mode 100644 index 00000000..5ec34ad7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchItem.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchItem.proto new file mode 100644 index 00000000..efb3507a --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchType.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchType.proto new file mode 100644 index 00000000..3fa75b87 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/GzoneNameplate.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/GzoneNameplate.proto new file mode 100644 index 00000000..b8212e74 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveAudienceState.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveAudienceState.proto new file mode 100644 index 00000000..79c06361 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveCdnNodeView.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveCdnNodeView.proto new file mode 100644 index 00000000..495eb9e7 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveFansGroupState.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveFansGroupState.proto new file mode 100644 index 00000000..107d4fd4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PSHostInfo.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PSHostInfo.proto new file mode 100644 index 00000000..1eb30422 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PayloadType.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PayloadType.proto new file mode 100644 index 00000000..05eafc26 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PicUrl.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PicUrl.proto new file mode 100644 index 00000000..891fea72 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCEcho.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCEcho.proto new file mode 100644 index 00000000..6682ba66 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCError.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCError.proto new file mode 100644 index 00000000..c9010285 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCHeartbeatAck.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCHeartbeatAck.proto new file mode 100644 index 00000000..9242e934 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCInfo.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCInfo.proto new file mode 100644 index 00000000..3099f775 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCLiveWarningMaskStatusChangedAudience.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCLiveWarningMaskStatusChangedAudience.proto new file mode 100644 index 00000000..ebceb655 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCPingAck.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCPingAck.proto new file mode 100644 index 00000000..202a86a6 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorPause.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorPause.proto new file mode 100644 index 00000000..7beb4e68 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorResume.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorResume.proto new file mode 100644 index 00000000..fdeae3a9 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetChanged.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetChanged.proto new file mode 100644 index 00000000..a8b58cba --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetClosed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetClosed.proto new file mode 100644 index 00000000..dec4c1de --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebCurrentRedPackFeed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebCurrentRedPackFeed.proto new file mode 100644 index 00000000..64b9a41b --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebEnterRoomAck.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebEnterRoomAck.proto new file mode 100644 index 00000000..8885071c --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebError.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebError.proto new file mode 100644 index 00000000..7bc86441 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebFeedPush.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebFeedPush.proto new file mode 100644 index 00000000..c7c41d1d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessClosed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessClosed.proto new file mode 100644 index 00000000..53e3f635 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessOpened.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessOpened.proto new file mode 100644 index 00000000..d46f065d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebHeartbeatAck.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebHeartbeatAck.proto new file mode 100644 index 00000000..6a6e32be --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveSpecialAccountConfigState.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveSpecialAccountConfigState.proto new file mode 100644 index 00000000..bd2b5fe2 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveWatchingUsers.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveWatchingUsers.proto new file mode 100644 index 00000000..c8381735 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipEnded.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipEnded.proto new file mode 100644 index 00000000..1fb073d8 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipStarted.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipStarted.proto new file mode 100644 index 00000000..5693a3d1 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRefreshWallet.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRefreshWallet.proto new file mode 100644 index 00000000..f51c5390 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRideChanged.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRideChanged.proto new file mode 100644 index 00000000..2c31e7be --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebSuspectedViolation.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebSuspectedViolation.proto new file mode 100644 index 00000000..a2541043 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SimpleUserInfo.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SimpleUserInfo.proto new file mode 100644 index 00000000..cff3feaa --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SocketMessage.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SocketMessage.proto new file mode 100644 index 00000000..f75cfed3 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/UserInfo.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/UserInfo.proto new file mode 100644 index 00000000..5609492f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebComboCommentFeed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebComboCommentFeed.proto new file mode 100644 index 00000000..1ee68ca5 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeed.proto new file mode 100644 index 00000000..19c776ba --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeedShowType.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeedShowType.proto new file mode 100644 index 00000000..7f11ee4d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebGiftFeed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebGiftFeed.proto new file mode 100644 index 00000000..0ff3c6cd --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLikeFeed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLikeFeed.proto new file mode 100644 index 00000000..ebcd99ea --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLiveAssistantType.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLiveAssistantType.proto new file mode 100644 index 00000000..dc7c85f4 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebPauseType.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebPauseType.proto new file mode 100644 index 00000000..c190e09f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackCoverType.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackCoverType.proto new file mode 100644 index 00000000..25bc6a59 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackInfo.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackInfo.proto new file mode 100644 index 00000000..c99aac40 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebShareFeed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebShareFeed.proto new file mode 100644 index 00000000..9e829a3f --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebSystemNoticeFeed.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebSystemNoticeFeed.proto new file mode 100644 index 00000000..a6a5ae20 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebUserPauseType.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebUserPauseType.proto new file mode 100644 index 00000000..9f3d2843 --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebWatchingUserInfo.proto b/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebWatchingUserInfo.proto new file mode 100644 index 00000000..ad6a10ae --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/test/java/tech/ordinaryroad/live/chat/client/kuaishou/api/KuaishouApisTest.java b/ruoyi-modules/ruoyi-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 00000000..db2fa9eb --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/live-chat-client-kuaishou/src/test/java/tech/ordinaryroad/live/chat/client/kuaishou/client/KuaishouLiveChatClientTest.java b/ruoyi-modules/ruoyi-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 00000000..ad94357d --- /dev/null +++ b/ruoyi-modules/ruoyi-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/ruoyi-modules/ruoyi-live/live-chat-clients/pom.xml b/ruoyi-modules/ruoyi-live/live-chat-clients/pom.xml new file mode 100644 index 00000000..b09cfec8 --- /dev/null +++ b/ruoyi-modules/ruoyi-live/live-chat-clients/pom.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 4.0.0 + + org.ruoyi + ruoyi-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/ruoyi-modules/ruoyi-live/pom.xml b/ruoyi-modules/ruoyi-live/pom.xml new file mode 100644 index 00000000..71247b7f --- /dev/null +++ b/ruoyi-modules/ruoyi-live/pom.xml @@ -0,0 +1,177 @@ + + + org.ruoyi + ruoyi-modules + ${revision} + ../pom.xml + + pom + 4.0.0 + ruoyi-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/ruoyi-modules/ruoyi-midjourney/pom.xml b/ruoyi-modules/ruoyi-midjourney/pom.xml deleted file mode 100644 index 98e3503a..00000000 --- a/ruoyi-modules/ruoyi-midjourney/pom.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - com.xmzs - ruoyi-modules - ${revision} - ../pom.xml - - - 4.0.0 - ruoyi-midjourney - - - AI绘画 - - - - 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-web - - - 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 - - - com.xmzs - ruoyi-system - - - - diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/Constants.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/Constants.java deleted file mode 100644 index 8c5634e1..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/Constants.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.midjourney; - -import lombok.experimental.UtilityClass; - -@UtilityClass -public final class Constants { - // 任务扩展属性 start - public static final String TASK_PROPERTY_NOTIFY_HOOK = "notifyHook"; - public static final String TASK_PROPERTY_FINAL_PROMPT = "finalPrompt"; - public static final String TASK_PROPERTY_MESSAGE_ID = "messageId"; - public static final String TASK_PROPERTY_MESSAGE_HASH = "messageHash"; - public static final String TASK_PROPERTY_PROGRESS_MESSAGE_ID = "progressMessageId"; - public static final String TASK_PROPERTY_FLAGS = "flags"; - public static final String TASK_PROPERTY_NONCE = "nonce"; - public static final String TASK_PROPERTY_DISCORD_INSTANCE_ID = "discordInstanceId"; - // 任务扩展属性 end - - public static final String API_SECRET_HEADER_NAME = "mj-api-secret"; - public static final String DEFAULT_DISCORD_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"; -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ProxyApplication.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ProxyApplication.java deleted file mode 100644 index f54f2b19..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ProxyApplication.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.midjourney; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Import; -import org.springframework.scheduling.annotation.EnableScheduling; -import spring.config.BeanConfig; -import spring.config.WebMvcConfig; - -@EnableScheduling -@SpringBootApplication -@Import({BeanConfig.class, WebMvcConfig.class}) -public class ProxyApplication { - - public static void main(String[] args) { - SpringApplication.run(ProxyApplication.class, args); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ProxyProperties.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ProxyProperties.java deleted file mode 100644 index ddd27504..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ProxyProperties.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.xmzs.midjourney; - -import com.xmzs.midjourney.enums.TranslateWay; -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; - -@Data -@Component -@ConfigurationProperties(prefix = "mj") -public class ProxyProperties { - /** - * task存储配置. - */ - private final TaskStore taskStore = new TaskStore(); - /** - * discord账号选择规则. - */ - private String accountChooseRule = "BestWaitIdleRule"; - /** - * discord单账号配置. - */ - private final DiscordAccountConfig discord = new DiscordAccountConfig(); - /** - * discord账号池配置. - */ - private final List accounts = new ArrayList<>(); - /** - * 代理配置. - */ - private final ProxyConfig proxy = new ProxyConfig(); - /** - * 反代配置. - */ - private final NgDiscordConfig ngDiscord = new NgDiscordConfig(); - /** - * 百度翻译配置. - */ - private final BaiduTranslateConfig baiduTranslate = new BaiduTranslateConfig(); - /** - * openai配置. - */ - private final OpenaiConfig openai = new OpenaiConfig(); - /** - * 中文prompt翻译方式. - */ - private TranslateWay translateWay = TranslateWay.NULL; - /** - * 接口密钥,为空不启用鉴权;调用接口时需要加请求头 mj-api-secret. - */ - private String apiSecret; - /** - * 任务状态变更回调地址. - */ - private String notifyHook; - /** - * 通知回调线程池大小. - */ - private int notifyPoolSize = 10; - - @Data - public static class DiscordAccountConfig { - /** - * 服务器ID. - */ - private String guildId; - /** - * 频道ID. - */ - private String channelId; - /** - * 用户Token. - */ - private String userToken; - /** - * 用户UserAgent. - */ - private String userAgent = Constants.DEFAULT_DISCORD_USER_AGENT; - /** - * 是否可用. - */ - private boolean enable = true; - /** - * 并发数. - */ - private int coreSize = 3; - /** - * 等待队列长度. - */ - private int queueSize = 10; - /** - * 任务超时时间(分钟). - */ - private int timeoutMinutes = 5; - } - - @Data - public static class BaiduTranslateConfig { - /** - * 百度翻译的APP_ID. - */ - private String appid; - /** - * 百度翻译的密钥. - */ - private String appSecret; - } - - @Data - public static class OpenaiConfig { - /** - * 自定义gpt的api-url. - */ - private String gptApiUrl; - /** - * gpt的api-key. - */ - private String gptApiKey; - /** - * 超时时间. - */ - private Duration timeout = Duration.ofSeconds(30); - /** - * 使用的模型. - */ - private String model = "gpt-3.5-turbo"; - /** - * 返回结果的最大分词数. - */ - private int maxTokens = 2048; - /** - * 相似度,取值 0-2. - */ - private double temperature = 0; - } - - @Data - public static class TaskStore { - /** - * 任务过期时间,默认30天. - */ - private Duration timeout = Duration.ofDays(30); - /** - * 任务存储方式: redis(默认)、in_memory. - */ - private Type type = Type.IN_MEMORY; - - public enum Type { - /** - * redis. - */ - REDIS, - /** - * in_memory. - */ - IN_MEMORY - } - } - - @Data - public static class ProxyConfig { - /** - * 代理host. - */ - private String host; - /** - * 代理端口. - */ - private Integer port; - } - - @Data - public static class NgDiscordConfig { - /** - * https://discord.com 反代. - */ - private String server; - /** - * https://cdn.discordapp.com 反代. - */ - private String cdn; - /** - * wss://gateway.discord.gg 反代. - */ - private String wss; - /** - * https://discord-attachments-uploads-prd.storage.googleapis.com 反代. - */ - private String uploadServer; - } - - @Data - public static class TaskQueueConfig { - /** - * 并发数. - */ - private int coreSize = 3; - /** - * 等待队列长度. - */ - private int queueSize = 10; - /** - * 任务超时时间(分钟). - */ - private int timeoutMinutes = 5; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ReturnCode.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ReturnCode.java deleted file mode 100644 index 8296e742..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/ReturnCode.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.xmzs.midjourney; - -import lombok.experimental.UtilityClass; - -@UtilityClass -public final class ReturnCode { - /** - * 成功. - */ - public static final int SUCCESS = 1; - /** - * 数据未找到. - */ - public static final int NOT_FOUND = 3; - /** - * 校验错误. - */ - public static final int VALIDATION_ERROR = 4; - /** - * 系统异常. - */ - public static final int FAILURE = 9; - - /** - * 已存在. - */ - public static final int EXISTED = 21; - /** - * 排队中. - */ - public static final int IN_QUEUE = 22; - /** - * 队列已满. - */ - public static final int QUEUE_REJECTED = 23; - /** - * prompt包含敏感词. - */ - public static final int BANNED_PROMPT = 24; - - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/AccountController.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/AccountController.java deleted file mode 100644 index a5d27de7..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/AccountController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xmzs.midjourney.controller; - -import com.xmzs.midjourney.domain.DiscordAccount; -import com.xmzs.midjourney.loadbalancer.DiscordInstance; -import com.xmzs.midjourney.loadbalancer.DiscordLoadBalancer; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@Api(tags = "账号查询") -@RestController -@RequestMapping("/mj/account") -@RequiredArgsConstructor -public class AccountController { - - private final DiscordLoadBalancer loadBalancer; - - @ApiOperation(value = "指定ID获取账号") - @GetMapping("/{id}/fetch") - public DiscordAccount fetch(@ApiParam(value = "账号ID") @PathVariable String id) { - DiscordInstance instance = this.loadBalancer.getDiscordInstance(id); - return instance == null ? null : instance.account(); - } - - @ApiOperation(value = "查询所有账号") - @GetMapping("/list") - public List list() { - return this.loadBalancer.getAllInstances().stream().map(DiscordInstance::account).toList(); - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/FaceController.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/FaceController.java deleted file mode 100644 index 4ade81ea..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/FaceController.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.xmzs.midjourney.controller; - -import cn.hutool.json.JSONUtil; -import com.xmzs.midjourney.domain.InsightFace; -import com.xmzs.midjourney.domain.MjPriceConfig; -import com.xmzs.midjourney.util.MjOkHttpUtil; - -import com.xmzs.system.service.IChatCostService; -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.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; - - private final MjPriceConfig priceConfig; - - @ApiOperation(value = "换脸") - @PostMapping("/insight-face/swap") - public String insightFace(@RequestBody InsightFace insightFace) { - // 扣除接口费用并且保存消息记录 - chatCostService.taskDeduct("mj","换脸", NumberUtils.toDouble(priceConfig.getFaceSwapping(), 0.3)); - // 创建请求体(这里使用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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/SubmitController.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/SubmitController.java deleted file mode 100644 index a9e1a146..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/SubmitController.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.xmzs.midjourney.controller; - -import cn.hutool.json.JSONUtil; -import com.xmzs.midjourney.domain.MjPriceConfig; -import com.xmzs.midjourney.dto.*; -import com.xmzs.midjourney.enums.ActionType; -import com.xmzs.midjourney.util.*; -import com.xmzs.system.service.IChatCostService; -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.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 MjPriceConfig priceConfig; - - 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","放大", NumberUtils.toDouble(priceConfig.getUpsample(), 0.1)); - break; - case IN_PAINT: - // 局部重绘已经扣费,不执行任何操作 - break; - default: - chatCostService.taskDeduct("mj","变化", NumberUtils.toDouble(priceConfig.getChange(), 0.3)); - break; - } - }, - () -> chatCostService.taskDeduct("mj","变化", NumberUtils.toDouble(priceConfig.getChange(), 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","图生图", NumberUtils.toDouble(priceConfig.getBlend(), 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","图生文", NumberUtils.toDouble(priceConfig.getDescribe(), 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(priceConfig.getImagine(), 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","局部重绘", NumberUtils.toDouble(priceConfig.getInpaint(), 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","提示词分析", NumberUtils.toDouble(priceConfig.getShorten(), 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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/TaskController.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/TaskController.java deleted file mode 100644 index f0f93913..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/controller/TaskController.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.midjourney.controller; - -import cn.hutool.json.JSONUtil; -import com.xmzs.midjourney.util.MjOkHttpUtil; -import com.xmzs.midjourney.dto.TaskConditionDTO; -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.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/DiscordAccount.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/DiscordAccount.java deleted file mode 100644 index 01286db2..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/DiscordAccount.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.midjourney.domain; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.xmzs.midjourney.Constants; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@Data -@EqualsAndHashCode(callSuper = true) -@ApiModel("Discord账号") -public class DiscordAccount extends DomainObject { - - @ApiModelProperty("服务器ID") - private String guildId; - @ApiModelProperty("频道ID") - private String channelId; - @ApiModelProperty("用户Token") - private String userToken; - @ApiModelProperty("用户UserAgent") - private String userAgent = Constants.DEFAULT_DISCORD_USER_AGENT; - - @ApiModelProperty("是否可用") - private boolean enable = true; - - @ApiModelProperty("并发数") - private int coreSize = 3; - @ApiModelProperty("等待队列长度") - private int queueSize = 10; - @ApiModelProperty("任务超时时间(分钟)") - private int timeoutMinutes = 5; - - @JsonIgnore - public String getDisplay() { - return this.channelId; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/DomainObject.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/DomainObject.java deleted file mode 100644 index 82abc72a..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/DomainObject.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/InsightFace.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/InsightFace.java deleted file mode 100644 index c06e51c4..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/InsightFace.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.midjourney.domain; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/MjPriceConfig.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/MjPriceConfig.java deleted file mode 100644 index 6fd07866..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/domain/MjPriceConfig.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.xmzs.midjourney.domain; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * 绘画费用信息 - * - * @author Admin - */ -@Data -@Component -@ConfigurationProperties(prefix = "mj") -public class MjPriceConfig { - /** - * 放大图像 - */ - private String upsample; - - /** - * 变化 - */ - private String change; - - /** - * 图生图 - */ - private String blend; - - /** - * 图生文 - */ - private String describe; - - /** - * 文生图 - */ - private String imagine; - - /** - * 局部重绘 - */ - private String inpaint; - - /** - * 提示词分析 - */ - private String shorten; - - /** - * 换脸 - */ - private String faceSwapping; - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/BaseSubmitDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/BaseSubmitDTO.java deleted file mode 100644 index 6b8bae08..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/BaseSubmitDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitActionDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitActionDTO.java deleted file mode 100644 index 7a5c8ba2..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitActionDTO.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitBlendDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitBlendDTO.java deleted file mode 100644 index 74e7e8a1..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitBlendDTO.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.midjourney.dto; - -import com.xmzs.midjourney.enums.BlendDimensions; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitChangeDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitChangeDTO.java deleted file mode 100644 index f542efad..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitChangeDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.midjourney.dto; - -import com.xmzs.midjourney.enums.TaskAction; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - - -@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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitDescribeDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitDescribeDTO.java deleted file mode 100644 index f54bc2b7..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitDescribeDTO.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitImagineDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitImagineDTO.java deleted file mode 100644 index 54b83a6d..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitImagineDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitModalDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitModalDTO.java deleted file mode 100644 index a5658141..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitModalDTO.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitShortenDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitShortenDTO.java deleted file mode 100644 index a6e5bd9c..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitShortenDTO.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitSimpleChangeDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitSimpleChangeDTO.java deleted file mode 100644 index e95cb5d0..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/SubmitSimpleChangeDTO.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/TaskConditionDTO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/TaskConditionDTO.java deleted file mode 100644 index 6168f88d..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/dto/TaskConditionDTO.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.midjourney.dto; - -import io.swagger.annotations.ApiModel; -import lombok.Data; - -import java.util.List; - -@Data -@ApiModel("任务查询参数") -public class TaskConditionDTO { - - private List ids; - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/ActionType.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/ActionType.java deleted file mode 100644 index 8bb90fba..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/ActionType.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/BlendDimensions.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/BlendDimensions.java deleted file mode 100644 index 76a272e8..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/BlendDimensions.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.midjourney.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/MessageType.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/MessageType.java deleted file mode 100644 index 5a5213d9..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/MessageType.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.midjourney.enums; - - -public enum MessageType { - /** - * 创建. - */ - CREATE, - /** - * 修改. - */ - UPDATE, - /** - * 删除. - */ - DELETE; - - public static MessageType of(String type) { - return switch (type) { - case "MESSAGE_CREATE" -> CREATE; - case "MESSAGE_UPDATE" -> UPDATE; - case "MESSAGE_DELETE" -> DELETE; - default -> null; - }; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TaskAction.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TaskAction.java deleted file mode 100644 index d719acf6..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TaskAction.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.midjourney.enums; - - -public enum TaskAction { - /** - * 生成图片. - */ - IMAGINE, - /** - * 选中放大. - */ - UPSCALE, - /** - * 选中其中的一张图,生成四张相似的. - */ - VARIATION, - /** - * 重新执行. - */ - REROLL, - /** - * 图转prompt. - */ - DESCRIBE, - /** - * 多图混合. - */ - BLEND - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TaskStatus.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TaskStatus.java deleted file mode 100644 index 73f3b420..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TaskStatus.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.midjourney.enums; - - -public enum TaskStatus { - /** - * 未启动. - */ - NOT_START, - /** - * 已提交. - */ - SUBMITTED, - /** - * 执行中. - */ - IN_PROGRESS, - /** - * 失败. - */ - FAILURE, - /** - * 成功. - */ - SUCCESS - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TranslateWay.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TranslateWay.java deleted file mode 100644 index 4a04fe3e..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/enums/TranslateWay.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.midjourney.enums; - - -public enum TranslateWay { - /** - * 百度翻译. - */ - BAIDU, - /** - * GPT翻译. - */ - GPT, - /** - * 不翻译. - */ - NULL - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/exception/BannedPromptException.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/exception/BannedPromptException.java deleted file mode 100644 index 7aeaa9f7..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/exception/BannedPromptException.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xmzs.midjourney.exception; - -public class BannedPromptException extends Exception { - - public BannedPromptException(String message) { - super(message); - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/exception/SnowFlakeException.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/exception/SnowFlakeException.java deleted file mode 100644 index c44d0e85..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/exception/SnowFlakeException.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xmzs.midjourney.exception; - -public class SnowFlakeException extends RuntimeException { - - public SnowFlakeException(String message) { - super(message); - } - - public SnowFlakeException(String message, Throwable cause) { - super(message, cause); - } - - public SnowFlakeException(Throwable cause) { - super(cause); - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordInstance.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordInstance.java deleted file mode 100644 index 5c5dc82c..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordInstance.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xmzs.midjourney.loadbalancer; - - -import com.xmzs.midjourney.domain.DiscordAccount; -import com.xmzs.midjourney.result.Message; -import com.xmzs.midjourney.result.SubmitResultVO; -import com.xmzs.midjourney.service.DiscordService; -import com.xmzs.midjourney.support.Task; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.Future; - -public interface DiscordInstance extends DiscordService { - - String getInstanceId(); - - DiscordAccount account(); - - boolean isAlive(); - - void startWss() throws Exception; - - List getRunningTasks(); - - void exitTask(Task task); - - Map> getRunningFutures(); - - SubmitResultVO submitTask(Task task, Callable> discordSubmit); - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordInstanceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordInstanceImpl.java deleted file mode 100644 index e81ec59f..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordInstanceImpl.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.xmzs.midjourney.loadbalancer; - - -import com.xmzs.midjourney.Constants; -import com.xmzs.midjourney.ReturnCode; -import com.xmzs.midjourney.domain.DiscordAccount; -import com.xmzs.midjourney.enums.BlendDimensions; -import com.xmzs.midjourney.enums.TaskStatus; -import com.xmzs.midjourney.result.Message; -import com.xmzs.midjourney.result.SubmitResultVO; -import com.xmzs.midjourney.service.DiscordService; -import com.xmzs.midjourney.service.DiscordServiceImpl; -import com.xmzs.midjourney.service.NotifyService; -import com.xmzs.midjourney.service.TaskStoreService; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.wss.WebSocketStarter; -import com.xmzs.midjourney.wss.user.UserWebSocketStarter; -import eu.maxschuster.dataurl.DataUrl; -import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import org.springframework.web.client.RestTemplate; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.Future; -import java.util.concurrent.RejectedExecutionException; - -@Slf4j -public class DiscordInstanceImpl implements DiscordInstance { - private final DiscordAccount account; - private final WebSocketStarter socketStarter; - private final DiscordService service; - private final TaskStoreService taskStoreService; - private final NotifyService notifyService; - - private final ThreadPoolTaskExecutor taskExecutor; - private final List runningTasks; - private final Map> taskFutureMap = Collections.synchronizedMap(new HashMap<>()); - - public DiscordInstanceImpl(DiscordAccount account, UserWebSocketStarter socketStarter, RestTemplate restTemplate, - TaskStoreService taskStoreService, NotifyService notifyService, Map paramsMap) { - this.account = account; - this.socketStarter = socketStarter; - this.taskStoreService = taskStoreService; - this.notifyService = notifyService; - this.service = new DiscordServiceImpl(account, restTemplate, paramsMap); - this.runningTasks = new CopyOnWriteArrayList<>(); - this.taskExecutor = new ThreadPoolTaskExecutor(); - this.taskExecutor.setCorePoolSize(account.getCoreSize()); - this.taskExecutor.setMaxPoolSize(account.getCoreSize()); - this.taskExecutor.setQueueCapacity(account.getQueueSize()); - this.taskExecutor.setThreadNamePrefix("TaskQueue-" + account.getDisplay() + "-"); - this.taskExecutor.initialize(); - } - - @Override - public String getInstanceId() { - return this.account.getChannelId(); - } - - @Override - public DiscordAccount account() { - return this.account; - } - - @Override - public boolean isAlive() { - return this.account.isEnable(); - } - - @Override - public void startWss() throws Exception { - this.socketStarter.setTrying(true); - this.socketStarter.start(); - } - - @Override - public List getRunningTasks() { - return this.runningTasks; - } - - @Override - public void exitTask(Task task) { - try { - Future future = this.taskFutureMap.get(task.getId()); - if (future != null) { - future.cancel(true); - } - saveAndNotify(task); - } finally { - this.runningTasks.remove(task); - this.taskFutureMap.remove(task.getId()); - } - } - - @Override - public Map> getRunningFutures() { - return this.taskFutureMap; - } - - @Override - public synchronized SubmitResultVO submitTask(Task task, Callable> discordSubmit) { - this.taskStoreService.save(task); - int currentWaitNumbers; - try { - currentWaitNumbers = this.taskExecutor.getThreadPoolExecutor().getQueue().size(); - Future future = this.taskExecutor.submit(() -> executeTask(task, discordSubmit)); - this.taskFutureMap.put(task.getId(), future); - } catch (RejectedExecutionException e) { - this.taskStoreService.delete(task.getId()); - return SubmitResultVO.fail(ReturnCode.QUEUE_REJECTED, "队列已满,请稍后尝试") - .setProperty(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID, this.getInstanceId()); - } catch (Exception e) { - log.error("submit task error", e); - return SubmitResultVO.fail(ReturnCode.FAILURE, "提交失败,系统异常") - .setProperty(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID, this.getInstanceId()); - } - if (currentWaitNumbers == 0) { - return SubmitResultVO.of(ReturnCode.SUCCESS, "提交成功", task.getId()) - .setProperty(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID, this.getInstanceId()); - } else { - return SubmitResultVO.of(ReturnCode.IN_QUEUE, "排队中,前面还有" + currentWaitNumbers + "个任务", task.getId()) - .setProperty("numberOfQueues", currentWaitNumbers) - .setProperty(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID, this.getInstanceId()); - } - } - - private void executeTask(Task task, Callable> discordSubmit) { - this.runningTasks.add(task); - try { - task.start(); - Message result = discordSubmit.call(); - if (result.getCode() != ReturnCode.SUCCESS) { - task.fail(result.getDescription()); - saveAndNotify(task); - return; - } - saveAndNotify(task); - do { - task.sleep(); - saveAndNotify(task); - } while (task.getStatus() == TaskStatus.IN_PROGRESS); - log.debug("task finished, id: {}, status: {}", task.getId(), task.getStatus()); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } catch (Exception e) { - log.error("task execute error", e); - task.fail("执行错误,系统异常"); - saveAndNotify(task); - } finally { - this.runningTasks.remove(task); - this.taskFutureMap.remove(task.getId()); - } - } - - private void saveAndNotify(Task task) { - this.taskStoreService.save(task); - this.notifyService.notifyTaskChange(task); - } - - @Override - public Message imagine(String prompt, String nonce) { - return this.service.imagine(prompt, nonce); - } - - @Override - public Message upscale(String messageId, int index, String messageHash, int messageFlags, String nonce) { - return this.service.upscale(messageId, index, messageHash, messageFlags, nonce); - } - - @Override - public Message variation(String messageId, int index, String messageHash, int messageFlags, String nonce) { - return this.service.variation(messageId, index, messageHash, messageFlags, nonce); - } - - @Override - public Message reroll(String messageId, String messageHash, int messageFlags, String nonce) { - return this.service.reroll(messageId, messageHash, messageFlags, nonce); - } - - @Override - public Message describe(String finalFileName, String nonce) { - return this.service.describe(finalFileName, nonce); - } - - @Override - public Message blend(List finalFileNames, BlendDimensions dimensions, String nonce) { - return this.service.blend(finalFileNames, dimensions, nonce); - } - - @Override - public Message upload(String fileName, DataUrl dataUrl) { - return this.service.upload(fileName, dataUrl); - } - - @Override - public Message sendImageMessage(String content, String finalFileName) { - return this.service.sendImageMessage(content, finalFileName); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordLoadBalancer.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordLoadBalancer.java deleted file mode 100644 index e4c9ebe3..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/DiscordLoadBalancer.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.xmzs.midjourney.loadbalancer; - - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.loadbalancer.rule.IRule; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.support.TaskCondition; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Stream; - -@Component -@RequiredArgsConstructor -public class DiscordLoadBalancer { - private final IRule rule; - - private final List instances = Collections.synchronizedList(new ArrayList<>()); - - public List getAllInstances() { - return this.instances; - } - - public List getAliveInstances() { - return this.instances.stream().filter(DiscordInstance::isAlive).toList(); - } - - public DiscordInstance chooseInstance() { - return this.rule.choose(getAliveInstances()); - } - - public DiscordInstance getDiscordInstance(String instanceId) { - if (CharSequenceUtil.isBlank(instanceId)) { - return null; - } - return this.instances.stream() - .filter(instance -> CharSequenceUtil.equals(instanceId, instance.getInstanceId())) - .findFirst().orElse(null); - } - - public Set getQueueTaskIds() { - Set taskIds = Collections.synchronizedSet(new HashSet<>()); - for (DiscordInstance instance : getAliveInstances()) { - taskIds.addAll(instance.getRunningFutures().keySet()); - } - return taskIds; - } - - public Stream findRunningTask(TaskCondition condition) { - return getAliveInstances().stream().flatMap(instance -> instance.getRunningTasks().stream().filter(condition)); - } - - public Task getRunningTask(String id) { - for (DiscordInstance instance : getAliveInstances()) { - Optional optional = instance.getRunningTasks().stream().filter(t -> id.equals(t.getId())).findFirst(); - if (optional.isPresent()) { - return optional.get(); - } - } - return null; - } - - public Task getRunningTaskByNonce(String nonce) { - if (CharSequenceUtil.isBlank(nonce)) { - return null; - } - TaskCondition condition = new TaskCondition().setNonce(nonce); - for (DiscordInstance instance : getAliveInstances()) { - Optional optional = instance.getRunningTasks().stream().filter(condition).findFirst(); - if (optional.isPresent()) { - return optional.get(); - } - } - return null; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/BestWaitIdleRule.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/BestWaitIdleRule.java deleted file mode 100644 index 3dd73993..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/BestWaitIdleRule.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.xmzs.midjourney.loadbalancer.rule; - -import cn.hutool.core.util.RandomUtil; -import com.xmzs.midjourney.loadbalancer.DiscordInstance; - -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * 最少等待空闲. - * 选择等待数最少的实例,如果都不需要等待,则随机选择 - */ -public class BestWaitIdleRule implements IRule { - - @Override - public DiscordInstance choose(List instances) { - if (instances.isEmpty()) { - return null; - } - Map> map = instances.stream() - .collect(Collectors.groupingBy(i -> { - int wait = i.getRunningFutures().size() - i.account().getCoreSize(); - return wait >= 0 ? wait : -1; - })); - List instanceList = map.entrySet().stream().min(Comparator.comparingInt(Map.Entry::getKey)).orElseThrow().getValue(); - return RandomUtil.randomEle(instanceList); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/IRule.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/IRule.java deleted file mode 100644 index a89b2560..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/IRule.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.xmzs.midjourney.loadbalancer.rule; - -import com.xmzs.midjourney.loadbalancer.DiscordInstance; - -import java.util.List; - -public interface IRule { - - DiscordInstance choose(List instances); -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/RoundRobinRule.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/RoundRobinRule.java deleted file mode 100644 index 43d82512..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/loadbalancer/rule/RoundRobinRule.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xmzs.midjourney.loadbalancer.rule; - -import com.xmzs.midjourney.loadbalancer.DiscordInstance; - -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * 轮询. - */ -public class RoundRobinRule implements IRule { - private final AtomicInteger position = new AtomicInteger(0); - - @Override - public DiscordInstance choose(List instances) { - if (instances.isEmpty()) { - return null; - } - int pos = incrementAndGet(); - return instances.get(pos % instances.size()); - } - - private int incrementAndGet() { - int current; - int next; - do { - current = this.position.get(); - next = current == Integer.MAX_VALUE ? 0 : current + 1; - } while (!this.position.compareAndSet(current, next)); - return next; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/result/Message.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/result/Message.java deleted file mode 100644 index 4dca97f0..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/result/Message.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.xmzs.midjourney.result; - -import com.xmzs.midjourney.ReturnCode; -import lombok.Getter; - -@Getter -public class Message { - private final int code; - private final String description; - private final T result; - - public static Message success() { - return new Message<>(ReturnCode.SUCCESS, "成功"); - } - - public static Message success(T result) { - return new Message<>(ReturnCode.SUCCESS, "成功", result); - } - - public static Message success(int code, String description, T result) { - return new Message<>(code, description, result); - } - - public static Message notFound() { - return new Message<>(ReturnCode.NOT_FOUND, "数据未找到"); - } - - public static Message validationError() { - return new Message<>(ReturnCode.VALIDATION_ERROR, "校验错误"); - } - - public static Message failure() { - return new Message<>(ReturnCode.FAILURE, "系统异常"); - } - - public static Message failure(String description) { - return new Message<>(ReturnCode.FAILURE, description); - } - - public static Message of(int code, String description) { - return new Message<>(code, description); - } - - public static Message of(int code, String description, T result) { - return new Message<>(code, description, result); - } - - private Message(int code, String description) { - this(code, description, null); - } - - private Message(int code, String description, T result) { - this.code = code; - this.description = description; - this.result = result; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/result/SubmitResultVO.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/result/SubmitResultVO.java deleted file mode 100644 index b5b392b9..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/result/SubmitResultVO.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.xmzs.midjourney.result; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.HashMap; -import java.util.Map; - -@Data -@ApiModel("提交结果") -public class SubmitResultVO { - - @ApiModelProperty(value = "状态码: 1(提交成功), 21(已存在), 22(排队中), other(错误)", required = true, example = "1") - private int code; - - @ApiModelProperty(value = "描述", required = true, example = "提交成功") - private String description; - - @ApiModelProperty(value = "任务ID", example = "1320098173412546") - private String result; - - @ApiModelProperty(value = "扩展字段") - private Map properties = new HashMap<>(); - - public SubmitResultVO setProperty(String name, Object value) { - this.properties.put(name, value); - return this; - } - - public SubmitResultVO removeProperty(String name) { - this.properties.remove(name); - return this; - } - - public Object getProperty(String name) { - return this.properties.get(name); - } - - @SuppressWarnings("unchecked") - public T getPropertyGeneric(String name) { - return (T) getProperty(name); - } - - public T getProperty(String name, Class clz) { - return clz.cast(getProperty(name)); - } - - public static SubmitResultVO of(int code, String description, String result) { - return new SubmitResultVO(code, description, result); - } - - public static SubmitResultVO fail(int code, String description) { - return new SubmitResultVO(code, description, null); - } - - private SubmitResultVO(int code, String description, String result) { - this.code = code; - this.description = description; - this.result = result; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/DiscordService.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/DiscordService.java deleted file mode 100644 index e2fc729a..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/DiscordService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.midjourney.service; - - -import com.xmzs.midjourney.enums.BlendDimensions; -import com.xmzs.midjourney.result.Message; -import eu.maxschuster.dataurl.DataUrl; - -import java.util.List; - -public interface DiscordService { - - Message imagine(String prompt, String nonce); - - Message upscale(String messageId, int index, String messageHash, int messageFlags, String nonce); - - Message variation(String messageId, int index, String messageHash, int messageFlags, String nonce); - - Message reroll(String messageId, String messageHash, int messageFlags, String nonce); - - Message describe(String finalFileName, String nonce); - - Message blend(List finalFileNames, BlendDimensions dimensions, String nonce); - - Message upload(String fileName, DataUrl dataUrl); - - Message sendImageMessage(String content, String finalFileName); - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/DiscordServiceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/DiscordServiceImpl.java deleted file mode 100644 index e1a1bc3d..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/DiscordServiceImpl.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.xmzs.midjourney.service; - - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.ReturnCode; -import com.xmzs.midjourney.domain.DiscordAccount; -import com.xmzs.midjourney.enums.BlendDimensions; -import com.xmzs.midjourney.result.Message; -import com.xmzs.midjourney.support.DiscordHelper; -import com.xmzs.midjourney.support.SpringContextHolder; -import eu.maxschuster.dataurl.DataUrl; -import lombok.extern.slf4j.Slf4j; -import org.json.JSONArray; -import org.json.JSONObject; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.client.HttpStatusCodeException; -import org.springframework.web.client.RestTemplate; - -import java.util.List; -import java.util.Map; - -@Slf4j -public class DiscordServiceImpl implements DiscordService { - private static final String DEFAULT_SESSION_ID = "f1a313a09ce079ce252459dc70231f30"; - - private final DiscordAccount account; - private final Map paramsMap; - private final RestTemplate restTemplate; - private final DiscordHelper discordHelper; - - private final String discordInteractionUrl; - private final String discordAttachmentUrl; - private final String discordMessageUrl; - - public DiscordServiceImpl(DiscordAccount account, RestTemplate restTemplate, Map paramsMap) { - this.account = account; - this.restTemplate = restTemplate; - this.discordHelper = SpringContextHolder.getApplicationContext().getBean(DiscordHelper.class); - this.paramsMap = paramsMap; - String discordServer = this.discordHelper.getServer(); - this.discordInteractionUrl = discordServer + "/api/v9/interactions"; - this.discordAttachmentUrl = discordServer + "/api/v9/channels/" + account.getChannelId() + "/attachments"; - this.discordMessageUrl = discordServer + "/api/v9/channels/" + account.getChannelId() + "/messages"; - } - - @Override - public Message imagine(String prompt, String nonce) { - String paramsStr = replaceInteractionParams(this.paramsMap.get("imagine"), nonce); - JSONObject params = new JSONObject(paramsStr); - params.getJSONObject("data").getJSONArray("options").getJSONObject(0) - .put("value", prompt); - return postJsonAndCheckStatus(params.toString()); - } - - @Override - public Message upscale(String messageId, int index, String messageHash, int messageFlags, String nonce) { - String paramsStr = replaceInteractionParams(this.paramsMap.get("upscale"), nonce) - .replace("$message_id", messageId) - .replace("$index", String.valueOf(index)) - .replace("$message_hash", messageHash); - paramsStr = new JSONObject(paramsStr).put("message_flags", messageFlags).toString(); - return postJsonAndCheckStatus(paramsStr); - } - - @Override - public Message variation(String messageId, int index, String messageHash, int messageFlags, String nonce) { - String paramsStr = replaceInteractionParams(this.paramsMap.get("variation"), nonce) - .replace("$message_id", messageId) - .replace("$index", String.valueOf(index)) - .replace("$message_hash", messageHash); - paramsStr = new JSONObject(paramsStr).put("message_flags", messageFlags).toString(); - return postJsonAndCheckStatus(paramsStr); - } - - @Override - public Message reroll(String messageId, String messageHash, int messageFlags, String nonce) { - String paramsStr = replaceInteractionParams(this.paramsMap.get("reroll"), nonce) - .replace("$message_id", messageId) - .replace("$message_hash", messageHash); - paramsStr = new JSONObject(paramsStr).put("message_flags", messageFlags).toString(); - return postJsonAndCheckStatus(paramsStr); - } - - @Override - public Message describe(String finalFileName, String nonce) { - String fileName = CharSequenceUtil.subAfter(finalFileName, "/", true); - String paramsStr = replaceInteractionParams(this.paramsMap.get("describe"), nonce) - .replace("$file_name", fileName) - .replace("$final_file_name", finalFileName); - return postJsonAndCheckStatus(paramsStr); - } - - @Override - public Message blend(List finalFileNames, BlendDimensions dimensions, String nonce) { - String paramsStr = replaceInteractionParams(this.paramsMap.get("blend"), nonce); - JSONObject params = new JSONObject(paramsStr); - JSONArray options = params.getJSONObject("data").getJSONArray("options"); - JSONArray attachments = params.getJSONObject("data").getJSONArray("attachments"); - for (int i = 0; i < finalFileNames.size(); i++) { - String finalFileName = finalFileNames.get(i); - String fileName = CharSequenceUtil.subAfter(finalFileName, "/", true); - JSONObject attachment = new JSONObject().put("id", String.valueOf(i)) - .put("filename", fileName) - .put("uploaded_filename", finalFileName); - attachments.put(attachment); - JSONObject option = new JSONObject().put("type", 11) - .put("name", "image" + (i + 1)) - .put("value", i); - options.put(option); - } - options.put(new JSONObject().put("type", 3) - .put("name", "dimensions") - .put("value", "--ar " + dimensions.getValue())); - return postJsonAndCheckStatus(params.toString()); - } - - private String replaceInteractionParams(String paramsStr, String nonce) { - return paramsStr.replace("$guild_id", this.account.getGuildId()) - .replace("$channel_id", this.account.getChannelId()) - .replace("$session_id", DEFAULT_SESSION_ID) - .replace("$nonce", nonce); - } - - @Override - public Message upload(String fileName, DataUrl dataUrl) { - try { - JSONObject fileObj = new JSONObject(); - fileObj.put("filename", fileName); - fileObj.put("file_size", dataUrl.getData().length); - fileObj.put("id", "0"); - JSONObject params = new JSONObject() - .put("files", new JSONArray().put(fileObj)); - ResponseEntity responseEntity = postJson(this.discordAttachmentUrl, params.toString()); - if (responseEntity.getStatusCode() != HttpStatus.OK) { - log.error("上传图片到discord失败, status: {}, msg: {}", responseEntity.getStatusCodeValue(), responseEntity.getBody()); - return Message.of(ReturnCode.VALIDATION_ERROR, "上传图片到discord失败"); - } - JSONArray array = new JSONObject(responseEntity.getBody()).getJSONArray("attachments"); - if (array.length() == 0) { - return Message.of(ReturnCode.VALIDATION_ERROR, "上传图片到discord失败"); - } - String uploadUrl = array.getJSONObject(0).getString("upload_url"); - String uploadFilename = array.getJSONObject(0).getString("upload_filename"); - putFile(uploadUrl, dataUrl); - return Message.success(uploadFilename); - } catch (Exception e) { - log.error("上传图片到discord失败", e); - return Message.of(ReturnCode.FAILURE, "上传图片到discord失败"); - } - } - - @Override - public Message sendImageMessage(String content, String finalFileName) { - String fileName = CharSequenceUtil.subAfter(finalFileName, "/", true); - String paramsStr = this.paramsMap.get("message").replace("$content", content) - .replace("$channel_id", this.account.getChannelId()) - .replace("$file_name", fileName) - .replace("$final_file_name", finalFileName); - ResponseEntity responseEntity = postJson(this.discordMessageUrl, paramsStr); - if (responseEntity.getStatusCode() != HttpStatus.OK) { - log.error("发送图片消息到discord失败, status: {}, msg: {}", responseEntity.getStatusCodeValue(), responseEntity.getBody()); - return Message.of(ReturnCode.VALIDATION_ERROR, "发送图片消息到discord失败"); - } - JSONObject result = new JSONObject(responseEntity.getBody()); - JSONArray attachments = result.optJSONArray("attachments"); - if (!attachments.isEmpty()) { - return Message.success(attachments.getJSONObject(0).optString("url")); - } - return Message.failure("发送图片消息到discord失败: 图片不存在"); - } - - private void putFile(String uploadUrl, DataUrl dataUrl) { - uploadUrl = this.discordHelper.getDiscordUploadUrl(uploadUrl); - HttpHeaders headers = new HttpHeaders(); - headers.add("User-Agent", this.account.getUserAgent()); - headers.setContentType(MediaType.valueOf(dataUrl.getMimeType())); - headers.setContentLength(dataUrl.getData().length); - HttpEntity requestEntity = new HttpEntity<>(dataUrl.getData(), headers); - this.restTemplate.put(uploadUrl, requestEntity); - } - - private ResponseEntity postJson(String paramsStr) { - return postJson(this.discordInteractionUrl, paramsStr); - } - - private ResponseEntity postJson(String url, String paramsStr) { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - headers.set("Authorization", this.account.getUserToken()); - headers.set("User-Agent", this.account.getUserAgent()); - HttpEntity httpEntity = new HttpEntity<>(paramsStr, headers); - return this.restTemplate.postForEntity(url, httpEntity, String.class); - } - - private Message postJsonAndCheckStatus(String paramsStr) { - try { - ResponseEntity responseEntity = postJson(paramsStr); - if (responseEntity.getStatusCode() == HttpStatus.NO_CONTENT) { - return Message.success(); - } - return Message.of(responseEntity.getStatusCodeValue(), CharSequenceUtil.sub(responseEntity.getBody(), 0, 100)); - } catch (HttpStatusCodeException e) { - return convertHttpStatusCodeException(e); - } - } - - private Message convertHttpStatusCodeException(HttpStatusCodeException e) { - try { - JSONObject error = new JSONObject(e.getResponseBodyAsString()); - return Message.of(error.optInt("code", e.getRawStatusCode()), error.optString("message")); - } catch (Exception je) { - return Message.of(e.getRawStatusCode(), CharSequenceUtil.sub(e.getMessage(), 0, 100)); - } - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/NotifyService.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/NotifyService.java deleted file mode 100644 index ebcca0bd..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/NotifyService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.xmzs.midjourney.service; - - -import com.xmzs.midjourney.support.Task; - -public interface NotifyService { - - void notifyTaskChange(Task task); - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/NotifyServiceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/NotifyServiceImpl.java deleted file mode 100644 index b13151a7..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/NotifyServiceImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.xmzs.midjourney.service; - -import cn.hutool.cache.CacheUtil; -import cn.hutool.cache.impl.TimedCache; -import cn.hutool.core.exceptions.CheckedUtil; -import cn.hutool.core.text.CharSequenceUtil; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xmzs.midjourney.Constants; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.enums.TaskStatus; -import com.xmzs.midjourney.support.Task; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -import java.time.Duration; - -@Slf4j -@Service -public class NotifyServiceImpl implements NotifyService { - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - private final ThreadPoolTaskExecutor executor; - private final TimedCache taskLocks = CacheUtil.newTimedCache(Duration.ofHours(1).toMillis()); - - public NotifyServiceImpl(ProxyProperties properties) { - this.executor = new ThreadPoolTaskExecutor(); - this.executor.setCorePoolSize(properties.getNotifyPoolSize()); - this.executor.setThreadNamePrefix("TaskNotify-"); - this.executor.initialize(); - } - - @Override - public void notifyTaskChange(Task task) { - String notifyHook = task.getPropertyGeneric(Constants.TASK_PROPERTY_NOTIFY_HOOK); - if (CharSequenceUtil.isBlank(notifyHook)) { - return; - } - String taskId = task.getId(); - TaskStatus taskStatus = task.getStatus(); - Object taskLock = this.taskLocks.get(taskId, (CheckedUtil.Func0Rt) Object::new); - try { - String paramsStr = OBJECT_MAPPER.writeValueAsString(task); - this.executor.execute(() -> { - synchronized (taskLock) { - try { - ResponseEntity responseEntity = postJson(notifyHook, paramsStr); - if (responseEntity.getStatusCode() == HttpStatus.OK) { - log.debug("推送任务变更成功, 任务ID: {}, status: {}, notifyHook: {}", taskId, taskStatus, notifyHook); - } else { - log.warn("推送任务变更失败, 任务ID: {}, notifyHook: {}, code: {}, msg: {}", taskId, notifyHook, responseEntity.getStatusCodeValue(), responseEntity.getBody()); - } - } catch (Exception e) { - log.warn("推送任务变更失败, 任务ID: {}, notifyHook: {}, 描述: {}", taskId, notifyHook, e.getMessage()); - } - } - }); - } catch (JsonProcessingException e) { - log.warn("推送任务变更失败, 任务ID: {}, notifyHook: {}, 描述: {}", taskId, notifyHook, e.getMessage()); - } - } - - private ResponseEntity postJson(String notifyHook, String paramsJson) { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity httpEntity = new HttpEntity<>(paramsJson, headers); - return new RestTemplate().postForEntity(notifyHook, httpEntity, String.class); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskService.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskService.java deleted file mode 100644 index 44b7ca6f..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.midjourney.service; - -import com.xmzs.midjourney.enums.BlendDimensions; -import com.xmzs.midjourney.result.SubmitResultVO; -import com.xmzs.midjourney.support.Task; -import eu.maxschuster.dataurl.DataUrl; - -import java.util.List; - -public interface TaskService { - - SubmitResultVO submitImagine(Task task, List dataUrls); - - SubmitResultVO submitUpscale(Task task, String targetMessageId, String targetMessageHash, int index, int messageFlags); - - SubmitResultVO submitVariation(Task task, String targetMessageId, String targetMessageHash, int index, int messageFlags); - - SubmitResultVO submitReroll(Task task, String targetMessageId, String targetMessageHash, int messageFlags); - - SubmitResultVO submitDescribe(Task task, DataUrl dataUrl); - - SubmitResultVO submitBlend(Task task, List dataUrls, BlendDimensions dimensions); -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskServiceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskServiceImpl.java deleted file mode 100644 index 907049e0..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskServiceImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.xmzs.midjourney.service; - -import com.xmzs.midjourney.Constants; -import com.xmzs.midjourney.ReturnCode; -import com.xmzs.midjourney.enums.BlendDimensions; -import com.xmzs.midjourney.loadbalancer.DiscordInstance; -import com.xmzs.midjourney.loadbalancer.DiscordLoadBalancer; -import com.xmzs.midjourney.result.Message; -import com.xmzs.midjourney.result.SubmitResultVO; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.util.MimeTypeUtils; -import eu.maxschuster.dataurl.DataUrl; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Service -@RequiredArgsConstructor -public class TaskServiceImpl implements TaskService { - private final TaskStoreService taskStoreService; - private final DiscordLoadBalancer discordLoadBalancer; - - @Override - public SubmitResultVO submitImagine(Task task, List dataUrls) { - DiscordInstance instance = this.discordLoadBalancer.chooseInstance(); - if (instance == null) { - return SubmitResultVO.fail(ReturnCode.NOT_FOUND, "无可用的账号实例"); - } - task.setProperty(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID, instance.getInstanceId()); - return instance.submitTask(task, () -> { - List imageUrls = new ArrayList<>(); - for (DataUrl dataUrl : dataUrls) { - String taskFileName = task.getId() + "." + MimeTypeUtils.guessFileSuffix(dataUrl.getMimeType()); - Message uploadResult = instance.upload(taskFileName, dataUrl); - if (uploadResult.getCode() != ReturnCode.SUCCESS) { - return Message.of(uploadResult.getCode(), uploadResult.getDescription()); - } - String finalFileName = uploadResult.getResult(); - Message sendImageResult = instance.sendImageMessage("upload image: " + finalFileName, finalFileName); - if (sendImageResult.getCode() != ReturnCode.SUCCESS) { - return Message.of(sendImageResult.getCode(), sendImageResult.getDescription()); - } - imageUrls.add(sendImageResult.getResult()); - } - if (!imageUrls.isEmpty()) { - task.setPrompt(String.join(" ", imageUrls) + " " + task.getPrompt()); - task.setPromptEn(String.join(" ", imageUrls) + " " + task.getPromptEn()); - task.setDescription("/imagine " + task.getPrompt()); - this.taskStoreService.save(task); - } - return instance.imagine(task.getPromptEn(), task.getPropertyGeneric(Constants.TASK_PROPERTY_NONCE)); - }); - } - - @Override - public SubmitResultVO submitUpscale(Task task, String targetMessageId, String targetMessageHash, int index, int messageFlags) { - String instanceId = task.getPropertyGeneric(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID); - DiscordInstance discordInstance = this.discordLoadBalancer.getDiscordInstance(instanceId); - if (discordInstance == null || !discordInstance.isAlive()) { - return SubmitResultVO.fail(ReturnCode.NOT_FOUND, "账号不可用: " + instanceId); - } - return discordInstance.submitTask(task, () -> discordInstance.upscale(targetMessageId, index, targetMessageHash, messageFlags, task.getPropertyGeneric(Constants.TASK_PROPERTY_NONCE))); - } - - @Override - public SubmitResultVO submitVariation(Task task, String targetMessageId, String targetMessageHash, int index, int messageFlags) { - String instanceId = task.getPropertyGeneric(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID); - DiscordInstance discordInstance = this.discordLoadBalancer.getDiscordInstance(instanceId); - if (discordInstance == null || !discordInstance.isAlive()) { - return SubmitResultVO.fail(ReturnCode.NOT_FOUND, "账号不可用: " + instanceId); - } - return discordInstance.submitTask(task, () -> discordInstance.variation(targetMessageId, index, targetMessageHash, messageFlags, task.getPropertyGeneric(Constants.TASK_PROPERTY_NONCE))); - } - - @Override - public SubmitResultVO submitReroll(Task task, String targetMessageId, String targetMessageHash, int messageFlags) { - String instanceId = task.getPropertyGeneric(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID); - DiscordInstance discordInstance = this.discordLoadBalancer.getDiscordInstance(instanceId); - if (discordInstance == null || !discordInstance.isAlive()) { - return SubmitResultVO.fail(ReturnCode.NOT_FOUND, "账号不可用: " + instanceId); - } - return discordInstance.submitTask(task, () -> discordInstance.reroll(targetMessageId, targetMessageHash, messageFlags, task.getPropertyGeneric(Constants.TASK_PROPERTY_NONCE))); - } - - @Override - public SubmitResultVO submitDescribe(Task task, DataUrl dataUrl) { - DiscordInstance discordInstance = this.discordLoadBalancer.chooseInstance(); - if (discordInstance == null) { - return SubmitResultVO.fail(ReturnCode.NOT_FOUND, "无可用的账号实例"); - } - task.setProperty(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID, discordInstance.getInstanceId()); - return discordInstance.submitTask(task, () -> { - String taskFileName = task.getId() + "." + MimeTypeUtils.guessFileSuffix(dataUrl.getMimeType()); - Message uploadResult = discordInstance.upload(taskFileName, dataUrl); - if (uploadResult.getCode() != ReturnCode.SUCCESS) { - return Message.of(uploadResult.getCode(), uploadResult.getDescription()); - } - String finalFileName = uploadResult.getResult(); - return discordInstance.describe(finalFileName, task.getPropertyGeneric(Constants.TASK_PROPERTY_NONCE)); - }); - } - - @Override - public SubmitResultVO submitBlend(Task task, List dataUrls, BlendDimensions dimensions) { - DiscordInstance discordInstance = this.discordLoadBalancer.chooseInstance(); - if (discordInstance == null) { - return SubmitResultVO.fail(ReturnCode.NOT_FOUND, "无可用的账号实例"); - } - task.setProperty(Constants.TASK_PROPERTY_DISCORD_INSTANCE_ID, discordInstance.getInstanceId()); - return discordInstance.submitTask(task, () -> { - List finalFileNames = new ArrayList<>(); - for (DataUrl dataUrl : dataUrls) { - String taskFileName = task.getId() + "." + MimeTypeUtils.guessFileSuffix(dataUrl.getMimeType()); - Message uploadResult = discordInstance.upload(taskFileName, dataUrl); - if (uploadResult.getCode() != ReturnCode.SUCCESS) { - return Message.of(uploadResult.getCode(), uploadResult.getDescription()); - } - finalFileNames.add(uploadResult.getResult()); - } - return discordInstance.blend(finalFileNames, dimensions, task.getPropertyGeneric(Constants.TASK_PROPERTY_NONCE)); - }); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskStoreService.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskStoreService.java deleted file mode 100644 index c090fb53..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TaskStoreService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.midjourney.service; - - -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.support.TaskCondition; - -import java.util.List; - -public interface TaskStoreService { - - void save(Task task); - - void delete(String id); - - Task get(String id); - - List list(); - - List list(TaskCondition condition); - - Task findOne(TaskCondition condition); - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TranslateService.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TranslateService.java deleted file mode 100644 index fe673a93..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/TranslateService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.xmzs.midjourney.service; - -import java.util.regex.Pattern; - -public interface TranslateService { - - String translateToEnglish(String prompt); - - default boolean containsChinese(String prompt) { - return Pattern.compile("[\u4e00-\u9fa5]").matcher(prompt).find(); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/store/InMemoryTaskStoreServiceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/store/InMemoryTaskStoreServiceImpl.java deleted file mode 100644 index 4773e1ae..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/store/InMemoryTaskStoreServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xmzs.midjourney.service.store; - -import cn.hutool.cache.CacheUtil; -import cn.hutool.cache.impl.TimedCache; -import cn.hutool.core.collection.ListUtil; -import cn.hutool.core.stream.StreamUtil; -import com.xmzs.midjourney.service.TaskStoreService; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.support.TaskCondition; - -import java.time.Duration; -import java.util.List; - - -public class InMemoryTaskStoreServiceImpl implements TaskStoreService { - private final TimedCache taskMap; - - public InMemoryTaskStoreServiceImpl(Duration timeout) { - this.taskMap = CacheUtil.newTimedCache(timeout.toMillis()); - } - - @Override - public void save(Task task) { - this.taskMap.put(task.getId(), task); - } - - @Override - public void delete(String key) { - this.taskMap.remove(key); - } - - @Override - public Task get(String key) { - return this.taskMap.get(key); - } - - @Override - public List list() { - return ListUtil.toList(this.taskMap.iterator()); - } - - @Override - public List list(TaskCondition condition) { - return StreamUtil.of(this.taskMap.iterator()).filter(condition).toList(); - } - - @Override - public Task findOne(TaskCondition condition) { - return StreamUtil.of(this.taskMap.iterator()).filter(condition).findFirst().orElse(null); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/store/RedisTaskStoreServiceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/store/RedisTaskStoreServiceImpl.java deleted file mode 100644 index ae08502b..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/store/RedisTaskStoreServiceImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.xmzs.midjourney.service.store; - -import com.xmzs.midjourney.service.TaskStoreService; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.support.TaskCondition; -import org.springframework.data.redis.core.Cursor; -import org.springframework.data.redis.core.RedisCallback; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.ScanOptions; -import org.springframework.data.redis.core.ValueOperations; - -import java.time.Duration; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - -public class RedisTaskStoreServiceImpl implements TaskStoreService { - private static final String KEY_PREFIX = "mj-task-store::"; - - private final Duration timeout; - private final RedisTemplate redisTemplate; - - public RedisTaskStoreServiceImpl(Duration timeout, RedisTemplate redisTemplate) { - this.timeout = timeout; - this.redisTemplate = redisTemplate; - } - - @Override - public void save(Task task) { - this.redisTemplate.opsForValue().set(getRedisKey(task.getId()), task, this.timeout); - } - - @Override - public void delete(String id) { - this.redisTemplate.delete(getRedisKey(id)); - } - - @Override - public Task get(String id) { - return this.redisTemplate.opsForValue().get(getRedisKey(id)); - } - - @Override - public List list() { - Set keys = this.redisTemplate.execute((RedisCallback>) connection -> { - Cursor cursor = connection.scan(ScanOptions.scanOptions().match(KEY_PREFIX + "*").count(1000).build()); - return cursor.stream().map(String::new).collect(Collectors.toSet()); - }); - if (keys == null || keys.isEmpty()) { - return Collections.emptyList(); - } - ValueOperations operations = this.redisTemplate.opsForValue(); - return keys.stream().map(operations::get) - .filter(Objects::nonNull) - .toList(); - } - - @Override - public List list(TaskCondition condition) { - return list().stream().filter(condition).toList(); - } - - @Override - public Task findOne(TaskCondition condition) { - return list().stream().filter(condition).findFirst().orElse(null); - } - - private String getRedisKey(String id) { - return KEY_PREFIX + id; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/BaiduTranslateServiceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/BaiduTranslateServiceImpl.java deleted file mode 100644 index c629ca1e..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/BaiduTranslateServiceImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.xmzs.midjourney.service.translate; - - -import cn.hutool.core.exceptions.ValidateException; -import cn.hutool.core.text.CharSequenceUtil; -import cn.hutool.core.util.RandomUtil; -import cn.hutool.crypto.digest.MD5; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.service.TranslateService; -import lombok.extern.slf4j.Slf4j; -import org.json.JSONArray; -import org.json.JSONObject; -import org.springframework.beans.factory.support.BeanDefinitionValidationException; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestTemplate; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -public class BaiduTranslateServiceImpl implements TranslateService { - private static final String TRANSLATE_API = "https://fanyi-api.baidu.com/api/trans/vip/translate"; - - private final String appid; - private final String appSecret; - - public BaiduTranslateServiceImpl(ProxyProperties.BaiduTranslateConfig translateConfig) { - this.appid = translateConfig.getAppid(); - this.appSecret = translateConfig.getAppSecret(); - if (!CharSequenceUtil.isAllNotBlank(this.appid, this.appSecret)) { - throw new BeanDefinitionValidationException("mj.baidu-translate.appid或mj.baidu-translate.app-secret未配置"); - } - } - - @Override - public String translateToEnglish(String prompt) { - if (!containsChinese(prompt)) { - return prompt; - } - String salt = RandomUtil.randomNumbers(5); - String sign = MD5.create().digestHex(this.appid + prompt + salt + this.appSecret); - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - MultiValueMap body = new LinkedMultiValueMap<>(); - body.add("from", "zh"); - body.add("to", "en"); - body.add("appid", this.appid); - body.add("salt", salt); - body.add("q", prompt); - body.add("sign", sign); - HttpEntity> requestEntity = new HttpEntity<>(body, headers); - try { - ResponseEntity responseEntity = new RestTemplate().exchange(TRANSLATE_API, HttpMethod.POST, requestEntity, String.class); - if (responseEntity.getStatusCode() != HttpStatus.OK || CharSequenceUtil.isBlank(responseEntity.getBody())) { - throw new ValidateException(responseEntity.getStatusCodeValue() + " - " + responseEntity.getBody()); - } - JSONObject result = new JSONObject(responseEntity.getBody()); - if (result.has("error_code")) { - throw new ValidateException(result.getString("error_code") + " - " + result.getString("error_msg")); - } - List strings = new ArrayList<>(); - JSONArray transResult = result.getJSONArray("trans_result"); - for (int i = 0; i < transResult.length(); i++) { - strings.add(transResult.getJSONObject(i).getString("dst")); - } - return CharSequenceUtil.join("\n", strings); - } catch (Exception e) { - log.warn("调用百度翻译失败: {}", e.getMessage()); - } - return prompt; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/GPTTranslateServiceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/GPTTranslateServiceImpl.java deleted file mode 100644 index 157fb4f6..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/GPTTranslateServiceImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.xmzs.midjourney.service.translate; - - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.service.TranslateService; -import com.unfbx.chatgpt.OpenAiClient; -import com.unfbx.chatgpt.entity.chat.ChatChoice; -import com.unfbx.chatgpt.entity.chat.ChatCompletion; -import com.unfbx.chatgpt.entity.chat.ChatCompletionResponse; -import com.unfbx.chatgpt.entity.chat.Message; -import com.unfbx.chatgpt.function.KeyRandomStrategy; -import com.unfbx.chatgpt.interceptor.OpenAILogger; -import com.unfbx.chatgpt.interceptor.OpenAiResponseInterceptor; -import lombok.extern.slf4j.Slf4j; -import okhttp3.OkHttpClient; -import okhttp3.logging.HttpLoggingInterceptor; -import org.springframework.beans.factory.support.BeanDefinitionValidationException; - -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.TimeUnit; - -@Slf4j -public class GPTTranslateServiceImpl implements TranslateService { - private final OpenAiClient openAiClient; - private final ProxyProperties.OpenaiConfig openaiConfig; - - public GPTTranslateServiceImpl(ProxyProperties properties) { - this.openaiConfig = properties.getOpenai(); - if (CharSequenceUtil.isBlank(this.openaiConfig.getGptApiKey())) { - throw new BeanDefinitionValidationException("mj.openai.gpt-api-key未配置"); - } - HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor(new OpenAILogger()); - httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS); - OkHttpClient.Builder okHttpBuilder = new OkHttpClient.Builder() - .addInterceptor(httpLoggingInterceptor) - .addInterceptor(new OpenAiResponseInterceptor()) - .connectTimeout(10, TimeUnit.SECONDS) - .writeTimeout(30, TimeUnit.SECONDS) - .readTimeout(30, TimeUnit.SECONDS); - if (CharSequenceUtil.isNotBlank(properties.getProxy().getHost())) { - Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(properties.getProxy().getHost(), properties.getProxy().getPort())); - okHttpBuilder.proxy(proxy); - } - OpenAiClient.Builder apiBuilder = OpenAiClient.builder() - .apiKey(Collections.singletonList(this.openaiConfig.getGptApiKey())) - .keyStrategy(new KeyRandomStrategy()) - .okHttpClient(okHttpBuilder.build()); - if (CharSequenceUtil.isNotBlank(this.openaiConfig.getGptApiUrl())) { - apiBuilder.apiHost(this.openaiConfig.getGptApiUrl()); - } - this.openAiClient = apiBuilder.build(); - } - - @Override - public String translateToEnglish(String prompt) { - if (!containsChinese(prompt)) { - return prompt; - } - Message m1 = Message.builder().role(Message.Role.SYSTEM).content("把中文翻译成英文").build(); - Message m2 = Message.builder().role(Message.Role.USER).content(prompt).build(); - ChatCompletion chatCompletion = ChatCompletion.builder() - .messages(Arrays.asList(m1, m2)) - .model(this.openaiConfig.getModel()) - .temperature(this.openaiConfig.getTemperature()) - .maxTokens(this.openaiConfig.getMaxTokens()) - .build(); - ChatCompletionResponse chatCompletionResponse = this.openAiClient.chatCompletion(chatCompletion); - try { - List choices = chatCompletionResponse.getChoices(); - if (!choices.isEmpty()) { - return choices.get(0).getMessage().getContent(); - } - } catch (Exception e) { - log.warn("调用chat-gpt接口翻译中文失败: {}", e.getMessage()); - } - return prompt; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/NoTranslateServiceImpl.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/NoTranslateServiceImpl.java deleted file mode 100644 index cbfc1a1f..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/service/translate/NoTranslateServiceImpl.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.midjourney.service.translate; - - -import com.xmzs.midjourney.service.TranslateService; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class NoTranslateServiceImpl implements TranslateService { - - @Override - public String translateToEnglish(String prompt) { - return prompt; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/ApiAuthorizeInterceptor.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/ApiAuthorizeInterceptor.java deleted file mode 100644 index 00e1f32f..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/ApiAuthorizeInterceptor.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.xmzs.midjourney.support; - -import com.xmzs.common.chat.constant.OpenAIConst; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.system.service.IChatService; -import com.xmzs.system.service.ISseService; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.*; -import org.springframework.stereotype.Component; -import org.springframework.util.StreamUtils; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.servlet.HandlerInterceptor; - -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.Enumeration; -import java.util.Objects; - -@Component -public class ApiAuthorizeInterceptor implements HandlerInterceptor { - private static final Logger log = LoggerFactory.getLogger(ApiAuthorizeInterceptor.class); - private static final String API_SECRET_HEADER = "mj-api-secret"; - - @Value("${chat.apiKey}") - private String API_SECRET_VALUE; - @Value("${chat.apiHost}") - private String apiHost; - - @Autowired - private RestTemplate restTemplate; - - @Autowired - private IChatService chatService; - - @Autowired - private ISseService sseService; - - @Override - public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, @NotNull Object handler) { - // 判断是否是MidJourney的请求 - if (isMidJourneyRequest(request)) { - try { - // 处理请求,例如费用扣除和任务查询 - processRequest(request); - // 转发请求到目标服务器 - forwardRequest(request, response); - } catch (Exception e) { - // 记录错误日志,包括异常堆栈信息 - log.error("转发请求时发生错误", e); - // 设置HTTP状态码和响应信息 - response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); - response.setCharacterEncoding(StandardCharsets.UTF_8.name()); - response.setContentType(MediaType.APPLICATION_JSON_VALUE); - try { - // 向客户端返回错误信息 - response.getWriter().write("绘图失败!" + e.getMessage()); - } catch (Exception ex) { - log.error("设置错误响应时发生错误", ex); - } - // 中断请求处理流程 - return false; - } - // 中断正常的请求处理流程,因为请求已被转发 - return false; - } - // 如果不是MidJourney的请求,则继续正常处理 - return true; - } - - private boolean isMidJourneyRequest(HttpServletRequest request) { - String uri = request.getRequestURI(); - return uri.startsWith("/mj") && - !uri.matches(".*/\\d+/fetch") && - !uri.matches("/mj/insight-face/swap") && - !uri.matches("/mj/submit/action"); - } - - private void processRequest(HttpServletRequest request) { - // 处理付费用户的请求,包括费用扣除和任务查询 - sseService.checkUserGrade(); - String uri = request.getRequestURI(); - if (uri.matches("/mj/submit/describe") || uri.matches("/mj/submit/shorten")) { - chatService.mjTaskDeduct(uri.endsWith("describe") ? "图生文" : "prompt分析", OpenAIConst.MJ_COST_TYPE2); - } else if (uri.endsWith("image-seed") || uri.endsWith("list-by-condition")) { - chatService.mjTaskDeduct(uri.endsWith("image-seed") ? "获取种子" : "任务查询", OpenAIConst.MJ_COST_TYPE3); - } else if (uri.matches("/mj/submit/.*")) { - chatService.mjTaskDeduct("文生图", OpenAIConst.MJ_COST_TYPE1); - } - } - - private void forwardRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { - String targetUrl = buildTargetUrl(request); - HttpEntity entity = new HttpEntity<>(readRequestBody(request), copyHeaders(request)); - HttpMethod method = HttpMethod.valueOf(request.getMethod()); - ResponseEntity responseEntity = restTemplate.exchange(targetUrl, method, entity, byte[].class); - copyResponseBack(response, responseEntity); - } - - private String buildTargetUrl(HttpServletRequest request) { - String uri = request.getRequestURI(); - String queryString = request.getQueryString(); - log.info("Forwarding URL: {}", uri); - return apiHost + uri + (queryString != null ? "?" + queryString : ""); - } - - private HttpHeaders copyHeaders(HttpServletRequest request) { - HttpHeaders headers = new HttpHeaders(); - headers.set(API_SECRET_HEADER, API_SECRET_VALUE); - Enumeration headerNames = request.getHeaderNames(); - while (headerNames.hasMoreElements()) { - String headerName = headerNames.nextElement(); - if (!headerName.equalsIgnoreCase(API_SECRET_HEADER) && - !headerName.equalsIgnoreCase(HttpHeaders.CONTENT_LENGTH) && - !headerName.equalsIgnoreCase(HttpHeaders.AUTHORIZATION)) { - headers.set(headerName, request.getHeader(headerName)); - } - } - return headers; - } - - private String readRequestBody(HttpServletRequest request) throws Exception { - if (request.getContentLengthLong() > 0) { - try (InputStream inputStream = request.getInputStream()) { - return StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8); - } - } - return ""; - } - - private void copyResponseBack(HttpServletResponse response, ResponseEntity responseEntity) throws Exception { - HttpHeaders responseHeaders = responseEntity.getHeaders(); - responseHeaders.forEach((key, values) -> { - if (!key.equalsIgnoreCase(API_SECRET_HEADER)) { - response.addHeader(key, String.join(",", values)); - } - }); - // 设置响应内容类型为UTF-8,防止乱码 - response.setContentType(MediaType.APPLICATION_JSON_VALUE); - response.setCharacterEncoding(StandardCharsets.UTF_8.name()); - HttpStatus status = HttpStatus.resolve(responseEntity.getStatusCode().value()); - response.setStatus(Objects.requireNonNullElse(status, HttpStatus.INTERNAL_SERVER_ERROR).value()); - if (responseEntity.getBody() != null) { - StreamUtils.copy(responseEntity.getBody(), response.getOutputStream()); - } - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordAccountHelper.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordAccountHelper.java deleted file mode 100644 index adaf8697..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordAccountHelper.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xmzs.midjourney.support; - - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.Constants; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.domain.DiscordAccount; -import com.xmzs.midjourney.loadbalancer.DiscordInstance; -import com.xmzs.midjourney.loadbalancer.DiscordInstanceImpl; -import com.xmzs.midjourney.service.NotifyService; -import com.xmzs.midjourney.service.TaskStoreService; -import com.xmzs.midjourney.wss.handle.MessageHandler; -import com.xmzs.midjourney.wss.user.UserMessageListener; -import com.xmzs.midjourney.wss.user.UserWebSocketStarter; -import lombok.RequiredArgsConstructor; -import org.springframework.web.client.RestTemplate; - -import java.util.List; -import java.util.Map; - -@RequiredArgsConstructor -public class DiscordAccountHelper { - private final DiscordHelper discordHelper; - private final ProxyProperties properties; - private final RestTemplate restTemplate; - private final TaskStoreService taskStoreService; - private final NotifyService notifyService; - private final List messageHandlers; - private final Map paramsMap; - - public DiscordInstance createDiscordInstance(DiscordAccount account) { - if (!CharSequenceUtil.isAllNotBlank(account.getGuildId(), account.getChannelId(), account.getUserToken())) { - throw new IllegalArgumentException("guildId, channelId, userToken must not be blank"); - } - if (CharSequenceUtil.isBlank(account.getUserAgent())) { - account.setUserAgent(Constants.DEFAULT_DISCORD_USER_AGENT); - } - var messageListener = new UserMessageListener(account, this.messageHandlers); - var webSocketStarter = new UserWebSocketStarter(this.discordHelper.getWss(), account, messageListener, this.properties.getProxy()); - return new DiscordInstanceImpl(account, webSocketStarter, this.restTemplate, - this.taskStoreService, this.notifyService, this.paramsMap); - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordAccountInitializer.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordAccountInitializer.java deleted file mode 100644 index bc9ddfa3..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordAccountInitializer.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.xmzs.midjourney.support; - - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.exceptions.ValidateException; -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.ReturnCode; -import com.xmzs.midjourney.domain.DiscordAccount; -import com.xmzs.midjourney.loadbalancer.DiscordInstance; -import com.xmzs.midjourney.loadbalancer.DiscordLoadBalancer; -import com.xmzs.midjourney.util.AsyncLockUtils; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.util.Strings; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.stereotype.Component; - -import java.time.Duration; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -@Slf4j -@Component -@RequiredArgsConstructor -public class DiscordAccountInitializer implements ApplicationRunner { - private final DiscordLoadBalancer discordLoadBalancer; - private final DiscordAccountHelper discordAccountHelper; - private final ProxyProperties properties; - - @Override - public void run(ApplicationArguments args) throws Exception { - ProxyProperties.ProxyConfig proxy = this.properties.getProxy(); - if (Strings.isNotBlank(proxy.getHost())) { - System.setProperty("http.proxyHost", proxy.getHost()); - System.setProperty("http.proxyPort", String.valueOf(proxy.getPort())); - System.setProperty("https.proxyHost", proxy.getHost()); - System.setProperty("https.proxyPort", String.valueOf(proxy.getPort())); - } - - List configAccounts = this.properties.getAccounts(); - if (CharSequenceUtil.isNotBlank(this.properties.getDiscord().getChannelId())) { - configAccounts.add(this.properties.getDiscord()); - } - List instances = this.discordLoadBalancer.getAllInstances(); - for (ProxyProperties.DiscordAccountConfig configAccount : configAccounts) { - DiscordAccount account = new DiscordAccount(); - BeanUtil.copyProperties(configAccount, account); - account.setId(configAccount.getChannelId()); - try { - DiscordInstance instance = this.discordAccountHelper.createDiscordInstance(account); - if (!account.isEnable()) { - continue; - } - instance.startWss(); - AsyncLockUtils.LockObject lock = AsyncLockUtils.waitForLock("wss:" + account.getChannelId(), Duration.ofSeconds(10)); - if (ReturnCode.SUCCESS != lock.getProperty("code", Integer.class, 0)) { - throw new ValidateException(lock.getProperty("description", String.class)); - } - instances.add(instance); - } catch (Exception e) { - log.error("Account({}) init fail, disabled: {}", account.getDisplay(), e.getMessage()); - account.setEnable(false); - } - } - Set enableInstanceIds = instances.stream().filter(DiscordInstance::isAlive).map(DiscordInstance::getInstanceId).collect(Collectors.toSet()); - log.info("当前可用账号数 [{}] - {}", enableInstanceIds.size(), String.join(", ", enableInstanceIds)); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordHelper.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordHelper.java deleted file mode 100644 index b2c8e325..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/DiscordHelper.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.xmzs.midjourney.support; - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.ProxyProperties; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Component; - -@Component -@RequiredArgsConstructor -public class DiscordHelper { - private final ProxyProperties properties; - /** - * DISCORD_SERVER_URL. - */ - public static final String DISCORD_SERVER_URL = "https://discord.com"; - /** - * DISCORD_CDN_URL. - */ - public static final String DISCORD_CDN_URL = "https://cdn.discordapp.com"; - /** - * DISCORD_WSS_URL. - */ - public static final String DISCORD_WSS_URL = "wss://gateway.discord.gg"; - /** - * DISCORD_UPLOAD_URL. - */ - public static final String DISCORD_UPLOAD_URL = "https://discord-attachments-uploads-prd.storage.googleapis.com"; - - public String getServer() { - if (CharSequenceUtil.isBlank(this.properties.getNgDiscord().getServer())) { - return DISCORD_SERVER_URL; - } - String serverUrl = this.properties.getNgDiscord().getServer(); - if (serverUrl.endsWith("/")) { - serverUrl = serverUrl.substring(0, serverUrl.length() - 1); - } - return serverUrl; - } - - public String getCdn() { - if (CharSequenceUtil.isBlank(this.properties.getNgDiscord().getCdn())) { - return DISCORD_CDN_URL; - } - String cdnUrl = this.properties.getNgDiscord().getCdn(); - if (cdnUrl.endsWith("/")) { - cdnUrl = cdnUrl.substring(0, cdnUrl.length() - 1); - } - return cdnUrl; - } - - public String getWss() { - if (CharSequenceUtil.isBlank(this.properties.getNgDiscord().getWss())) { - return DISCORD_WSS_URL; - } - String wssUrl = this.properties.getNgDiscord().getWss(); - if (wssUrl.endsWith("/")) { - wssUrl = wssUrl.substring(0, wssUrl.length() - 1); - } - return wssUrl; - } - - public String getDiscordUploadUrl(String uploadUrl) { - if (CharSequenceUtil.isBlank(this.properties.getNgDiscord().getUploadServer()) || CharSequenceUtil.isBlank(uploadUrl)) { - return uploadUrl; - } - String uploadServer = this.properties.getNgDiscord().getUploadServer(); - if (uploadServer.endsWith("/")) { - uploadServer = uploadServer.substring(0, uploadServer.length() - 1); - } - return uploadUrl.replaceFirst(DISCORD_UPLOAD_URL, uploadServer); - } - - public String findTaskIdWithCdnUrl(String url) { - if (!CharSequenceUtil.startWith(url, DISCORD_CDN_URL)) { - return null; - } - int hashStartIndex = url.lastIndexOf("/"); - String taskId = CharSequenceUtil.subBefore(url.substring(hashStartIndex + 1), ".", true); - if (CharSequenceUtil.length(taskId) == 16) { - return taskId; - } - return null; - } - - public String getMessageHash(String imageUrl) { - if (CharSequenceUtil.isBlank(imageUrl)) { - return null; - } - if (CharSequenceUtil.endWith(imageUrl, "_grid_0.webp")) { - int hashStartIndex = imageUrl.lastIndexOf("/"); - if (hashStartIndex < 0) { - return null; - } - return CharSequenceUtil.sub(imageUrl, hashStartIndex + 1, imageUrl.length() - "_grid_0.webp".length()); - } - int hashStartIndex = imageUrl.lastIndexOf("_"); - if (hashStartIndex < 0) { - return null; - } - return CharSequenceUtil.subBefore(imageUrl.substring(hashStartIndex + 1), ".", true); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/SpringContextHolder.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/SpringContextHolder.java deleted file mode 100644 index 5f0b1db7..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/SpringContextHolder.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.midjourney.support; - -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.stereotype.Component; - -@Component -public class SpringContextHolder implements ApplicationContextAware { - private static ApplicationContext APPLICATION_CONTEXT; - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - APPLICATION_CONTEXT = applicationContext; - } - - public static ApplicationContext getApplicationContext() { - if (APPLICATION_CONTEXT == null) { - throw new IllegalStateException("SpringContextHolder is not ready."); - } - return APPLICATION_CONTEXT; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/Task.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/Task.java deleted file mode 100644 index afe49f23..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/Task.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.xmzs.midjourney.support; - -import com.xmzs.midjourney.domain.DomainObject; -import com.xmzs.midjourney.enums.TaskAction; -import com.xmzs.midjourney.enums.TaskStatus; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serial; - -@Data -@EqualsAndHashCode(callSuper = true) -@ApiModel("任务") -public class Task extends DomainObject { - @Serial - private static final long serialVersionUID = -674915748204390789L; - - @ApiModelProperty("任务类型") - private TaskAction action; - @ApiModelProperty("任务状态") - private TaskStatus status = TaskStatus.NOT_START; - - @ApiModelProperty("提示词") - private String prompt; - @ApiModelProperty("提示词-英文") - private String promptEn; - - @ApiModelProperty("任务描述") - private String description; - @ApiModelProperty("自定义参数") - private String state; - - @ApiModelProperty("提交时间") - private Long submitTime; - @ApiModelProperty("开始执行时间") - private Long startTime; - @ApiModelProperty("结束时间") - private Long finishTime; - - @ApiModelProperty("图片url") - private String imageUrl; - - @ApiModelProperty("任务进度") - private String progress; - @ApiModelProperty("失败原因") - private String failReason; - - public void start() { - this.startTime = System.currentTimeMillis(); - this.status = TaskStatus.SUBMITTED; - this.progress = "0%"; - } - - public void success() { - this.finishTime = System.currentTimeMillis(); - this.status = TaskStatus.SUCCESS; - this.progress = "100%"; - } - - public void fail(String reason) { - this.finishTime = System.currentTimeMillis(); - this.status = TaskStatus.FAILURE; - this.failReason = reason; - this.progress = ""; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/TaskCondition.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/TaskCondition.java deleted file mode 100644 index 34f47d12..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/TaskCondition.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.xmzs.midjourney.support; - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.Constants; -import com.xmzs.midjourney.enums.TaskAction; -import com.xmzs.midjourney.enums.TaskStatus; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Set; -import java.util.function.Predicate; - - -@Data -@Accessors(chain = true) -public class TaskCondition implements Predicate { - private String id; - - private Set statusSet; - private Set actionSet; - - private String prompt; - private String promptEn; - private String description; - - private String finalPromptEn; - private String messageId; - private String messageHash; - private String progressMessageId; - private String nonce; - - @Override - public boolean test(Task task) { - if (task == null) { - return false; - } - if (CharSequenceUtil.isNotBlank(this.id) && !this.id.equals(task.getId())) { - return false; - } - if (this.statusSet != null && !this.statusSet.isEmpty() && !this.statusSet.contains(task.getStatus())) { - return false; - } - if (this.actionSet != null && !this.actionSet.isEmpty() && !this.actionSet.contains(task.getAction())) { - return false; - } - if (CharSequenceUtil.isNotBlank(this.prompt) && !this.prompt.equals(task.getPrompt())) { - return false; - } - if (CharSequenceUtil.isNotBlank(this.promptEn) && !this.promptEn.equals(task.getPromptEn())) { - return false; - } - if (CharSequenceUtil.isNotBlank(this.description) && !CharSequenceUtil.contains(task.getDescription(), this.description)) { - return false; - } - - if (CharSequenceUtil.isNotBlank(this.finalPromptEn) && !this.finalPromptEn.equals(task.getProperty(Constants.TASK_PROPERTY_FINAL_PROMPT))) { - return false; - } - if (CharSequenceUtil.isNotBlank(this.messageId) && !this.messageId.equals(task.getProperty(Constants.TASK_PROPERTY_MESSAGE_ID))) { - return false; - } - if (CharSequenceUtil.isNotBlank(this.messageHash) && !this.messageHash.equals(task.getProperty(Constants.TASK_PROPERTY_MESSAGE_HASH))) { - return false; - } - if (CharSequenceUtil.isNotBlank(this.progressMessageId) && !this.progressMessageId.equals(task.getProperty(Constants.TASK_PROPERTY_PROGRESS_MESSAGE_ID))) { - return false; - } - if (CharSequenceUtil.isNotBlank(this.nonce) && !this.nonce.equals(task.getProperty(Constants.TASK_PROPERTY_NONCE))) { - return false; - } - return true; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/TaskTimeoutSchedule.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/TaskTimeoutSchedule.java deleted file mode 100644 index e4443db0..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/support/TaskTimeoutSchedule.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.xmzs.midjourney.support; - -import com.xmzs.midjourney.enums.TaskStatus; -import com.xmzs.midjourney.loadbalancer.DiscordLoadBalancer; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TaskTimeoutSchedule { - private final DiscordLoadBalancer discordLoadBalancer; - - @Scheduled(fixedRate = 30000L) - public void checkTasks() { - this.discordLoadBalancer.getAliveInstances().forEach(instance -> { - long timeout = TimeUnit.MINUTES.toMillis(instance.account().getTimeoutMinutes()); - List tasks = instance.getRunningTasks().stream() - .filter(t -> System.currentTimeMillis() - t.getStartTime() > timeout) - .toList(); - for (Task task : tasks) { - if (Set.of(TaskStatus.FAILURE, TaskStatus.SUCCESS).contains(task.getStatus())) { - log.warn("task status is failure/success but is in the queue, end it. id: {}", task.getId()); - } else { - log.debug("task timeout, id: {}", task.getId()); - task.fail("任务超时"); - } - instance.exitTask(task); - } - }); - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/AsyncLockUtils.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/AsyncLockUtils.java deleted file mode 100644 index 067869d9..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/AsyncLockUtils.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.xmzs.midjourney.util; - -import cn.hutool.cache.CacheUtil; -import cn.hutool.cache.impl.TimedCache; -import cn.hutool.core.thread.ThreadUtil; -import com.xmzs.midjourney.domain.DomainObject; -import lombok.experimental.UtilityClass; - -import java.time.Duration; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -@UtilityClass -public class AsyncLockUtils { - private static final TimedCache LOCK_MAP = CacheUtil.newTimedCache(Duration.ofDays(1).toMillis()); - - public static synchronized LockObject getLock(String key) { - return LOCK_MAP.get(key); - } - - public static LockObject waitForLock(String key, Duration duration) throws TimeoutException { - LockObject lockObject; - synchronized (LOCK_MAP) { - if (!LOCK_MAP.containsKey(key)) { - LOCK_MAP.put(key, new LockObject(key)); - } - lockObject = LOCK_MAP.get(key); - } - Future future = ThreadUtil.execAsync(() -> { - try { - lockObject.sleep(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - }); - try { - future.get(duration.toMillis(), TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } catch (ExecutionException e) { - // do nothing - } catch (TimeoutException e) { - future.cancel(true); - throw new TimeoutException("Wait Timeout"); - } finally { - LOCK_MAP.remove(lockObject.getId()); - } - return lockObject; - } - - public static class LockObject extends DomainObject { - - public LockObject(String id) { - this.id = id; - } - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/BannedPromptUtils.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/BannedPromptUtils.java deleted file mode 100644 index 6d2ec05e..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/BannedPromptUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xmzs.midjourney.util; - -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.exception.BannedPromptException; -import lombok.experimental.UtilityClass; - -import java.io.File; -import java.nio.charset.StandardCharsets; -import java.util.List; -import java.util.Locale; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -@UtilityClass -public class BannedPromptUtils { - private static final String BANNED_WORDS_FILE_PATH = "/home/spring/config/banned-words.txt"; - private final List BANNED_WORDS; - - static { - List lines; - File file = new File(BANNED_WORDS_FILE_PATH); - if (file.exists()) { - lines = FileUtil.readLines(file, StandardCharsets.UTF_8); - } else { - var resource = BannedPromptUtils.class.getResource("/banned-words.txt"); - lines = FileUtil.readLines(resource, StandardCharsets.UTF_8); - } - BANNED_WORDS = lines.stream().filter(CharSequenceUtil::isNotBlank).toList(); - } - - public static void checkBanned(String promptEn) throws BannedPromptException { - String finalPromptEn = promptEn.toLowerCase(Locale.ENGLISH); - for (String word : BANNED_WORDS) { - Matcher matcher = Pattern.compile("\\b" + word + "\\b").matcher(finalPromptEn); - if (matcher.find()) { - int index = CharSequenceUtil.indexOfIgnoreCase(promptEn, word); - throw new BannedPromptException(promptEn.substring(index, index + word.length())); - } - } - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/ContentParseData.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/ContentParseData.java deleted file mode 100644 index 81ca7a69..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/ContentParseData.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.xmzs.midjourney.util; - -import lombok.Data; - -@Data -public class ContentParseData { - protected String prompt; - protected String status; -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/ConvertUtils.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/ConvertUtils.java deleted file mode 100644 index 070c74ee..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/ConvertUtils.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.xmzs.midjourney.util; - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.enums.TaskAction; -import eu.maxschuster.dataurl.DataUrl; -import eu.maxschuster.dataurl.DataUrlSerializer; -import eu.maxschuster.dataurl.IDataUrlSerializer; -import lombok.experimental.UtilityClass; - -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -@UtilityClass -public class ConvertUtils { - /** - * content正则匹配prompt和进度. - */ - public static final String CONTENT_REGEX = ".*?\\*\\*(.*?)\\*\\*.+<@\\d+> \\((.*?)\\)"; - - public static ContentParseData parseContent(String content) { - return parseContent(content, CONTENT_REGEX); - } - - public static ContentParseData parseContent(String content, String regex) { - if (CharSequenceUtil.isBlank(content)) { - return null; - } - Matcher matcher = Pattern.compile(regex).matcher(content); - if (!matcher.find()) { - return null; - } - ContentParseData parseData = new ContentParseData(); - parseData.setPrompt(matcher.group(1)); - parseData.setStatus(matcher.group(2)); - return parseData; - } - - public static List convertBase64Array(List base64Array) throws MalformedURLException { - if (base64Array == null || base64Array.isEmpty()) { - return Collections.emptyList(); - } - IDataUrlSerializer serializer = new DataUrlSerializer(); - List dataUrlList = new ArrayList<>(); - for (String base64 : base64Array) { - DataUrl dataUrl = serializer.unserialize(base64); - dataUrlList.add(dataUrl); - } - return dataUrlList; - } - - public static TaskChangeParams convertChangeParams(String content) { - List split = CharSequenceUtil.split(content, " "); - if (split.size() != 2) { - return null; - } - String action = split.get(1).toLowerCase(); - TaskChangeParams changeParams = new TaskChangeParams(); - changeParams.setId(split.get(0)); - if (action.charAt(0) == 'u') { - changeParams.setAction(TaskAction.UPSCALE); - } else if (action.charAt(0) == 'v') { - changeParams.setAction(TaskAction.VARIATION); - } else if (action.equals("r")) { - changeParams.setAction(TaskAction.REROLL); - return changeParams; - } else { - return null; - } - try { - int index = Integer.parseInt(action.substring(1, 2)); - if (index < 1 || index > 4) { - return null; - } - changeParams.setIndex(index); - } catch (Exception e) { - return null; - } - return changeParams; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/MimeTypeUtils.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/MimeTypeUtils.java deleted file mode 100644 index 70809949..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/MimeTypeUtils.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.xmzs.midjourney.util; - -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.text.CharSequenceUtil; -import lombok.experimental.UtilityClass; - -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@UtilityClass -public class MimeTypeUtils { - private final Map> MIME_TYPE_MAP; - - static { - MIME_TYPE_MAP = new HashMap<>(); - var resource = MimeTypeUtils.class.getResource("/mime.types"); - var lines = FileUtil.readLines(resource, StandardCharsets.UTF_8); - for (var line : lines) { - if (CharSequenceUtil.isBlank(line)) { - continue; - } - var arr = line.split(":"); - MIME_TYPE_MAP.put(arr[0], CharSequenceUtil.split(arr[1], ' ')); - } - } - - public static String guessFileSuffix(String mimeType) { - if (CharSequenceUtil.isBlank(mimeType)) { - return null; - } - String key = mimeType; - if (!MIME_TYPE_MAP.containsKey(key)) { - key = MIME_TYPE_MAP.keySet().stream().filter(k -> CharSequenceUtil.startWithIgnoreCase(mimeType, k)) - .findFirst().orElse(null); - } - var suffixList = MIME_TYPE_MAP.get(key); - if (suffixList == null || suffixList.isEmpty()) { - return null; - } - return suffixList.iterator().next(); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/SnowFlake.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/SnowFlake.java deleted file mode 100644 index f78cb875..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/SnowFlake.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.xmzs.midjourney.util; - -import cn.hutool.core.exceptions.ValidateException; -import com.xmzs.midjourney.exception.SnowFlakeException; -import lombok.extern.slf4j.Slf4j; - -import java.lang.management.ManagementFactory; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.util.Date; -import java.util.concurrent.ThreadLocalRandom; - -@Slf4j -public class SnowFlake { - private long workerId; - private long datacenterId; - private long sequence = 0L; - private final long twepoch; - private final long sequenceMask; - private final long workerIdShift; - private final long datacenterIdShift; - private final long timestampLeftShift; - private long lastTimestamp = -1L; - private final boolean randomSequence; - private long count = 0L; - private final long timeOffset; - private final ThreadLocalRandom tlr = ThreadLocalRandom.current(); - - public static final SnowFlake INSTANCE = new SnowFlake(); - - private SnowFlake() { - this(false, 10, null, 5L, 5L, 12L); - } - - private SnowFlake(boolean randomSequence, long timeOffset, Date epochDate, long workerIdBits, long datacenterIdBits, long sequenceBits) { - if (null != epochDate) { - this.twepoch = epochDate.getTime(); - } else { - // 2012/12/12 23:59:59 GMT - this.twepoch = 1355327999000L; - } - long maxWorkerId = ~(-1L << workerIdBits); - long maxDatacenterId = ~(-1L << datacenterIdBits); - this.sequenceMask = ~(-1L << sequenceBits); - this.workerIdShift = sequenceBits; - this.datacenterIdShift = sequenceBits + workerIdBits; - this.timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; - this.randomSequence = randomSequence; - this.timeOffset = timeOffset; - try { - this.datacenterId = getDatacenterId(maxDatacenterId); - this.workerId = getMaxWorkerId(datacenterId, maxWorkerId); - } catch (Exception e) { - log.warn("datacenterId or workerId generate error: {}, set default value", e.getMessage()); - this.datacenterId = 4; - this.workerId = 1; - } - } - - public synchronized String nextId() { - long currentTimestamp = timeGen(); - if (currentTimestamp < this.lastTimestamp) { - long offset = this.lastTimestamp - currentTimestamp; - if (offset > this.timeOffset) { - throw new ValidateException("Clock moved backwards, refusing to generate id for [" + offset + "ms]"); - } - try { - this.wait(offset << 1); - } catch (InterruptedException e) { - throw new SnowFlakeException(e); - } - currentTimestamp = timeGen(); - if (currentTimestamp < this.lastTimestamp) { - throw new SnowFlakeException("Clock moved backwards, refusing to generate id for [" + offset + "ms]"); - } - } - if (this.lastTimestamp == currentTimestamp) { - long tempSequence = this.sequence + 1; - if (this.randomSequence) { - this.sequence = tempSequence & this.sequenceMask; - this.count = (this.count + 1) & this.sequenceMask; - if (this.count == 0) { - currentTimestamp = this.tillNextMillis(this.lastTimestamp); - } - } else { - this.sequence = tempSequence & this.sequenceMask; - if (this.sequence == 0) { - currentTimestamp = this.tillNextMillis(lastTimestamp); - } - } - } else { - this.sequence = this.randomSequence ? this.tlr.nextLong(this.sequenceMask + 1) : 0L; - this.count = 0L; - } - this.lastTimestamp = currentTimestamp; - long id = ((currentTimestamp - this.twepoch) << this.timestampLeftShift) | - (this.datacenterId << this.datacenterIdShift) | - (this.workerId << this.workerIdShift) | - this.sequence; - return String.valueOf(id); - } - - private static long getDatacenterId(long maxDatacenterId) { - long id = 0L; - try { - InetAddress ip = InetAddress.getLocalHost(); - NetworkInterface network = NetworkInterface.getByInetAddress(ip); - if (network == null) { - id = 1L; - } else { - byte[] mac = network.getHardwareAddress(); - if (null != mac) { - id = ((0x000000FF & (long) mac[mac.length - 1]) | (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6; - id = id % (maxDatacenterId + 1); - } - } - } catch (Exception e) { - throw new SnowFlakeException(e); - } - return id; - } - - private static long getMaxWorkerId(long datacenterId, long maxWorkerId) { - StringBuilder macIpPid = new StringBuilder(); - macIpPid.append(datacenterId); - try { - String name = ManagementFactory.getRuntimeMXBean().getName(); - if (name != null && !name.isEmpty()) { - macIpPid.append(name.split("@")[0]); - } - String hostIp = InetAddress.getLocalHost().getHostAddress(); - String ipStr = hostIp.replace("\\.", ""); - macIpPid.append(ipStr); - } catch (Exception e) { - throw new SnowFlakeException(e); - } - return (macIpPid.toString().hashCode() & 0xffff) % (maxWorkerId + 1); - } - - private long tillNextMillis(long lastTimestamp) { - long timestamp = timeGen(); - while (timestamp <= lastTimestamp) { - timestamp = timeGen(); - } - return timestamp; - } - - private long timeGen() { - return System.currentTimeMillis(); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/TaskChangeParams.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/TaskChangeParams.java deleted file mode 100644 index 99a34ebb..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/TaskChangeParams.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.xmzs.midjourney.util; - -import com.xmzs.midjourney.enums.TaskAction; -import lombok.Data; - -@Data -public class TaskChangeParams { - private String id; - private TaskAction action; - private Integer index; -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/UVContentParseData.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/UVContentParseData.java deleted file mode 100644 index 1bb76d69..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/UVContentParseData.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.xmzs.midjourney.util; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@Data -@EqualsAndHashCode(callSuper = true) -public class UVContentParseData extends ContentParseData { - protected Integer index; -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/WebSocketStarter.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/WebSocketStarter.java deleted file mode 100644 index 89c09f05..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/WebSocketStarter.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.midjourney.wss; - -import com.xmzs.midjourney.ProxyProperties; -import com.neovisionaries.ws.client.ProxySettings; -import com.neovisionaries.ws.client.WebSocketFactory; -import org.apache.logging.log4j.util.Strings; - -public interface WebSocketStarter { - - void setTrying(boolean trying); - - void start() throws Exception; - - default WebSocketFactory createWebSocketFactory(ProxyProperties.ProxyConfig proxy) { - WebSocketFactory webSocketFactory = new WebSocketFactory().setConnectionTimeout(10000); - if (Strings.isNotBlank(proxy.getHost())) { - ProxySettings proxySettings = webSocketFactory.getProxySettings(); - proxySettings.setHost(proxy.getHost()); - proxySettings.setPort(proxy.getPort()); - } - return webSocketFactory; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/BlendSuccessHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/BlendSuccessHandler.java deleted file mode 100644 index 663422b8..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/BlendSuccessHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - - -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.enums.TaskAction; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.support.TaskCondition; -import com.xmzs.midjourney.util.ContentParseData; -import com.xmzs.midjourney.util.ConvertUtils; -import net.dv8tion.jda.api.utils.data.DataObject; -import org.springframework.stereotype.Component; - -import java.util.Optional; -import java.util.Set; - -/** - * blend消息处理. - * 完成(create): ** --v 5.1** - <@1012983546824114217> (relaxed) - */ -@Component -public class BlendSuccessHandler extends MessageHandler { - - @Override - public void handle(MessageType messageType, DataObject message) { - String content = getMessageContent(message); - ContentParseData parseData = ConvertUtils.parseContent(content); - if (parseData == null || !MessageType.CREATE.equals(messageType)) { - return; - } - Optional interaction = message.optObject("interaction"); - if (interaction.isPresent() && "blend".equals(interaction.get().getString("name"))) { - // blend任务开始时,设置prompt - Task task = this.discordLoadBalancer.getRunningTaskByNonce(getMessageNonce(message)); - if (task != null) { - task.setPromptEn(parseData.getPrompt()); - task.setPrompt(parseData.getPrompt()); - } - } - if (hasImage(message)) { - TaskCondition condition = new TaskCondition() - .setActionSet(Set.of(TaskAction.BLEND)) - .setFinalPromptEn(parseData.getPrompt()); - findAndFinishImageTask(condition, parseData.getPrompt(), message); - } - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/DescribeSuccessHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/DescribeSuccessHandler.java deleted file mode 100644 index 4d5b6b8f..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/DescribeSuccessHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - -import com.xmzs.midjourney.Constants; -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.support.Task; -import net.dv8tion.jda.api.utils.data.DataArray; -import net.dv8tion.jda.api.utils.data.DataObject; -import org.springframework.stereotype.Component; - -import java.util.Optional; - -/** - * describe消息处理. - */ -@Component -public class DescribeSuccessHandler extends MessageHandler { - - @Override - public void handle(MessageType messageType, DataObject message) { - Optional interaction = message.optObject("interaction"); - if (!MessageType.UPDATE.equals(messageType) || interaction.isEmpty() || !"describe".equals(interaction.get().getString("name"))) { - return; - } - DataArray embeds = message.getArray("embeds"); - if (embeds.isEmpty()) { - return; - } - String description = embeds.getObject(0).getString("description"); - Optional imageOptional = embeds.getObject(0).optObject("image"); - if (imageOptional.isEmpty()) { - return; - } - String imageUrl = imageOptional.get().getString("url"); - String taskId = this.discordHelper.findTaskIdWithCdnUrl(imageUrl); - Task task = this.discordLoadBalancer.getRunningTask(taskId); - if (task == null) { - return; - } - task.setPrompt(description); - task.setPromptEn(description); - task.setProperty(Constants.TASK_PROPERTY_FINAL_PROMPT, description); - task.setImageUrl(replaceCdnUrl(imageUrl)); - finishTask(task, message); - task.awake(); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/ErrorMessageHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/ErrorMessageHandler.java deleted file mode 100644 index 15fda360..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/ErrorMessageHandler.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.enums.TaskStatus; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.support.TaskCondition; -import lombok.extern.slf4j.Slf4j; -import net.dv8tion.jda.api.utils.data.DataArray; -import net.dv8tion.jda.api.utils.data.DataObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.Optional; -import java.util.Set; - -@Slf4j -@Component -public class ErrorMessageHandler extends MessageHandler { - @Autowired - protected ProxyProperties properties; - - @Override - public void handle(MessageType messageType, DataObject message) { - Optional embedsOptional = message.optArray("embeds"); - if (!MessageType.CREATE.equals(messageType) || embedsOptional.isEmpty() || embedsOptional.get().isEmpty()) { - return; - } - DataObject embed = embedsOptional.get().getObject(0); - String title = embed.getString("title", null); - String description = embed.getString("description", null); - String footerText = ""; - Optional footer = embed.optObject("footer"); - if (footer.isPresent()) { - footerText = footer.get().getString("text", ""); - } - String channelId = message.getString("channel_id", ""); - int color = embed.getInt("color", 0); - if (color == 16239475) { - log.warn("{} - MJ警告信息: {}\n{}\nfooter: {}", channelId, title, description, footerText); - } else if (color == 16711680) { - log.error("{} - MJ异常信息: {}\n{}\nfooter: {}", channelId, title, description, footerText); - String nonce = getMessageNonce(message); - Task task = this.discordLoadBalancer.getRunningTaskByNonce(nonce); - if (task != null) { - task.fail("[" + title + "] " + description); - task.awake(); - } - } else if (CharSequenceUtil.contains(title, "Invalid link")) { - // 兼容 Invalid link! 错误 - log.error("{} - MJ异常信息: {}\n{}\nfooter: {}", channelId, title, description, footerText); - DataObject messageReference = message.optObject("message_reference").orElse(DataObject.empty()); - String referenceMessageId = messageReference.getString("message_id", ""); - if (CharSequenceUtil.isBlank(referenceMessageId)) { - return; - } - TaskCondition condition = new TaskCondition().setStatusSet(Set.of(TaskStatus.IN_PROGRESS)) - .setProgressMessageId(referenceMessageId); - Task task = this.discordLoadBalancer.findRunningTask(condition).findFirst().orElse(null); - if (task != null) { - task.fail("[" + title + "] " + description); - task.awake(); - } - } - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/ImagineSuccessHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/ImagineSuccessHandler.java deleted file mode 100644 index f3704026..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/ImagineSuccessHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - - -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.enums.TaskAction; -import com.xmzs.midjourney.support.TaskCondition; -import com.xmzs.midjourney.util.ContentParseData; -import com.xmzs.midjourney.util.ConvertUtils; -import net.dv8tion.jda.api.utils.data.DataObject; -import org.springframework.stereotype.Component; - -import java.util.Set; - -/** - * imagine消息处理. - * 完成(create): **cat** - <@1012983546824114217> (relaxed) - */ -@Component -public class ImagineSuccessHandler extends MessageHandler { - private static final String CONTENT_REGEX = "\\*\\*(.*?)\\*\\* - <@\\d+> \\((.*?)\\)"; - - @Override - public void handle(MessageType messageType, DataObject message) { - String content = getMessageContent(message); - ContentParseData parseData = ConvertUtils.parseContent(content, CONTENT_REGEX); - if (MessageType.CREATE.equals(messageType) && parseData != null && hasImage(message)) { - TaskCondition condition = new TaskCondition() - .setActionSet(Set.of(TaskAction.IMAGINE)) - .setFinalPromptEn(parseData.getPrompt()); - findAndFinishImageTask(condition, parseData.getPrompt(), message); - } - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/MessageHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/MessageHandler.java deleted file mode 100644 index a1205650..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/MessageHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.Constants; -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.loadbalancer.DiscordLoadBalancer; -import com.xmzs.midjourney.support.DiscordHelper; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.support.TaskCondition; -import jakarta.annotation.Resource; -import net.dv8tion.jda.api.utils.data.DataArray; -import net.dv8tion.jda.api.utils.data.DataObject; - -import java.util.Comparator; - -public abstract class MessageHandler { - @Resource - protected DiscordLoadBalancer discordLoadBalancer; - @Resource - protected DiscordHelper discordHelper; - - public abstract void handle(MessageType messageType, DataObject message); - - protected String getMessageContent(DataObject message) { - return message.hasKey("content") ? message.getString("content") : ""; - } - - protected String getMessageNonce(DataObject message) { - return message.hasKey("nonce") ? message.getString("nonce") : ""; - } - - protected void findAndFinishImageTask(TaskCondition condition, String finalPrompt, DataObject message) { - String imageUrl = getImageUrl(message); - String messageHash = this.discordHelper.getMessageHash(imageUrl); - condition.setMessageHash(messageHash); - Task task = this.discordLoadBalancer.findRunningTask(condition) - .findFirst().orElseGet(() -> { - condition.setMessageHash(null); - return this.discordLoadBalancer.findRunningTask(condition) - .min(Comparator.comparing(Task::getStartTime)) - .orElse(null); - }); - if (task == null) { - return; - } - task.setProperty(Constants.TASK_PROPERTY_FINAL_PROMPT, finalPrompt); - task.setProperty(Constants.TASK_PROPERTY_MESSAGE_HASH, messageHash); - task.setImageUrl(imageUrl); - finishTask(task, message); - task.awake(); - } - - protected void finishTask(Task task, DataObject message) { - task.setProperty(Constants.TASK_PROPERTY_MESSAGE_ID, message.getString("id")); - task.setProperty(Constants.TASK_PROPERTY_FLAGS, message.getInt("flags", 0)); - task.setProperty(Constants.TASK_PROPERTY_MESSAGE_HASH, this.discordHelper.getMessageHash(task.getImageUrl())); - task.success(); - } - - protected boolean hasImage(DataObject message) { - DataArray attachments = message.optArray("attachments").orElse(DataArray.empty()); - return !attachments.isEmpty(); - } - - protected String getImageUrl(DataObject message) { - DataArray attachments = message.getArray("attachments"); - if (!attachments.isEmpty()) { - String imageUrl = attachments.getObject(0).getString("url"); - return replaceCdnUrl(imageUrl); - } - return null; - } - - protected String replaceCdnUrl(String imageUrl) { - if (CharSequenceUtil.isBlank(imageUrl)) { - return imageUrl; - } - String cdn = this.discordHelper.getCdn(); - if (CharSequenceUtil.startWith(imageUrl, cdn)) { - return imageUrl; - } - return CharSequenceUtil.replaceFirst(imageUrl, DiscordHelper.DISCORD_CDN_URL, cdn); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/RerollSuccessHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/RerollSuccessHandler.java deleted file mode 100644 index f86b8f4b..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/RerollSuccessHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - - -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.enums.TaskAction; -import com.xmzs.midjourney.support.TaskCondition; -import com.xmzs.midjourney.util.ContentParseData; -import com.xmzs.midjourney.util.ConvertUtils; -import net.dv8tion.jda.api.utils.data.DataObject; -import org.springframework.stereotype.Component; - -import java.util.Set; - -/** - * reroll 消息处理. - * 完成(create): **cat** - <@1012983546824114217> (relaxed) - * 完成(create): **cat** - Variations by <@1012983546824114217> (relaxed) - * 完成(create): **cat** - Variations (Strong或Subtle) by <@1012983546824114217> (relaxed) - */ -@Component -public class RerollSuccessHandler extends MessageHandler { - private static final String CONTENT_REGEX_1 = "\\*\\*(.*?)\\*\\* - <@\\d+> \\((.*?)\\)"; - private static final String CONTENT_REGEX_2 = "\\*\\*(.*?)\\*\\* - Variations by <@\\d+> \\((.*?)\\)"; - private static final String CONTENT_REGEX_3 = "\\*\\*(.*?)\\*\\* - Variations \\(.*?\\) by <@\\d+> \\((.*?)\\)"; - - @Override - public void handle(MessageType messageType, DataObject message) { - String content = getMessageContent(message); - ContentParseData parseData = getParseData(content); - if (MessageType.CREATE.equals(messageType) && parseData != null && hasImage(message)) { - TaskCondition condition = new TaskCondition() - .setActionSet(Set.of(TaskAction.REROLL)) - .setFinalPromptEn(parseData.getPrompt()); - findAndFinishImageTask(condition, parseData.getPrompt(), message); - } - } - - private ContentParseData getParseData(String content) { - ContentParseData parseData = ConvertUtils.parseContent(content, CONTENT_REGEX_1); - if (parseData == null) { - parseData = ConvertUtils.parseContent(content, CONTENT_REGEX_2); - } - if (parseData == null) { - parseData = ConvertUtils.parseContent(content, CONTENT_REGEX_3); - } - return parseData; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/StartAndProgressHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/StartAndProgressHandler.java deleted file mode 100644 index 9ff668d8..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/StartAndProgressHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.Constants; -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.enums.TaskStatus; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.support.TaskCondition; -import com.xmzs.midjourney.util.ContentParseData; -import com.xmzs.midjourney.util.ConvertUtils; -import lombok.extern.slf4j.Slf4j; -import net.dv8tion.jda.api.utils.data.DataArray; -import net.dv8tion.jda.api.utils.data.DataObject; -import org.springframework.stereotype.Component; - -import java.util.Optional; -import java.util.Set; - -@Slf4j -@Component -public class StartAndProgressHandler extends MessageHandler { - - @Override - public void handle(MessageType messageType, DataObject message) { - String nonce = getMessageNonce(message); - String content = getMessageContent(message); - ContentParseData parseData = ConvertUtils.parseContent(content); - if (MessageType.CREATE.equals(messageType) && CharSequenceUtil.isNotBlank(nonce)) { - if (isError(message)) { - return; - } - // 任务开始 - Task task = this.discordLoadBalancer.getRunningTaskByNonce(nonce); - if (task == null) { - return; - } - task.setProperty(Constants.TASK_PROPERTY_PROGRESS_MESSAGE_ID, message.getString("id")); - // 兼容少数content为空的场景 - if (parseData != null) { - task.setProperty(Constants.TASK_PROPERTY_FINAL_PROMPT, parseData.getPrompt()); - } - task.setStatus(TaskStatus.IN_PROGRESS); - task.awake(); - } else if (MessageType.UPDATE.equals(messageType) && parseData != null) { - // 任务进度 - TaskCondition condition = new TaskCondition().setStatusSet(Set.of(TaskStatus.IN_PROGRESS)) - .setProgressMessageId(message.getString("id")); - Task task = this.discordLoadBalancer.findRunningTask(condition).findFirst().orElse(null); - if (task == null) { - return; - } - task.setProperty(Constants.TASK_PROPERTY_FINAL_PROMPT, parseData.getPrompt()); - task.setStatus(TaskStatus.IN_PROGRESS); - task.setProgress(parseData.getStatus()); - String imageUrl = getImageUrl(message); - task.setImageUrl(imageUrl); - task.setProperty(Constants.TASK_PROPERTY_MESSAGE_HASH, this.discordHelper.getMessageHash(imageUrl)); - task.awake(); - } - } - - private boolean isError(DataObject message) { - Optional embedsOptional = message.optArray("embeds"); - if (embedsOptional.isEmpty() || embedsOptional.get().isEmpty()) { - return false; - } - DataObject embed = embedsOptional.get().getObject(0); - return embed.getInt("color", 0) == 16711680; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/UpscaleSuccessHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/UpscaleSuccessHandler.java deleted file mode 100644 index abe78d64..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/UpscaleSuccessHandler.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.enums.TaskAction; -import com.xmzs.midjourney.support.TaskCondition; -import com.xmzs.midjourney.util.ContentParseData; -import com.xmzs.midjourney.util.ConvertUtils; -import net.dv8tion.jda.api.utils.data.DataObject; -import org.springframework.stereotype.Component; - -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * upscale消息处理. - * 完成(create): **cat** - Upscaled (Beta或Light) by <@1083152202048217169> (fast) - * 完成(create): **cat** - Upscaled by <@1083152202048217169> (fast) - * 完成(create): **cat** - Image #1 <@1012983546824114217> - */ -@Component -public class UpscaleSuccessHandler extends MessageHandler { - private static final String CONTENT_REGEX_1 = "\\*\\*(.*?)\\*\\* - Upscaled \\(.*?\\) by <@\\d+> \\((.*?)\\)"; - private static final String CONTENT_REGEX_2 = "\\*\\*(.*?)\\*\\* - Upscaled by <@\\d+> \\((.*?)\\)"; - private static final String CONTENT_REGEX_3 = "\\*\\*(.*?)\\*\\* - Image #\\d <@\\d+>"; - - @Override - public void handle(MessageType messageType, DataObject message) { - String content = getMessageContent(message); - ContentParseData parseData = getParseData(content); - if (MessageType.CREATE.equals(messageType) && parseData != null && hasImage(message)) { - TaskCondition condition = new TaskCondition() - .setActionSet(Set.of(TaskAction.UPSCALE)) - .setFinalPromptEn(parseData.getPrompt()); - findAndFinishImageTask(condition, parseData.getPrompt(), message); - } - } - - private ContentParseData getParseData(String content) { - ContentParseData parseData = ConvertUtils.parseContent(content, CONTENT_REGEX_1); - if (parseData == null) { - parseData = ConvertUtils.parseContent(content, CONTENT_REGEX_2); - } - if (parseData != null) { - return parseData; - } - Matcher matcher = Pattern.compile(CONTENT_REGEX_3).matcher(content); - if (!matcher.find()) { - return null; - } - parseData = new ContentParseData(); - parseData.setPrompt(matcher.group(1)); - parseData.setStatus("done"); - return parseData; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/VariationSuccessHandler.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/VariationSuccessHandler.java deleted file mode 100644 index 7fabe8d2..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/handle/VariationSuccessHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xmzs.midjourney.wss.handle; - -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.enums.TaskAction; -import com.xmzs.midjourney.support.TaskCondition; -import com.xmzs.midjourney.util.ContentParseData; -import com.xmzs.midjourney.util.ConvertUtils; -import net.dv8tion.jda.api.utils.data.DataObject; -import org.springframework.stereotype.Component; - -import java.util.Set; - -/** - * variation消息处理. - * 完成(create): **cat** - Variations (Strong或Subtle) by <@1012983546824114217> (relaxed) - * 完成(create): **cat** - Variations by <@1012983546824114217> (relaxed) - */ -@Component -public class VariationSuccessHandler extends MessageHandler { - private static final String CONTENT_REGEX_1 = "\\*\\*(.*?)\\*\\* - Variations by <@\\d+> \\((.*?)\\)"; - private static final String CONTENT_REGEX_2 = "\\*\\*(.*?)\\*\\* - Variations \\(.*?\\) by <@\\d+> \\((.*?)\\)"; - - @Override - public void handle(MessageType messageType, DataObject message) { - String content = getMessageContent(message); - ContentParseData parseData = getParseData(content); - if (MessageType.CREATE.equals(messageType) && parseData != null && hasImage(message)) { - TaskCondition condition = new TaskCondition() - .setActionSet(Set.of(TaskAction.VARIATION)) - .setFinalPromptEn(parseData.getPrompt()); - findAndFinishImageTask(condition, parseData.getPrompt(), message); - } - } - - private ContentParseData getParseData(String content) { - ContentParseData parseData = ConvertUtils.parseContent(content, CONTENT_REGEX_1); - if (parseData == null) { - parseData = ConvertUtils.parseContent(content, CONTENT_REGEX_2); - } - return parseData; - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/user/UserMessageListener.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/user/UserMessageListener.java deleted file mode 100644 index d495ff8b..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/user/UserMessageListener.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.midjourney.wss.user; - - -import cn.hutool.core.text.CharSequenceUtil; -import cn.hutool.core.thread.ThreadUtil; -import com.xmzs.midjourney.domain.DiscordAccount; -import com.xmzs.midjourney.enums.MessageType; -import com.xmzs.midjourney.wss.handle.MessageHandler; -import lombok.extern.slf4j.Slf4j; -import net.dv8tion.jda.api.utils.data.DataObject; - -import java.util.List; - -@Slf4j -public class UserMessageListener { - private final DiscordAccount account; - private final List messageHandlers; - - public UserMessageListener(DiscordAccount account, List messageHandlers) { - this.account = account; - this.messageHandlers = messageHandlers; - } - - public void onMessage(DataObject raw) { - MessageType messageType = MessageType.of(raw.getString("t")); - if (messageType == null || MessageType.DELETE == messageType) { - return; - } - DataObject data = raw.getObject("d"); - if (ignoreAndLogMessage(data, messageType)) { - return; - } - ThreadUtil.sleep(50); - for (MessageHandler messageHandler : this.messageHandlers) { - messageHandler.handle(messageType, data); - } - } - - private boolean ignoreAndLogMessage(DataObject data, MessageType messageType) { - String channelId = data.getString("channel_id"); - if (!CharSequenceUtil.equals(channelId, this.account.getChannelId())) { - return true; - } - String authorName = data.optObject("author").map(a -> a.getString("username")).orElse("System"); - log.debug("{} - {} - {}: {}", this.account.getDisplay(), messageType.name(), authorName, data.opt("content").orElse("")); - return false; - } -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/user/UserWebSocketStarter.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/user/UserWebSocketStarter.java deleted file mode 100644 index 252f9144..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/wss/user/UserWebSocketStarter.java +++ /dev/null @@ -1,369 +0,0 @@ -package com.xmzs.midjourney.wss.user; - -import cn.hutool.core.exceptions.ValidateException; -import cn.hutool.core.text.CharSequenceUtil; -import cn.hutool.core.thread.ThreadUtil; -import cn.hutool.core.util.RandomUtil; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.ReturnCode; -import com.xmzs.midjourney.domain.DiscordAccount; -import com.xmzs.midjourney.util.AsyncLockUtils; -import com.xmzs.midjourney.wss.WebSocketStarter; -import com.neovisionaries.ws.client.WebSocket; -import com.neovisionaries.ws.client.WebSocketAdapter; -import com.neovisionaries.ws.client.WebSocketFactory; -import com.neovisionaries.ws.client.WebSocketFrame; -import eu.bitwalker.useragentutils.UserAgent; -import lombok.extern.slf4j.Slf4j; -import net.dv8tion.jda.api.utils.data.DataArray; -import net.dv8tion.jda.api.utils.data.DataObject; -import net.dv8tion.jda.api.utils.data.DataType; -import net.dv8tion.jda.internal.requests.WebSocketCode; -import net.dv8tion.jda.internal.utils.compress.Decompressor; -import net.dv8tion.jda.internal.utils.compress.ZlibDecompressor; - -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -@Slf4j -public class UserWebSocketStarter extends WebSocketAdapter implements WebSocketStarter { - private static final int CONNECT_RETRY_LIMIT = 3; - - private final ProxyProperties.ProxyConfig proxyConfig; - private final DiscordAccount account; - private final UserMessageListener userMessageListener; - private final ScheduledExecutorService heartExecutor; - private final String wssServer; - private final DataObject authData; - - private Decompressor decompressor; - private WebSocket socket = null; - private String resumeGatewayUrl; - private String sessionId; - - private Future heartbeatInterval; - private Future heartbeatTimeout; - private boolean heartbeatAck = false; - private Object sequence = null; - private long interval = 41250; - private boolean trying = false; - - public UserWebSocketStarter(String wssServer, DiscordAccount account, UserMessageListener userMessageListener, ProxyProperties.ProxyConfig proxyConfig) { - this.wssServer = wssServer; - this.account = account; - this.userMessageListener = userMessageListener; - this.proxyConfig = proxyConfig; - this.heartExecutor = Executors.newSingleThreadScheduledExecutor(); - this.authData = createAuthData(); - } - - @Override - public void setTrying(boolean trying) { - this.trying = trying; - } - - @Override - public synchronized void start() throws Exception { - this.decompressor = new ZlibDecompressor(2048); - WebSocketFactory webSocketFactory = createWebSocketFactory(this.proxyConfig); - String gatewayUrl = CharSequenceUtil.isNotBlank(this.resumeGatewayUrl) ? this.resumeGatewayUrl : this.wssServer; - this.socket = webSocketFactory.createSocket(gatewayUrl + "/?encoding=json&v=9&compress=zlib-stream"); - this.socket.addListener(this); - this.socket.addHeader("Accept-Encoding", "gzip, deflate, br") - .addHeader("Accept-Language", "zh-CN,zh;q=0.9") - .addHeader("Cache-Control", "no-cache") - .addHeader("Pragma", "no-cache") - .addHeader("Sec-Websocket-Extensions", "permessage-deflate; client_max_window_bits") - .addHeader("User-Agent", this.account.getUserAgent()); - this.socket.connect(); - } - - @Override - public void onConnected(WebSocket websocket, Map> headers) { - log.debug("[wss-{}] Connected to websocket.", this.account.getDisplay()); - } - - @Override - public void handleCallbackError(WebSocket websocket, Throwable cause) throws Exception { - log.error("[wss-{}] There was some websocket error.", this.account.getDisplay(), cause); - } - - @Override - public void onDisconnected(WebSocket websocket, WebSocketFrame serverCloseFrame, WebSocketFrame clientCloseFrame, boolean closedByServer) throws Exception { - int code; - String closeReason; - if (closedByServer) { - code = serverCloseFrame.getCloseCode(); - closeReason = serverCloseFrame.getCloseReason(); - } else { - code = clientCloseFrame.getCloseCode(); - closeReason = clientCloseFrame.getCloseReason(); - } - connectFinish(code, closeReason); - if (this.trying) { - return; - } - if (code == 5240) { - // 隐式关闭wss - clearAllStates(); - } else if (code >= 4000) { - log.warn("[wss-{}] Can't reconnect! Account disabled. Closed by {}({}).", this.account.getDisplay(), code, closeReason); - clearAllStates(); - this.account.setEnable(false); - } else if (code == 2001) { - // reconnect - log.warn("[wss-{}] Waiting try reconnect...", this.account.getDisplay()); - tryReconnect(); - } else { - log.warn("[wss-{}] Closed by {}({}). Waiting try new connection...", this.account.getDisplay(), code, closeReason); - tryNewConnect(); - } - } - - private void tryReconnect() { - clearSocketStates(); - try { - this.trying = true; - tryStart(true); - } catch (Exception e) { - if (e instanceof TimeoutException) { - sendClose(5240, "try new connect"); - } - log.warn("[wss-{}] Try reconnect fail: {}, Waiting try new connection...", this.account.getDisplay(), e.getMessage()); - ThreadUtil.sleep(1000); - tryNewConnect(); - } - } - - private void tryNewConnect() { - this.trying = true; - for (int i = 1; i <= CONNECT_RETRY_LIMIT; i++) { - clearAllStates(); - try { - tryStart(false); - return; - } catch (Exception e) { - if (e instanceof TimeoutException) { - sendClose(5240, "try new connect"); - } - log.warn("[wss-{}] Try new connection fail ({}): {}", this.account.getDisplay(), i, e.getMessage()); - ThreadUtil.sleep(5000); - } - } - log.error("[wss-{}] Account disabled", this.account.getDisplay()); - this.account.setEnable(false); - } - - public void tryStart(boolean reconnect) throws Exception { - start(); - AsyncLockUtils.LockObject lock = AsyncLockUtils.waitForLock("wss:" + this.account.getChannelId(), Duration.ofSeconds(20)); - int code = lock.getProperty("code", Integer.class, 0); - if (code == ReturnCode.SUCCESS) { - log.debug("[wss-{}] {} success.", this.account.getDisplay(), reconnect ? "Reconnect" : "New connect"); - return; - } - throw new ValidateException(lock.getProperty("description", String.class)); - } - - @Override - public void onBinaryMessage(WebSocket websocket, byte[] binary) throws Exception { - if (this.decompressor == null) { - return; - } - byte[] decompressBinary = this.decompressor.decompress(binary); - if (decompressBinary == null) { - return; - } - String json = new String(decompressBinary, StandardCharsets.UTF_8); - DataObject data = DataObject.fromJson(json); - int opCode = data.getInt("op"); - switch (opCode) { - case WebSocketCode.HEARTBEAT -> { - log.debug("[wss-{}] Receive heartbeat.", this.account.getDisplay()); - handleHeartbeat(); - } - case WebSocketCode.HEARTBEAT_ACK -> { - this.heartbeatAck = true; - clearHeartbeatTimeout(); - } - case WebSocketCode.HELLO -> { - handleHello(data); - doResumeOrIdentify(); - } - case WebSocketCode.RESUME -> { - log.debug("[wss-{}] Receive resumed.", this.account.getDisplay()); - connectSuccess(); - } - case WebSocketCode.RECONNECT -> sendReconnect("receive server reconnect"); - case WebSocketCode.INVALIDATE_SESSION -> sendClose(1009, "receive session invalid"); - case WebSocketCode.DISPATCH -> handleDispatch(data); - default -> log.debug("[wss-{}] Receive unknown code: {}.", this.account.getDisplay(), data); - } - } - - private void handleHello(DataObject data) { - clearHeartbeatInterval(); - this.interval = data.getObject("d").getLong("heartbeat_interval"); - this.heartbeatAck = true; - this.heartbeatInterval = this.heartExecutor.scheduleAtFixedRate(() -> { - if (this.heartbeatAck) { - this.heartbeatAck = false; - send(WebSocketCode.HEARTBEAT, this.sequence); - } else { - sendReconnect("heartbeat has not ack interval"); - } - }, (long) Math.floor(RandomUtil.randomDouble(0, 1) * this.interval), this.interval, TimeUnit.MILLISECONDS); - } - - private void doResumeOrIdentify() { - if (CharSequenceUtil.isBlank(this.sessionId)) { - log.debug("[wss-{}] Send identify msg.", this.account.getDisplay()); - send(WebSocketCode.IDENTIFY, this.authData); - } else { - log.debug("[wss-{}] Send resume msg.", this.account.getDisplay()); - send(WebSocketCode.RESUME, DataObject.empty().put("token", this.account.getUserToken()) - .put("session_id", this.sessionId).put("seq", this.sequence)); - } - } - - private void handleHeartbeat() { - send(WebSocketCode.HEARTBEAT, this.sequence); - this.heartbeatTimeout = ThreadUtil.execAsync(() -> { - ThreadUtil.sleep(this.interval); - sendReconnect("heartbeat has not ack"); - }); - } - - private void clearAllStates() { - clearSocketStates(); - clearResumeStates(); - } - - private void clearSocketStates() { - clearHeartbeatTimeout(); - clearHeartbeatInterval(); - this.socket = null; - this.decompressor = null; - } - - private void clearResumeStates() { - this.sessionId = null; - this.sequence = null; - this.resumeGatewayUrl = null; - } - - private void clearHeartbeatInterval() { - if (this.heartbeatInterval != null) { - this.heartbeatInterval.cancel(true); - this.heartbeatInterval = null; - } - } - - private void clearHeartbeatTimeout() { - if (this.heartbeatTimeout != null) { - this.heartbeatTimeout.cancel(true); - this.heartbeatTimeout = null; - } - } - - private void sendReconnect(String reason) { - sendClose(2001, reason); - } - - private void sendClose(int code, String reason) { - if (this.socket != null) { - this.socket.sendClose(code, reason); - } - } - - private void send(int op, Object d) { - if (this.socket != null) { - this.socket.sendText(DataObject.empty().put("op", op).put("d", d).toString()); - } - } - - private void connectSuccess() { - this.trying = false; - connectFinish(ReturnCode.SUCCESS, ""); - } - - private void connectFinish(int code, String description) { - AsyncLockUtils.LockObject lock = AsyncLockUtils.getLock("wss:" + this.account.getChannelId()); - if (lock != null) { - lock.setProperty("code", code); - lock.setProperty("description", description); - lock.awake(); - } - } - - private void handleDispatch(DataObject raw) { - this.sequence = raw.opt("s").orElse(null); - if (!raw.isType("d", DataType.OBJECT)) { - return; - } - DataObject content = raw.getObject("d"); - String t = raw.getString("t", null); - if ("READY".equals(t)) { - this.sessionId = content.getString("session_id"); - this.resumeGatewayUrl = content.getString("resume_gateway_url"); - log.debug("[wss-{}] Dispatch ready: identify.", this.account.getDisplay()); - connectSuccess(); - return; - } else if ("RESUMED".equals(t)) { - log.debug("[wss-{}] Dispatch read: resumed.", this.account.getDisplay()); - connectSuccess(); - return; - } - try { - this.userMessageListener.onMessage(raw); - } catch (Exception e) { - log.error("[wss-{}] Handle message error", this.account.getDisplay(), e); - } - } - - private DataObject createAuthData() { - UserAgent agent = UserAgent.parseUserAgentString(this.account.getUserAgent()); - DataObject connectionProperties = DataObject.empty() - .put("browser", agent.getBrowser().getGroup().getName()) - .put("browser_user_agent", this.account.getUserAgent()) - .put("browser_version", agent.getBrowserVersion().toString()) - .put("client_build_number", 222963) - .put("client_event_source", null) - .put("device", "") - .put("os", agent.getOperatingSystem().getName()) - .put("referer", "https://www.midjourney.com") - .put("referrer_current", "") - .put("referring_domain", "www.midjourney.com") - .put("referring_domain_current", "") - .put("release_channel", "stable") - .put("system_locale", "zh-CN"); - DataObject presence = DataObject.empty() - .put("activities", DataArray.empty()) - .put("afk", false) - .put("since", 0) - .put("status", "online"); - DataObject clientState = DataObject.empty() - .put("api_code_version", 0) - .put("guild_versions", DataObject.empty()) - .put("highest_last_message_id", "0") - .put("private_channels_version", "0") - .put("read_state_version", 0) - .put("user_guild_settings_version", -1) - .put("user_settings_version", -1); - return DataObject.empty() - .put("capabilities", 16381) - .put("client_state", clientState) - .put("compress", false) - .put("presence", presence) - .put("properties", connectionProperties) - .put("token", this.account.getUserToken()); - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/spring/config/BeanConfig.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/spring/config/BeanConfig.java deleted file mode 100644 index 2ea40fd5..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/spring/config/BeanConfig.java +++ /dev/null @@ -1,100 +0,0 @@ -package spring.config; - -import cn.hutool.core.io.IoUtil; -import cn.hutool.core.util.ReflectUtil; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.loadbalancer.rule.IRule; -import com.xmzs.midjourney.service.NotifyService; -import com.xmzs.midjourney.service.TaskStoreService; -import com.xmzs.midjourney.service.TranslateService; -import com.xmzs.midjourney.service.store.InMemoryTaskStoreServiceImpl; -import com.xmzs.midjourney.service.store.RedisTaskStoreServiceImpl; -import com.xmzs.midjourney.service.translate.BaiduTranslateServiceImpl; -import com.xmzs.midjourney.service.translate.GPTTranslateServiceImpl; -import com.xmzs.midjourney.service.translate.NoTranslateServiceImpl; -import com.xmzs.midjourney.support.DiscordAccountHelper; -import com.xmzs.midjourney.support.DiscordHelper; -import com.xmzs.midjourney.support.Task; -import com.xmzs.midjourney.wss.handle.MessageHandler; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.connection.RedisConnectionFactory; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; -import org.springframework.data.redis.serializer.StringRedisSerializer; -import org.springframework.web.client.RestTemplate; - -import java.io.IOException; -import java.time.Duration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Configuration -public class BeanConfig { - @Autowired - private ApplicationContext applicationContext; - @Autowired - private ProxyProperties properties; - - @Bean - TranslateService translateService() { - return switch (this.properties.getTranslateWay()) { - case BAIDU -> new BaiduTranslateServiceImpl(this.properties.getBaiduTranslate()); - case GPT -> new GPTTranslateServiceImpl(this.properties); - default -> new NoTranslateServiceImpl(); - }; - } - - @Bean - TaskStoreService taskStoreService(RedisConnectionFactory redisConnectionFactory) { - ProxyProperties.TaskStore.Type type = this.properties.getTaskStore().getType(); - Duration timeout = this.properties.getTaskStore().getTimeout(); - return switch (type) { - case IN_MEMORY -> new InMemoryTaskStoreServiceImpl(timeout); - case REDIS -> new RedisTaskStoreServiceImpl(timeout, taskRedisTemplate(redisConnectionFactory)); - }; - } - - @Bean - RedisTemplate taskRedisTemplate(RedisConnectionFactory redisConnectionFactory) { - RedisTemplate redisTemplate = new RedisTemplate<>(); - redisTemplate.setConnectionFactory(redisConnectionFactory); - redisTemplate.setKeySerializer(new StringRedisSerializer()); - redisTemplate.setHashKeySerializer(new StringRedisSerializer()); - redisTemplate.setValueSerializer(new Jackson2JsonRedisSerializer<>(Task.class)); - return redisTemplate; - } - - @Bean - public RestTemplate restTemplate() { - return new RestTemplate(); - } - - @Bean - public IRule loadBalancerRule() { - String ruleClassName = IRule.class.getPackageName() + "." + this.properties.getAccountChooseRule(); - return ReflectUtil.newInstance(ruleClassName); - } - - @Bean - List messageHandlers() { - return this.applicationContext.getBeansOfType(MessageHandler.class).values().stream().toList(); - } - - @Bean - DiscordAccountHelper discordAccountHelper(DiscordHelper discordHelper, TaskStoreService taskStoreService, NotifyService notifyService) throws IOException { - var resources = this.applicationContext.getResources("classpath:api-params/*.json"); - Map paramsMap = new HashMap<>(); - for (var resource : resources) { - String filename = resource.getFilename(); - String params = IoUtil.readUtf8(resource.getInputStream()); - paramsMap.put(filename.substring(0, filename.length() - 5), params); - } - return new DiscordAccountHelper(discordHelper, this.properties, restTemplate(), taskStoreService, notifyService, messageHandlers(), paramsMap); - } - - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/java/spring/config/WebMvcConfig.java b/ruoyi-modules/ruoyi-midjourney/src/main/java/spring/config/WebMvcConfig.java deleted file mode 100644 index d8e41aad..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/spring/config/WebMvcConfig.java +++ /dev/null @@ -1,32 +0,0 @@ -package spring.config; - -import cn.hutool.core.text.CharSequenceUtil; -import com.xmzs.midjourney.ProxyProperties; -import com.xmzs.midjourney.support.ApiAuthorizeInterceptor; -import jakarta.annotation.Resource; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@Configuration -public class WebMvcConfig implements WebMvcConfigurer { - @Resource - private ApiAuthorizeInterceptor apiAuthorizeInterceptor; - @Resource - private ProxyProperties properties; - - @Override - public void addViewControllers(ViewControllerRegistry registry) { - registry.addViewController("/").setViewName("redirect:doc.html"); - } - - @Override - public void addInterceptors(InterceptorRegistry registry) { - if (CharSequenceUtil.isNotBlank(this.properties.getApiSecret())) { - registry.addInterceptor(this.apiAuthorizeInterceptor) - .addPathPatterns("/mj/submit/**", "/mj/task/**", "/mj/account/**"); - } - } - -} diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/blend.json b/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/blend.json deleted file mode 100644 index 7c8a3529..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/blend.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type":2, - "guild_id": "$guild_id", - "channel_id": "$channel_id", - "application_id":"936929561302675456", - "session_id":"$session_id", - "nonce": "$nonce", - "data":{ - "version":"1166847114203123796", - "id":"1062880104792997970", - "name":"blend", - "type":1, - "options":[], - "attachments":[] - } -} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/describe.json b/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/describe.json deleted file mode 100644 index 7ed659da..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/describe.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "type": 2, - "guild_id": "$guild_id", - "channel_id": "$channel_id", - "application_id": "936929561302675456", - "session_id": "$session_id", - "nonce": "$nonce", - "data": { - "version": "1166847114203123797", - "id": "1092492867185950852", - "name": "describe", - "type": 1, - "options": [ - { - "type": 11, - "name": "image", - "value": 0 - } - ], - "attachments": [ - { - "id": "0", - "filename": "$file_name", - "uploaded_filename": "$final_file_name" - } - ] - } -} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/imagine.json b/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/imagine.json deleted file mode 100644 index f4554cc5..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/imagine.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": 2, - "guild_id": "$guild_id", - "channel_id": "$channel_id", - "application_id": "936929561302675456", - "session_id": "$session_id", - "nonce": "$nonce", - "data": { - "version": "1166847114203123795", - "id": "938956540159881230", - "name": "imagine", - "type": 1, - "options": [ - { - "type": 3, - "name": "prompt", - "value": "$prompt" - } - ] - } -} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/message.json b/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/message.json deleted file mode 100644 index 9f8cccbc..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/message.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "content":"$content", - "channel_id":"$channel_id", - "type":0, - "sticker_ids":[], - "attachments":[ - { - "id":"0", - "filename": "$file_name", - "uploaded_filename": "$final_file_name" - } - ] -} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/reroll.json b/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/reroll.json deleted file mode 100644 index 84435b6d..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/reroll.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": 3, - "guild_id": "$guild_id", - "channel_id": "$channel_id", - "message_id": "$message_id", - "application_id": "936929561302675456", - "session_id": "$session_id", - "nonce": "$nonce", - "message_flags": 0, - "data": { - "component_type": 2, - "custom_id": "MJ::JOB::reroll::0::$message_hash::SOLO" - } -} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/upscale.json b/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/upscale.json deleted file mode 100644 index f1afdd5a..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/upscale.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": 3, - "guild_id": "$guild_id", - "channel_id": "$channel_id", - "message_id": "$message_id", - "application_id": "936929561302675456", - "session_id": "$session_id", - "nonce": "$nonce", - "message_flags": 0, - "data": { - "component_type": 2, - "custom_id": "MJ::JOB::upsample::$index::$message_hash" - } -} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/variation.json b/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/variation.json deleted file mode 100644 index 0f750aef..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/api-params/variation.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": 3, - "guild_id": "$guild_id", - "channel_id": "$channel_id", - "message_id": "$message_id", - "application_id": "936929561302675456", - "session_id": "$session_id", - "nonce": "$nonce", - "message_flags": 0, - "data": { - "component_type": 2, - "custom_id": "MJ::JOB::variation::$index::$message_hash" - } -} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/banned-words.txt b/ruoyi-modules/ruoyi-midjourney/src/main/resources/banned-words.txt deleted file mode 100644 index 5d386037..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/banned-words.txt +++ /dev/null @@ -1,211 +0,0 @@ -blood -twerk -making love -voluptuous -naughty -wincest -orgy -no clothes -au naturel -no shirt -decapitate -bare -nude -barely dressed -nude -bra -risque -scantily clad -cleavage -stripped -infested -full frontal -unclothed -invisible clothes -wearing nothing -lingerie -with no shirt -naked -without clothes on -negligee -zero clothes -gruesome -fascist -nazi -prophet mohammed -slave -coon -honkey -cocaine -heroin -meth -crack -kill -belle delphine -hitler -jinping -lolita -president xi -torture -disturbing -farts -fart -poop -infected -warts -shit -brown pudding -bunghole -vomit -voluptuous -seductive -sperm -sexy -sadist -sensored -censored -silenced -deepfake -inappropriate -waifu -succubus -slaughter -surgery -reproduce -crucified -seductively -explicit -inappropriate -large bust -explicit -wang -inappropriate -teratoma -intimate -see through -tryphophobia -bloodbath -wound -cronenberg -khorne -cannibal -cannibalism -visceral -guts -bloodshot -gory -killing -crucifixion -surgery -vivisection -massacre -hemoglobin -suicide -arse -labia -ass -mammaries -badonkers -bloody -minge -big ass -mommy milker -booba -nipple -oppai -booty -organs -bosom -ovaries -flesh -breasts -penis -busty -phallus -clunge -sexy female -crotch -skimpy -dick -thick -bruises -girth -titty -honkers -vagina -hooters -veiny -knob -ahegao -pinup -ballgag -car crash -playboy -bimbo -pleasure -bodily fluids -pleasures -boudoir -rule34 -brothel -seducing -dominatrix -corpse -seductive -erotic -seductive -fuck -sensual -hardcore -sexy -hentai -shag -horny -crucified -shibari -incest -smut -jav -succubus -jerk off king at pic -thot -kinbaku -legs spread -sensuality -belly button -porn -patriotic -bleed -excrement -petite -seduction -mccurry -provocative -sultry -erected -camisole -tight white -arrest -see-through -feces -anus -revealing clothing -vein -loli --edge -boobs --backed -tied up -zedong -bathing -jail -reticulum -rear end -sakimichan -behind bars -shirtless -sakimichan -seductive -sexi -sexualiz -sexual \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-midjourney/src/main/resources/mime.types b/ruoyi-modules/ruoyi-midjourney/src/main/resources/mime.types deleted file mode 100644 index fcff7ef0..00000000 --- a/ruoyi-modules/ruoyi-midjourney/src/main/resources/mime.types +++ /dev/null @@ -1,82 +0,0 @@ -text/html:html htm shtml -text/css:css -text/xml:xml - -text/mathml:mml -text/plain:txt -text/vnd.sun.j2me.app-descriptor:jad -text/vnd.wap.wml:wml -text/x-component:htc - -image/gif:gif -image/jpeg:jpg jpeg -image/png:png -image/tiff:tif tiff -image/vnd.wap.wbmp:wbmp -image/x-icon:ico -image/x-jng:jng -image/x-ms-bmp:bmp -image/svg+xml:svg svgz -image/webp:webp - -application/javascript:js -application/x-javascript:js -application/atom+xml:atom -application/rss+xml:rss - -application/font-woff:woff -application/java-archive:jar war ear -application/json:json -application/mac-binhex40:hqx -application/msword:doc -application/pdf:pdf -application/postscript:ps eps ai -application/rtf:rtf -application/vnd.apple.mpegurl:m3u8 -application/vnd.ms-excel:xls -application/vnd.ms-fontobject:eot -application/vnd.ms-powerpoint:ppt -application/vnd.wap.wmlc:wmlc -application/vnd.google-earth.kml+xml:kml -application/vnd.google-earth.kmz:kmz -application/x-7z-compressed:7z -application/x-cocoa:cco -application/x-java-archive-diff:jardiff -application/x-java-jnlp-file:jnlp -application/x-makeself:run -application/x-perl:pl pm -application/x-pilot:prc pdb -application/x-rar-compressed:rar -application/x-redhat-package-manager:rpm -application/x-sea:sea -application/x-shockwave-flash:swf -application/x-stuffit:sit -application/x-tcl:tcl tk -application/x-x509-ca-cert:der pem crt -application/x-xpinstall:xpi -application/xhtml+xml:xhtml -application/xspf+xml:xspf -application/zip:zip - -application/vnd.openxmlformats-officedocument.wordprocessingml.document:docx -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:xlsx -application/vnd.openxmlformats-officedocument.presentationml.presentation:pptx - -audio/midi:mid midi kar -audio/mpeg:mp3 -audio/ogg:ogg -audio/x-m4a:m4a -audio/x-realaudio:ra - -video/3gpp:3gpp 3gp -video/mp2t:ts -video/mp4:mp4 -video/mpeg:mpeg mpg -video/quicktime:mov -video/webm:webm -video/x-flv:flv -video/x-m4v:m4v -video/x-mng:mng -video/x-ms-asf:asx asf -video/x-ms-wmv:wmv -video/x-msvideo:avi diff --git a/ruoyi-modules/ruoyi-system/pom.xml b/ruoyi-modules/ruoyi-system/pom.xml index 8353449c..cdce8241 100644 --- a/ruoyi-modules/ruoyi-system/pom.xml +++ b/ruoyi-modules/ruoyi-system/pom.xml @@ -16,6 +16,10 @@ system系统模块 + + 4.5.14 + + @@ -92,17 +96,34 @@ ruoyi-common-chat + + org.ruoyi + ruoyi-common-wechat + + com.fasterxml.jackson.dataformat jackson-dataformat-xml 2.15.2 + + org.apache.httpcomponents + httpmime + ${httpclient.version} + + org.ruoyi ruoyi-common-pay + + io.github.ollama4j + ollama4j + 1.0.79 + compile + diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/GptConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/GptConfig.java deleted file mode 100644 index 429e0d2d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/GptConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/KeywordConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/KeywordConfig.java deleted file mode 100644 index 8ab758e7..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/KeywordConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xmzs.system.cofing; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * 关键字配置 - * - * @author ashinnotfound - * @date 2023/08/10 - */ -@Data -@Component -@ConfigurationProperties("keyword") -public class KeywordConfig { - private String reset; - private String image; - private String audio; -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/QqConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/QqConfig.java deleted file mode 100644 index de92f81b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/QqConfig.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WechatConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WechatConfig.java deleted file mode 100644 index 715c3d28..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WechatConfig.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.xmzs.system.cofing; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * 微信配置 - * - * @author ashinnotfound - * @date 2023/03/19 - */ -@Data -@Component -@ConfigurationProperties("wechat") -public class WechatConfig { - private Boolean enable; - private String qrPath; -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WxMaConfiguration.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WxMaConfiguration.java deleted file mode 100644 index 55515a74..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WxMaConfiguration.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WxMaProperties.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WxMaProperties.java deleted file mode 100644 index 3ad49b35..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/cofing/WxMaProperties.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/CacheController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/CacheController.java deleted file mode 100644 index 3beaf46d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/CacheController.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.xmzs.system.controller.monitor; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysLogininforController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysLogininforController.java deleted file mode 100644 index 2c54ca7c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysLogininforController.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.xmzs.system.controller.monitor; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysLogininforBo; -import com.xmzs.system.domain.vo.SysLogininforVo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysOperlogController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysOperlogController.java deleted file mode 100644 index dabfb2a7..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysOperlogController.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.xmzs.system.controller.monitor; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysOperLogBo; -import com.xmzs.system.domain.vo.SysOperLogVo; -import com.xmzs.system.service.ISysOperLogService; -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/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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysUserOnlineController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysUserOnlineController.java deleted file mode 100644 index 1756ec34..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/monitor/SysUserOnlineController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheConstants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.domain.dto.UserOnlineDTO; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.SysUserOnline; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysConfigController.java deleted file mode 100644 index 2e741461..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysConfigController.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysConfigBo; -import com.xmzs.system.domain.vo.SysConfigVo; -import com.xmzs.system.service.ISysConfigService; -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/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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDeptController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDeptController.java deleted file mode 100644 index dce84e4d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDeptController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.hutool.core.convert.Convert; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysDeptBo; -import com.xmzs.system.domain.vo.SysDeptVo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDictDataController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDictDataController.java deleted file mode 100644 index 3fef24e9..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDictDataController.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.hutool.core.util.ObjectUtil; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysDictDataBo; -import com.xmzs.system.domain.vo.SysDictDataVo; -import com.xmzs.system.service.ISysDictDataService; -import com.xmzs.system.service.ISysDictTypeService; -import jakarta.servlet.http.HttpServletResponse; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDictTypeController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDictTypeController.java deleted file mode 100644 index c78907e3..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysDictTypeController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysDictTypeBo; -import com.xmzs.system.domain.vo.SysDictTypeVo; -import com.xmzs.system.service.ISysDictTypeService; -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/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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysMenuController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysMenuController.java deleted file mode 100644 index adc05edc..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysMenuController.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.dev33.satoken.annotation.SaCheckRole; -import cn.dev33.satoken.annotation.SaMode; -import cn.hutool.core.lang.tree.Tree; -import com.xmzs.common.core.constant.TenantConstants; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.SysMenu; -import com.xmzs.system.domain.bo.SysMenuBo; -import com.xmzs.system.domain.vo.MenuTreeSelectVo; -import com.xmzs.system.domain.vo.RouterVo; -import com.xmzs.system.domain.vo.SysMenuVo; -import com.xmzs.system.service.ISysMenuService; -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/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()); - return R.ok(menuService.buildMenuTreeSelect(menus)); - } - - /** - * 加载对应角色菜单列表树 - * - * @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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysModelController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysModelController.java deleted file mode 100644 index 8f1d99f7..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysModelController.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.idempotent.annotation.RepeatSubmit; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysModelBo; -import com.xmzs.system.domain.vo.SysModelVo; -import com.xmzs.system.service.ISysModelService; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 系统模型 - * - * @author Lion Li - * @date 2024-04-04 - */ -@Validated -@RequiredArgsConstructor -@RestController -@RequestMapping("/system/model") -public class SysModelController extends BaseController { - - private final ISysModelService sysModelService; - - /** - * 查询系统模型列表 - */ - @GetMapping("/list") - public TableDataInfo list(SysModelBo bo, PageQuery pageQuery) { - return sysModelService.queryPageList(bo, pageQuery); - } - - /** - * 查询系统模型列表 - */ - @GetMapping("/modelList") - public R> modelList(SysModelBo bo) { - bo.setModelShow("0"); - return R.ok(sysModelService.queryList(bo)); - } - - /** - * 导出系统模型列表 - */ - @SaCheckPermission("system:model:export") - @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)); - } - - /** - * 新增系统模型 - */ - @SaCheckPermission("system:model:add") - @Log(title = "系统模型", businessType = BusinessType.INSERT) - @RepeatSubmit() - @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody SysModelBo bo) { - return toAjax(sysModelService.insertByBo(bo)); - } - - /** - * 修改系统模型 - */ - @SaCheckPermission("system:model:edit") - @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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysNoticeController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysNoticeController.java deleted file mode 100644 index f20cc9e1..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysNoticeController.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysNoticeBo; -import com.xmzs.system.domain.vo.SysNoticeVo; -import com.xmzs.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; - - /** - * 获取通知公告列表 - */ - @SaCheckPermission("system:notice:list") - @GetMapping("/list") - public TableDataInfo list(SysNoticeBo notice, PageQuery pageQuery) { - return noticeService.selectPageNoticeList(notice, pageQuery); - } - - /** - * 根据通知公告编号获取详细信息 - * - * @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)); - } - - /** - * 修改通知公告 - */ - @SaCheckPermission("system:notice:edit") - @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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysOssConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysOssConfigController.java deleted file mode 100644 index 8ca12544..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysOssConfigController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.core.validate.QueryGroup; -import com.xmzs.common.idempotent.annotation.RepeatSubmit; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysOssConfigBo; -import com.xmzs.system.domain.vo.SysOssConfigVo; -import com.xmzs.system.service.ISysOssConfigService; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysOssController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysOssController.java deleted file mode 100644 index 3ca4b237..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysOssController.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.xmzs.system.controller.system; - - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.hutool.core.util.ObjectUtil; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.validate.QueryGroup; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysOssBo; -import com.xmzs.system.domain.vo.SysOssUploadVo; -import com.xmzs.system.domain.vo.SysOssVo; -import com.xmzs.system.service.ISysOssService; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysPostController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysPostController.java deleted file mode 100644 index f98d1357..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysPostController.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysPostBo; -import com.xmzs.system.domain.vo.SysPostVo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysProfileController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysProfileController.java deleted file mode 100644 index 719cf2a9..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysProfileController.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.secure.BCrypt; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.io.FileUtil; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.file.MimeTypeUtils; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.system.domain.bo.SysUserProfileBo; -import com.xmzs.system.domain.vo.AvatarVo; -import com.xmzs.system.domain.vo.ProfileVo; -import com.xmzs.system.domain.vo.SysOssVo; -import com.xmzs.system.domain.vo.SysUserVo; -import com.xmzs.system.service.ISysOssService; -import com.xmzs.system.service.ISysUserService; -import lombok.RequiredArgsConstructor; -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("修改个人信息异常,请联系管理员"); - } - - /** - * 重置密码 - * - * @param newPassword 旧密码 - * @param oldPassword 新密码 - */ - @Log(title = "个人信息", businessType = BusinessType.UPDATE) - @PutMapping("/updatePwd") - public R updatePwd(String oldPassword, String newPassword) { - SysUserVo user = userService.selectUserById(LoginHelper.getUserId()); - String password = user.getPassword(); - if (!BCrypt.checkpw(oldPassword, password)) { - return R.fail("修改密码失败,旧密码错误"); - } - if (BCrypt.checkpw(newPassword, password)) { - return R.fail("新密码不能与旧密码相同"); - } - - if (userService.resetUserPwd(user.getUserId(), BCrypt.hashpw(newPassword)) > 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysRoleController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysRoleController.java deleted file mode 100644 index ac118392..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysRoleController.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.SysUserRole; -import com.xmzs.system.domain.bo.SysDeptBo; -import com.xmzs.system.domain.bo.SysRoleBo; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.system.domain.vo.DeptTreeSelectVo; -import com.xmzs.system.domain.vo.SysRoleVo; -import com.xmzs.system.domain.vo.SysUserVo; -import com.xmzs.system.service.ISysDeptService; -import com.xmzs.system.service.ISysRoleService; -import com.xmzs.system.service.ISysUserService; -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/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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysTenantController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysTenantController.java deleted file mode 100644 index 429b1b17..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysTenantController.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.dev33.satoken.annotation.SaCheckRole; -import com.baomidou.lock.annotation.Lock4j; -import com.xmzs.common.core.constant.TenantConstants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.idempotent.annotation.RepeatSubmit; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.tenant.helper.TenantHelper; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysTenantBo; -import com.xmzs.system.domain.vo.SysTenantVo; -import com.xmzs.system.service.ISysTenantService; -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.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysTenantPackageController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysTenantPackageController.java deleted file mode 100644 index 9ade45f1..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysTenantPackageController.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.xmzs.system.controller.system; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.dev33.satoken.annotation.SaCheckRole; -import com.xmzs.common.core.constant.TenantConstants; -import com.xmzs.common.core.domain.R; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.idempotent.annotation.RepeatSubmit; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysTenantPackageBo; -import com.xmzs.system.domain.vo.SysTenantPackageVo; -import com.xmzs.system.service.ISysTenantPackageService; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysUserController.java deleted file mode 100644 index 95b9ea41..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/controller/system/SysUserController.java +++ /dev/null @@ -1,297 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.domain.R; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.excel.core.ExcelResult; -import com.xmzs.common.excel.utils.ExcelUtil; -import com.xmzs.common.log.annotation.Log; -import com.xmzs.common.log.enums.BusinessType; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.common.tenant.helper.TenantHelper; -import com.xmzs.common.web.core.BaseController; -import com.xmzs.system.domain.bo.SysDeptBo; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.system.domain.request.UserRequest; -import com.xmzs.system.domain.vo.*; -import com.xmzs.system.listener.SysUserImportListener; -import com.xmzs.system.service.*; -import jakarta.servlet.http.HttpServletResponse; -import lombok.RequiredArgsConstructor; -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; - -/** - * 用户信息 - * - * @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); - } - - /** - * 导出用户列表 - */ - @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("当前租户下用户名额不足,请联系管理员"); - } - } - 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/ChatMessage.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/ChatMessage.java deleted file mode 100644 index 6691f321..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/ChatMessage.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; - -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; - - /** - * 消息内容 - */ - @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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/ChatToken.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/ChatToken.java deleted file mode 100644 index 83631d6e..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/ChatToken.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.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 chat_token - * - * @author Lion Li - * @date 2023-11-26 - */ -@Data -@TableName("chat_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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/PaymentOrders.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/PaymentOrders.java deleted file mode 100644 index 0729322b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/PaymentOrders.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serial; -import java.math.BigDecimal; - -/** - * 支付订单对象 payment_orders - * - * @author Lion Li - * @date 2023-12-29 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("sys_pay_order") -public class PaymentOrders 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysCache.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysCache.java deleted file mode 100644 index d3ed8614..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysCache.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.xmzs.system.domain; - -import com.xmzs.common.core.utils.StringUtils; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 缓存信息 - * - * @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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysConfig.java deleted file mode 100644 index 5e49cf0b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysConfig.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 参数配置表 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDept.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDept.java deleted file mode 100644 index 93f05c02..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDept.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDictData.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDictData.java deleted file mode 100644 index 523d4d4d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDictData.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 字典数据表 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDictType.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDictType.java deleted file mode 100644 index 1788177f..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysDictType.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 字典类型表 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysLogininfor.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysLogininfor.java deleted file mode 100644 index 1ce9fc19..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysLogininfor.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysMenu.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysMenu.java deleted file mode 100644 index 79cebd77..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysMenu.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.core.constant.Constants; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysModel.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysModel.java deleted file mode 100644 index 690f4061..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysModel.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serial; - -/** - * 系统模型对象 sys_model - * - * @author Lion Li - * @date 2024-04-04 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("sys_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 remark; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysNotice.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysNotice.java deleted file mode 100644 index 5e20e4d1..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysNotice.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - - -/** - * 通知公告表 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOperLog.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOperLog.java deleted file mode 100644 index 250e7df6..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOperLog.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOss.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOss.java deleted file mode 100644 index 414c47c1..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOss.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOssConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOssConfig.java deleted file mode 100644 index 46580f6e..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysOssConfig.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysPost.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysPost.java deleted file mode 100644 index b8b39652..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysPost.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 岗位表 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRole.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRole.java deleted file mode 100644 index 52f833e9..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRole.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -/** - * 角色表 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRoleDept.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRoleDept.java deleted file mode 100644 index 4cf396c3..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRoleDept.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRoleMenu.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRoleMenu.java deleted file mode 100644 index 7f6bc587..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysRoleMenu.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysTenant.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysTenant.java deleted file mode 100644 index a4dde1c6..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysTenant.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysTenantPackage.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysTenantPackage.java deleted file mode 100644 index a1c7b1b4..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysTenantPackage.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUser.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUser.java deleted file mode 100644 index bbe038e5..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUser.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.*; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.tenant.core.TenantEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -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 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 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserOnline.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserOnline.java deleted file mode 100644 index 0ef4fd90..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserOnline.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserPost.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserPost.java deleted file mode 100644 index ceca287a..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserPost.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserRole.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserRole.java deleted file mode 100644 index 688c66c1..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/SysUserRole.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/VoiceRole.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/VoiceRole.java deleted file mode 100644 index ab7b1e98..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/VoiceRole.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.xmzs.system.domain; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serial; - -/** - * 配音角色对象 voice_role - * - * @author Lion Li - * @date 2024-03-19 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("voice_role") -public class VoiceRole extends BaseEntity { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * id - */ - @TableId(value = "id") - private Long id; - - /** - * 角色名称 - */ - private String name; - - /** - * 角色描述 - */ - private String description; - - /** - * 头像 - */ - private String avatar; - - /** - * 角色id - */ - private String voiceId; - - /** - * 音频地址 - */ - private String fileUrl; - - /** - * 音频预处理(实验性) - */ - private String preProcess; - - /** - * 备注 - */ - private String remark; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/ChatMessageBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/ChatMessageBo.java deleted file mode 100644 index 4d0cadd2..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/ChatMessageBo.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.ChatMessage; -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 聊天消息业务对象 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 - */ - @NotBlank(message = "用户ID", groups = { AddGroup.class, EditGroup.class }) - private Long UserId; - - /** - * 消息内容 - */ - @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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/PaymentOrdersBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/PaymentOrdersBo.java deleted file mode 100644 index 67b98a2b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/PaymentOrdersBo.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.PaymentOrders; -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 支付订单业务对象 payment_orders - * - * @author Lion Li - * @date 2023-12-29 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@AutoMapper(target = PaymentOrders.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysConfigBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysConfigBo.java deleted file mode 100644 index fc9e4f02..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysConfigBo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.SysConfig; -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_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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDeptBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDeptBo.java deleted file mode 100644 index df6a1aad..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDeptBo.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.SysDept; -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; - -/** - * 部门业务对象 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDictDataBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDictDataBo.java deleted file mode 100644 index 2174234b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDictDataBo.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDictTypeBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDictTypeBo.java deleted file mode 100644 index 9e0bcc13..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysDictTypeBo.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.SysDictType; -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; - -/** - * 字典类型业务对象 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysLogininforBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysLogininforBo.java deleted file mode 100644 index 227c22eb..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysLogininforBo.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.system.domain.SysLogininfor; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysMenuBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysMenuBo.java deleted file mode 100644 index 81c19c80..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysMenuBo.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysModelBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysModelBo.java deleted file mode 100644 index a2b822e7..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysModelBo.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.SysModel; -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 系统模型业务对象 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; - - /** - * 备注 - */ - @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) - private String remark; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysNoticeBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysNoticeBo.java deleted file mode 100644 index 7c3591e8..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysNoticeBo.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.core.xss.Xss; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.SysNotice; -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_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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOperLogBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOperLogBo.java deleted file mode 100644 index a4034a96..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOperLogBo.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.log.event.OperLogEvent; -import com.xmzs.system.domain.SysOperLog; -import io.github.linpeilie.annotations.AutoMapper; -import io.github.linpeilie.annotations.AutoMappers; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOssBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOssBo.java deleted file mode 100644 index 40ee5c73..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOssBo.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOssConfigBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOssConfigBo.java deleted file mode 100644 index a7417614..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysOssConfigBo.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysPostBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysPostBo.java deleted file mode 100644 index 5f8ed62d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysPostBo.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.SysPost; -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_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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysRoleBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysRoleBo.java deleted file mode 100644 index b6dfa3f1..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysRoleBo.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysTenantBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysTenantBo.java deleted file mode 100644 index 412778c2..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysTenantBo.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysTenantPackageBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysTenantPackageBo.java deleted file mode 100644 index 5bb2ff78..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysTenantPackageBo.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.SysTenantPackage; -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; - -/** - * 租户套餐业务对象 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(com.xmzs.common.core.utils.StringUtils.join(source.getMenuIds(), \",\"))") - private Long[] menuIds; - - /** - * 备注 - */ - private String remark; - - /** - * 菜单树选择项是否关联显示 - */ - private Boolean menuCheckStrictly; - - /** - * 状态(0正常 1停用) - */ - private String status; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysUserBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysUserBo.java deleted file mode 100644 index 20aa9d28..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysUserBo.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.xss.Xss; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.common.sensitive.annotation.Sensitive; -import com.xmzs.common.sensitive.core.SensitiveStrategy; -import com.xmzs.system.domain.SysUser; -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 java.math.BigDecimal; - -/** - * 用户信息业务对象 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; - - /** - * 帐号状态(0正常 1停用) - */ - private String status; - - /** - * 微信头像 - */ - private String avatar; - - /** - * 备注 - */ - private String remark; - - /** - * 角色组 - */ - @Size(min = 1, message = "用户角色不能为空") - private Long[] roleIds; - - /** - * 岗位组 - */ - private Long[] postIds; - - /** - * 数据权限 当前角色ID - */ - private Long roleId; - - /** 普通用户的标识,对当前开发者帐号唯一。一个openid对应一个公众号或小程序 */ - private String openId; - - /** 用户等级 */ - private String userGrade; - - /** 用户余额 */ - private BigDecimal userBalance; - - public SysUserBo(Long userId) { - this.userId = userId; - } - - public boolean isSuperAdmin() { - return UserConstants.SUPER_ADMIN_ID.equals(this.userId); - } - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysUserProfileBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysUserProfileBo.java deleted file mode 100644 index d8999e51..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/SysUserProfileBo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.core.xss.Xss; -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.common.sensitive.annotation.Sensitive; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/VoiceRoleBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/VoiceRoleBo.java deleted file mode 100644 index 98c329f0..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/bo/VoiceRoleBo.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.xmzs.system.domain.bo; - -import com.xmzs.common.mybatis.core.domain.BaseEntity; -import com.xmzs.system.domain.VoiceRole; -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 = VoiceRole.class, reverseConvertGenerate = false) -public class VoiceRoleBo extends BaseEntity { - - /** - * id - */ - @NotNull(message = "id不能为空") - private Long id; - - /** - * 角色名称 - */ - @NotBlank(message = "角色名称不能为空") - private String name; - - /** - * 角色描述 - */ - @NotBlank(message = "角色描述不能为空") - private String description; - - /** - * 头像 - */ - @NotBlank(message = "头像不能为空") - private String avatar; - - /** - * 角色id - */ - @NotBlank(message = "角色id不能为空") - private String voiceId; - - /** - * 音频地址 - */ - @NotBlank(message = "音频地址不能为空") - private String fileUrl; - - /** - * 音频预处理(实验性) - */ - @NotBlank(message = "音频预处理(实验性)不能为空") - private String preProcess; - - /** - * 备注 - */ - @NotBlank(message = "备注不能为空") - private String remark; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/EmailRequest.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/EmailRequest.java deleted file mode 100644 index f26578ac..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/EmailRequest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.web.domain.request; - -import jakarta.validation.constraints.NotNull; -import lombok.Data; - - -/** - * 用户登录 - */ -@Data -public class EmailRequest { - /** - * 账号 - */ - @NotNull(message = "账号不能为空") - private String username; - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/OrderRequest.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/OrderRequest.java deleted file mode 100644 index 7a5a1dd2..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/OrderRequest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.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; -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/UserRequest.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/UserRequest.java deleted file mode 100644 index 82c5cd2a..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/request/UserRequest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.system.domain.request; - -import jakarta.validation.constraints.NotNull; -import lombok.Data; - - -/** - * 编辑用户 - */ -@Data -public class UserRequest { - /** - * 用户名称 - */ - @NotNull(message = "用户名称不能为空") - private String nickName; - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/AvatarVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/AvatarVo.java deleted file mode 100644 index a6091e8c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/AvatarVo.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xmzs.system.domain.vo; - -import lombok.Data; - -/** - * 用户头像信息 - * - * @author Michelle.Chung - */ -@Data -public class AvatarVo { - - /** - * 头像地址 - */ - private String imgUrl; - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/CacheListInfoVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/CacheListInfoVo.java deleted file mode 100644 index 21e5457c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/CacheListInfoVo.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/CaptchaVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/CaptchaVo.java deleted file mode 100644 index 24971a32..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/CaptchaVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.web.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ChatMessageVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ChatMessageVo.java deleted file mode 100644 index 5b984f47..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ChatMessageVo.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.common.core.validate.EditGroup; -import com.xmzs.system.domain.ChatMessage; -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; - -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 = "消息内容不能为空", 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ChatTokenVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ChatTokenVo.java deleted file mode 100644 index 3c4f3f17..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ChatTokenVo.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.xmzs.common.core.validate.AddGroup; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/DeptTreeSelectVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/DeptTreeSelectVo.java deleted file mode 100644 index b3c8eb2d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/DeptTreeSelectVo.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/LoginTenantVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/LoginTenantVo.java deleted file mode 100644 index a7852815..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/LoginTenantVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/LoginVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/LoginVo.java deleted file mode 100644 index 29885d70..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/LoginVo.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.xmzs.web.domain.vo; - -import com.xmzs.common.core.domain.model.LoginUser; -import lombok.Data; - -/** - * 登录返回信息 - * - * @author Michelle.Chung - */ -@Data -public class LoginVo { - private String token; - private LoginUser userInfo; -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/MenuTreeSelectVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/MenuTreeSelectVo.java deleted file mode 100644 index a9ada189..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/MenuTreeSelectVo.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/MetaVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/MetaVo.java deleted file mode 100644 index 8f6bdf73..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/MetaVo.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.xmzs.common.core.utils.StringUtils; -import lombok.Data; - -/** - * 路由显示信息 - * - * @author ruoyi - */ - -@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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/PaymentOrdersVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/PaymentOrdersVo.java deleted file mode 100644 index 0825c35d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/PaymentOrdersVo.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.system.domain.PaymentOrders; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -import java.io.Serial; -import java.io.Serializable; -import java.math.BigDecimal; - - - -/** - * 支付订单视图对象 payment_orders - * - * @author Lion Li - * @date 2023-12-29 - */ -@Data -@ExcelIgnoreUnannotated -@AutoMapper(target = PaymentOrders.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; - - /** - * 二维码地址 - */ - private String url; - - /** - * 备注 - */ - @ExcelProperty(value = "备注") - private String remark; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ProfileVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ProfileVo.java deleted file mode 100644 index 541fd33a..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/ProfileVo.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/RouterVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/RouterVo.java deleted file mode 100644 index feaeb21b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/RouterVo.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysConfigVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysConfigVo.java deleted file mode 100644 index 7f0d3de4..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysConfigVo.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.system.domain.SysConfig; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDeptVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDeptVo.java deleted file mode 100644 index 314ef4d7..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDeptVo.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.system.domain.SysDept; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDictDataVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDictDataVo.java deleted file mode 100644 index 3b6ff224..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDictDataVo.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDictTypeVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDictTypeVo.java deleted file mode 100644 index 292c1064..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysDictTypeVo.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysLogininforVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysLogininforVo.java deleted file mode 100644 index d1a9e818..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysLogininforVo.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysMenuVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysMenuVo.java deleted file mode 100644 index df59e971..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysMenuVo.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.xmzs.system.domain.SysMenu; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysModelVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysModelVo.java deleted file mode 100644 index 3ed94eb1..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysModelVo.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.system.domain.SysModel; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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; - - /** - * 备注 - */ - @ExcelProperty(value = "备注") - private String remark; - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysNoticeVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysNoticeVo.java deleted file mode 100644 index eeea7730..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysNoticeVo.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.xmzs.common.translation.annotation.Translation; -import com.xmzs.common.translation.constant.TransConstant; -import com.xmzs.system.domain.SysNotice; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOperLogVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOperLogVo.java deleted file mode 100644 index 16adc702..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOperLogVo.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.system.domain.SysOperLog; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssConfigVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssConfigVo.java deleted file mode 100644 index 12ff5542..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssConfigVo.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssUploadVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssUploadVo.java deleted file mode 100644 index 326ec26d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssUploadVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssVo.java deleted file mode 100644 index 6c754f0a..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysOssVo.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.xmzs.common.translation.annotation.Translation; -import com.xmzs.common.translation.constant.TransConstant; -import com.xmzs.system.domain.SysOss; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysPostVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysPostVo.java deleted file mode 100644 index 0f87704d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysPostVo.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.system.domain.SysPost; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysRoleVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysRoleVo.java deleted file mode 100644 index 76d6a9f5..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysRoleVo.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.system.domain.SysRole; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysTenantPackageVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysTenantPackageVo.java deleted file mode 100644 index e1dd2704..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysTenantPackageVo.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.system.domain.SysTenantPackage; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysTenantVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysTenantVo.java deleted file mode 100644 index 41587426..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysTenantVo.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import com.xmzs.system.domain.SysTenant; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserExportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserExportVo.java deleted file mode 100644 index 9241b82f..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserExportVo.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import io.github.linpeilie.annotations.AutoMapper; -import io.github.linpeilie.annotations.ReverseAutoMapping; -import lombok.Data; -import lombok.NoArgsConstructor; - -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; - - /** - * 用户邮箱 - */ - @ExcelProperty(value = "用户邮箱") - private String email; - - /** - * 手机号码 - */ - @ExcelProperty(value = "手机号码") - private String phonenumber; - - /** - * 用户性别 - */ - @ExcelProperty(value = "用户性别", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_user_sex") - private String sex; - - /** - * 帐号状态(0正常 1停用) - */ - @ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_normal_disable") - private String status; - - /** - * 最后登录IP - */ - @ExcelProperty(value = "最后登录IP") - private String loginIp; - - /** - * 最后登录时间 - */ - @ExcelProperty(value = "最后登录时间") - private Date loginDate; - - /** - * 部门名称 - */ - @ReverseAutoMapping(target = "deptName", source = "dept.deptName") - @ExcelProperty(value = "部门名称") - private String deptName; - - /** - * 负责人 - */ - @ReverseAutoMapping(target = "leader", source = "dept.leader") - @ExcelProperty(value = "部门负责人") - private String leader; - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserImportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserImportVo.java deleted file mode 100644 index b551a33c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserImportVo.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.common.excel.annotation.ExcelDictFormat; -import com.xmzs.common.excel.convert.ExcelDictConvert; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serial; -import java.io.Serializable; - -/** - * 用户对象导入VO - * - * @author Lion Li - */ - -@Data -@NoArgsConstructor -// @Accessors(chain = true) // 导入不允许使用 会找不到set方法 -public class SysUserImportVo implements Serializable { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * 用户ID - */ - @ExcelProperty(value = "用户序号") - private Long userId; - - /** - * 部门ID - */ - @ExcelProperty(value = "部门编号") - private Long deptId; - - /** - * 用户账号 - */ - @ExcelProperty(value = "登录名称") - private String userName; - - /** - * 用户昵称 - */ - @ExcelProperty(value = "用户名称") - private String nickName; - - /** - * 用户邮箱 - */ - @ExcelProperty(value = "用户邮箱") - private String email; - - /** - * 手机号码 - */ - @ExcelProperty(value = "手机号码") - private String phonenumber; - - /** - * 用户性别 - */ - @ExcelProperty(value = "用户性别", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_user_sex") - private String sex; - - /** - * 帐号状态(0正常 1停用) - */ - @ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_normal_disable") - private String status; - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserInfoVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserInfoVo.java deleted file mode 100644 index 0b5633dc..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserInfoVo.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserVo.java deleted file mode 100644 index 6d4dcb84..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/SysUserVo.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.xmzs.system.domain.SysUser; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -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 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 List roles; - - /** - * 角色组 - */ - private Long[] roleIds; - - /** - * 岗位组 - */ - private Long[] postIds; - - /** - * 数据权限 当前角色ID - */ - private Long roleId; - - /** 用户等级 */ - private String userGrade; - - /** 用户余额 */ - private double userBalance; -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/TenantListVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/TenantListVo.java deleted file mode 100644 index db2eff8c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/TenantListVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/UserInfoVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/UserInfoVo.java deleted file mode 100644 index 55e00b28..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/UserInfoVo.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/VoiceRoleVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/VoiceRoleVo.java deleted file mode 100644 index 832c3d93..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/domain/vo/VoiceRoleVo.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.xmzs.system.domain.vo; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import com.xmzs.system.domain.VoiceRole; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -import java.io.Serial; -import java.io.Serializable; - - - -/** - * 配音角色视图对象 voice_role - * - * @author Lion Li - * @date 2024-03-19 - */ -@Data -@ExcelIgnoreUnannotated -@AutoMapper(target = VoiceRole.class) -public class VoiceRoleVo 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; - - /** - * 角色id - */ - @ExcelProperty(value = "角色id") - private String voiceId; - - /** - * 音频地址 - */ - @ExcelProperty(value = "音频地址") - private String fileUrl; - - /** - * 音频预处理(实验性) - */ - @ExcelProperty(value = "音频预处理") - private String preProcess; - - /** - * 备注 - */ - @ExcelProperty(value = "备注") - private String remark; - - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/handler/CustomerBigDecimalSerialize.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/handler/CustomerBigDecimalSerialize.java deleted file mode 100644 index dab8184e..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/handler/CustomerBigDecimalSerialize.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/handler/WechatMessageHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/handler/WechatMessageHandler.java deleted file mode 100644 index 059f6b13..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/handler/WechatMessageHandler.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.xmzs.system.handler; - -import com.xmzs.common.chat.domain.request.ChatRequest; -import com.xmzs.common.chat.domain.request.Dall3Request; -import com.xmzs.common.chat.entity.chat.ChatCompletion; -import com.xmzs.common.chat.entity.images.Item; -import com.xmzs.common.wechat.api.MessageTools; -import com.xmzs.common.wechat.beans.BaseMsg; -import com.xmzs.common.wechat.core.Core; -import com.xmzs.common.wechat.face.IMsgHandlerFace; -import com.xmzs.system.cofing.KeywordConfig; -import com.xmzs.system.service.ISseService; - -import java.util.List; - -/** - * 微信消息处理程序 - * - * @author ashinnotfound - * @date 2023/03/19 - */ -public class WechatMessageHandler implements IMsgHandlerFace { - private final ISseService sseService; - private final KeywordConfig keywordConfig; - - public WechatMessageHandler(ISseService sseService, KeywordConfig keywordConfig) { - this.sseService = sseService; - this.keywordConfig = keywordConfig; - } - - @Override - public String textMsgHandle(BaseMsg baseMsg) { - //如果是在群聊 - if (baseMsg.isGroupMsg()){ - //存在@机器人的消息就向ChatGPT提问 - if (baseMsg.getText().contains("@"+ Core.getInstance().getNickName())){ - //去除@再提问 - String prompt = baseMsg.getText().replace("@"+ Core.getInstance().getNickName() + " ", "").trim(); - return textResponse(baseMsg.getFromUserName(), prompt); - } - }else { - ChatRequest chatBO = new ChatRequest(); - chatBO.setPrompt(baseMsg.getText()); - chatBO.setModel(ChatCompletion.Model.GPT_3_5_TURBO.getName()); - return sseService.chat(chatBO); - } - return null; - } - - - private String textResponse(String userName, String content) { - if (keywordConfig.getReset().equals(content)){ - return "重置会话成功"; - }else { - ChatRequest chatBO = new ChatRequest(); - chatBO.setPrompt(content); - chatBO.setUserId(userName); - if (content.startsWith(keywordConfig.getImage())) { - Dall3Request dall3Request = new Dall3Request(); - dall3Request.setPrompt(content.replaceFirst(keywordConfig.getImage() + " ", "")); - List items = sseService.dall3(dall3Request); - MessageTools.sendPicMsgByUserId(userName, items.get(0).getUrl()); - } else { - chatBO.setPrompt(content); - } - } - return "这个问题我还没学会呢"; - } - - @Override - public String picMsgHandle(BaseMsg baseMsg) { - return null; - } - - @Override - public String voiceMsgHandle(BaseMsg baseMsg) { - return null; - } - - @Override - public String viedoMsgHandle(BaseMsg baseMsg) { - return null; - } - - @Override - public String nameCardMsgHandle(BaseMsg baseMsg) { - return null; - } - - @Override - public void sysMsgHandle(BaseMsg baseMsg) { - } - - @Override - public String verifyAddFriendMsgHandle(BaseMsg baseMsg) { - return null; - } - - @Override - public String mediaMsgHandle(BaseMsg baseMsg) { - return null; - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/listener/SSEEventSourceListener.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/listener/SSEEventSourceListener.java deleted file mode 100644 index 1a5dbc42..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/listener/SSEEventSourceListener.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.xmzs.system.listener; - - -import cn.hutool.core.collection.CollectionUtil; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xmzs.common.chat.config.LocalCache; -import com.xmzs.common.chat.entity.chat.ChatCompletionResponse; -import com.xmzs.common.chat.utils.TikTokensUtil; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.system.domain.bo.ChatMessageBo; -import com.xmzs.system.domain.bo.SysModelBo; -import com.xmzs.system.domain.vo.SysModelVo; -import com.xmzs.system.service.IChatMessageService; -import com.xmzs.system.service.IChatCostService; -import com.xmzs.system.service.ISysModelService; -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.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 (data.equals("[DONE]")) { - //成功响应 - 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"); - 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; - } - String content = completionResponse.getChoices().get(0).getDelta().getContent(); - if(StringUtils.isEmpty(content)){ - 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/listener/SysUserImportListener.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/listener/SysUserImportListener.java deleted file mode 100644 index 3bd02741..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/listener/SysUserImportListener.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.ValidatorUtils; -import com.xmzs.common.excel.core.ExcelListener; -import com.xmzs.common.excel.core.ExcelResult; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.system.domain.vo.SysUserImportVo; -import com.xmzs.system.domain.vo.SysUserVo; -import com.xmzs.system.service.ISysConfigService; -import com.xmzs.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(initPassword); - 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); - 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/ChatMessageMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/ChatMessageMapper.java deleted file mode 100644 index 83eb4809..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/ChatMessageMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.ChatMessage; -import com.xmzs.system.domain.vo.ChatMessageVo; - - -/** - * 聊天消息Mapper接口 - * - * @author Lion Li - * @date 2023-11-26 - */ -public interface ChatMessageMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/ChatTokenMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/ChatTokenMapper.java deleted file mode 100644 index afc2f10d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/ChatTokenMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.ChatToken; -import com.xmzs.system.domain.vo.ChatTokenVo; - - -/** - * 聊天消息Mapper接口 - * - * @author Lion Li - * @date 2023-11-26 - */ -public interface ChatTokenMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/PaymentOrdersMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/PaymentOrdersMapper.java deleted file mode 100644 index 776bbc09..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/PaymentOrdersMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.PaymentOrders; -import com.xmzs.system.domain.vo.PaymentOrdersVo; - -/** - * 支付订单Mapper接口 - * - * @author Lion Li - * @date 2023-12-29 - */ -public interface PaymentOrdersMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysConfigMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysConfigMapper.java deleted file mode 100644 index c34500d0..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysConfigMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysConfig; -import com.xmzs.system.domain.vo.SysConfigVo; - -/** - * 参数配置 数据层 - * - * @author Lion Li - */ -public interface SysConfigMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDeptMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDeptMapper.java deleted file mode 100644 index bfd8c633..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDeptMapper.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.xmzs.system.mapper; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.toolkit.Constants; -import com.xmzs.common.mybatis.annotation.DataColumn; -import com.xmzs.common.mybatis.annotation.DataPermission; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysDept; -import com.xmzs.system.domain.vo.SysDeptVo; -import org.apache.ibatis.annotations.Param; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDictDataMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDictDataMapper.java deleted file mode 100644 index cb315303..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDictDataMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.system.mapper; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysDictData; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDictTypeMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDictTypeMapper.java deleted file mode 100644 index a8af3642..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysDictTypeMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysDictType; -import com.xmzs.system.domain.vo.SysDictTypeVo; - -/** - * 字典表 数据层 - * - * @author Lion Li - */ -public interface SysDictTypeMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysLogininforMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysLogininforMapper.java deleted file mode 100644 index 6421f901..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysLogininforMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysLogininfor; -import com.xmzs.system.domain.vo.SysLogininforVo; - -/** - * 系统访问日志情况信息 数据层 - * - * @author Lion Li - */ -public interface SysLogininforMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysMenuMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysMenuMapper.java deleted file mode 100644 index 64714c71..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysMenuMapper.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysMenu; -import com.xmzs.system.domain.vo.SysMenuVo; -import org.apache.ibatis.annotations.Param; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysModelMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysModelMapper.java deleted file mode 100644 index ccded060..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysModelMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysModel; -import com.xmzs.system.domain.vo.SysModelVo; - -/** - * 系统模型Mapper接口 - * - * @author Lion Li - * @date 2024-04-04 - */ -public interface SysModelMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysNoticeMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysNoticeMapper.java deleted file mode 100644 index 9b36c0ad..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysNoticeMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysNotice; -import com.xmzs.system.domain.vo.SysNoticeVo; - -/** - * 通知公告表 数据层 - * - * @author Lion Li - */ -public interface SysNoticeMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOperLogMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOperLogMapper.java deleted file mode 100644 index 5b82d564..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOperLogMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysOperLog; -import com.xmzs.system.domain.vo.SysOperLogVo; - -/** - * 操作日志 数据层 - * - * @author Lion Li - */ -public interface SysOperLogMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOssConfigMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOssConfigMapper.java deleted file mode 100644 index d07cf22c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOssConfigMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysOssConfig; -import com.xmzs.system.domain.vo.SysOssConfigVo; - -/** - * 对象存储配置Mapper接口 - * - * @author Lion Li - * @author 孤舟烟雨 - * @date 2021-08-13 - */ -public interface SysOssConfigMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOssMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOssMapper.java deleted file mode 100644 index 58503949..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysOssMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysOss; -import com.xmzs.system.domain.vo.SysOssVo; - -/** - * 文件上传 数据层 - * - * @author Lion Li - */ -public interface SysOssMapper extends BaseMapperPlus { -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysPostMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysPostMapper.java deleted file mode 100644 index 851c7b9c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysPostMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysPost; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleDeptMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleDeptMapper.java deleted file mode 100644 index 9dc642c9..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleDeptMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysRoleDept; - -/** - * 角色与部门关联表 数据层 - * - * @author Lion Li - */ -public interface SysRoleDeptMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleMapper.java deleted file mode 100644 index 09cffc21..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleMapper.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.xmzs.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 com.xmzs.common.mybatis.annotation.DataColumn; -import com.xmzs.common.mybatis.annotation.DataPermission; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysRole; -import com.xmzs.system.domain.vo.SysRoleVo; -import org.apache.ibatis.annotations.Param; - -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleMenuMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleMenuMapper.java deleted file mode 100644 index 0bdb335c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysRoleMenuMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysRoleMenu; - -/** - * 角色与菜单关联表 数据层 - * - * @author Lion Li - */ -public interface SysRoleMenuMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysTenantMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysTenantMapper.java deleted file mode 100644 index 9e47b959..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysTenantMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysTenant; -import com.xmzs.system.domain.vo.SysTenantVo; - -/** - * 租户Mapper接口 - * - * @author Michelle.Chung - */ -public interface SysTenantMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysTenantPackageMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysTenantPackageMapper.java deleted file mode 100644 index 8e5e2cd6..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysTenantPackageMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysTenantPackage; -import com.xmzs.system.domain.vo.SysTenantPackageVo; - -/** - * 租户套餐Mapper接口 - * - * @author Michelle.Chung - */ -public interface SysTenantPackageMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserMapper.java deleted file mode 100644 index e7ba4996..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserMapper.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.xmzs.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 com.xmzs.common.mybatis.annotation.DataColumn; -import com.xmzs.common.mybatis.annotation.DataPermission; -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserPostMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserPostMapper.java deleted file mode 100644 index 215698ae..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserPostMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysUserPost; - -/** - * 用户与岗位关联表 数据层 - * - * @author Lion Li - */ -public interface SysUserPostMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserRoleMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserRoleMapper.java deleted file mode 100644 index 241cc52b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/SysUserRoleMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.SysUserRole; - -import java.util.List; - -/** - * 用户与角色关联表 数据层 - * - * @author Lion Li - */ -public interface SysUserRoleMapper extends BaseMapperPlus { - - List selectUserIdsByRoleId(Long roleId); - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/VoiceRoleMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/VoiceRoleMapper.java deleted file mode 100644 index 88a4267b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/mapper/VoiceRoleMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.xmzs.system.mapper; - -import com.xmzs.common.mybatis.core.mapper.BaseMapperPlus; -import com.xmzs.system.domain.VoiceRole; -import com.xmzs.system.domain.vo.VoiceRoleVo; - -/** - * 配音角色Mapper接口 - * - * @author Lion Li - * @date 2024-03-19 - */ -public interface VoiceRoleMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/runner/SystemApplicationRunner.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/runner/SystemApplicationRunner.java deleted file mode 100644 index 418598a0..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/runner/SystemApplicationRunner.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.system.runner; - -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ChatService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ChatService.java deleted file mode 100644 index f12c1d39..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ChatService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.system.domain.bo.ChatMessageBo; - -/** - * @author hncboy - * @date 2023/3/22 19:41 - * 聊天相关业务接口 - */ -public interface ChatService { - - - /** - * 根据消耗的tokens扣除余额 - * - * @param chatMessageBo - * @return 结果 - */ - - void deductToken(ChatMessageBo chatMessageBo); - - /** - * 扣除用户的余额 - * - */ - void deductUserBalance(Long userId, Double numberCost); -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatCostService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatCostService.java deleted file mode 100644 index dc1b3378..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatCostService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatMessageService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatMessageService.java deleted file mode 100644 index 41a2c338..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatMessageService.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.ChatMessageBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatService.java deleted file mode 100644 index a62e520d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.system.domain.bo.ChatMessageBo; - -/** - * @author hncboy - * @date 2023/3/22 19:41 - * 聊天相关业务接口 - */ -public interface IChatService { - - - /** - * 根据消耗的tokens扣除余额 - * - * @param chatMessageBo - * @return 结果 - */ - - void deductToken(ChatMessageBo chatMessageBo); - - /** - * 扣除用户的余额 - * - */ - void deductUserBalance(Long userId, Double numberCost); - - /** - * 扣除mj任务费用 - * - */ - void mjTaskDeduct(String prompt, double cost); -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatTokenService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatTokenService.java deleted file mode 100644 index 5e168ca0..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IChatTokenService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IPaymentOrdersService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IPaymentOrdersService.java deleted file mode 100644 index bfc07d1a..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/IPaymentOrdersService.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.PaymentOrdersBo; -import com.xmzs.system.domain.vo.PaymentOrdersVo; - -import java.util.Collection; -import java.util.List; - -/** - * 支付订单Service接口 - * - * @author Lion Li - * @date 2023-12-29 - */ -public interface IPaymentOrdersService { - - /** - * 查询支付订单 - */ - PaymentOrdersVo queryById(Long id); - - /** - * 查询支付订单列表 - */ - 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISseService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISseService.java deleted file mode 100644 index 3f5288cd..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISseService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xmzs.system.service; - - -import com.xmzs.common.chat.domain.request.ChatRequest; -import com.xmzs.common.chat.domain.request.Dall3Request; -import com.xmzs.common.chat.entity.Tts.TextToSpeech; -import com.xmzs.common.chat.entity.files.UploadFileResponse; -import com.xmzs.common.chat.entity.images.Item; -import com.xmzs.common.chat.entity.whisper.WhisperResponse; -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); - - /** - * 语音转文字 - * @param file - */ - WhisperResponse speechToTextTranscriptionsV2(MultipartFile file); - - /** - * 文字转语音 - */ - ResponseEntity textToSpeed(TextToSpeech textToSpeech); - - /** - * 客户端发送消息到服务端 - * @param chatRequest - */ - String chat(ChatRequest chatRequest); - - /** - * 绘画接口 - * @param request - */ - List dall3(Dall3Request request); - - - /** - * 判断用户是否付费 - */ - void checkUserGrade(); - - UploadFileResponse upload(MultipartFile file); -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysConfigService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysConfigService.java deleted file mode 100644 index 3fd46852..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysConfigService.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysConfigBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDataScopeService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDataScopeService.java deleted file mode 100644 index 3224f95f..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDataScopeService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDeptService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDeptService.java deleted file mode 100644 index 41449c39..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDeptService.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.xmzs.system.service; - -import cn.hutool.core.lang.tree.Tree; -import com.xmzs.system.domain.SysDept; -import com.xmzs.system.domain.bo.SysDeptBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDictDataService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDictDataService.java deleted file mode 100644 index 8894e46d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDictDataService.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysDictDataBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDictTypeService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDictTypeService.java deleted file mode 100644 index 513a9538..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysDictTypeService.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysDictTypeBo; -import com.xmzs.system.domain.vo.SysDictDataVo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysLogininforService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysLogininforService.java deleted file mode 100644 index a0ff962e..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysLogininforService.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysLogininforBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysMenuService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysMenuService.java deleted file mode 100644 index 8b687eee..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysMenuService.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.xmzs.system.service; - -import cn.hutool.core.lang.tree.Tree; -import com.xmzs.system.domain.SysMenu; -import com.xmzs.system.domain.bo.SysMenuBo; -import com.xmzs.system.domain.vo.RouterVo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysModelService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysModelService.java deleted file mode 100644 index ea5ed714..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysModelService.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysModelBo; -import com.xmzs.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); -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysNoticeService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysNoticeService.java deleted file mode 100644 index 87295ece..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysNoticeService.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysNoticeBo; -import com.xmzs.system.domain.vo.SysNoticeVo; - -import java.util.List; - -/** - * 公告 服务层 - * - * @author Lion Li - */ -public interface ISysNoticeService { - - - TableDataInfo selectPageNoticeList(SysNoticeBo notice, PageQuery pageQuery); - - /** - * 查询公告信息 - * - * @param noticeId 公告ID - * @return 公告信息 - */ - SysNoticeVo selectNoticeById(Long noticeId); - - /** - * 查询公告列表 - * - * @param notice 公告信息 - * @return 公告集合 - */ - List selectNoticeList(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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOperLogService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOperLogService.java deleted file mode 100644 index b0781ba5..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOperLogService.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysOperLogBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOssConfigService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOssConfigService.java deleted file mode 100644 index c73f54bd..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOssConfigService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysOssConfigBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOssService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOssService.java deleted file mode 100644 index 8237b06b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysOssService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysOssBo; -import com.xmzs.system.domain.vo.SysOssVo; -import jakarta.servlet.http.HttpServletResponse; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysPermissionService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysPermissionService.java deleted file mode 100644 index 953f76b2..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysPermissionService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysPostService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysPostService.java deleted file mode 100644 index 13e2ce23..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysPostService.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysPostBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysRoleService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysRoleService.java deleted file mode 100644 index a9f7eeb7..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysRoleService.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.SysUserRole; -import com.xmzs.system.domain.bo.SysRoleBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysTenantPackageService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysTenantPackageService.java deleted file mode 100644 index 4e93b6de..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysTenantPackageService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysTenantPackageBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysTenantService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysTenantService.java deleted file mode 100644 index 9879b21c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysTenantService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.bo.SysTenantBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysUserService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysUserService.java deleted file mode 100644 index bfc22bd3..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/ISysUserService.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.xmzs.system.service; - -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SseService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SseService.java deleted file mode 100644 index 297b3b1c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SseService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xmzs.system.service; - - -import com.xmzs.common.chat.domain.request.ChatRequest; -import com.xmzs.common.chat.domain.request.Dall3Request; -import com.xmzs.common.chat.entity.images.Item; -import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; - -import java.util.List; - -/** - * 描述: - * - * @author https:www.unfbx.com - * @date 2023-04-08 - */ -public interface SseService { - - /** - * 客户端发送消息到服务端 - * @param chatRequest - */ - SseEmitter sseChat(ChatRequest chatRequest); - - /** - * 绘画接口 - * @param request - */ - List dall3(Dall3Request request); - - - /** - * mj绘画接口 - */ - void mjTask(); - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SysLoginService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SysLoginService.java deleted file mode 100644 index 29dbacba..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SysLoginService.java +++ /dev/null @@ -1,418 +0,0 @@ -package com.xmzs.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 cn.hutool.core.util.RandomUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.xmzs.common.core.constant.Constants; -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.constant.TenantConstants; -import com.xmzs.common.core.domain.dto.RoleDTO; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.domain.model.VisitorLoginBody; -import com.xmzs.common.core.domain.model.VisitorLoginUser; -import com.xmzs.common.core.enums.*; -import com.xmzs.common.core.exception.user.CaptchaException; -import com.xmzs.common.core.exception.user.CaptchaExpireException; -import com.xmzs.common.core.exception.user.UserException; -import com.xmzs.common.core.utils.*; -import com.xmzs.common.log.event.LogininforEvent; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.common.tenant.exception.TenantException; -import com.xmzs.common.tenant.helper.TenantHelper; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.system.domain.vo.SysTenantVo; -import com.xmzs.system.domain.vo.SysUserVo; -import com.xmzs.system.mapper.SysUserMapper; -import com.xmzs.web.domain.vo.LoginVo; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.chanjar.weixin.common.error.WxErrorException; -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; - - @Value("${user.password.maxRetryCount}") - private Integer maxRetryCount; - - @Value("${user.password.lockTime}") - private Integer lockTime; - - /** - * 登录验证 - * - * @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 LoginVo 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(); - } - } - // 使用 openid 查询绑定用户 如未绑定用户 则根据业务自行处理 例如 创建默认用户 - SysUserVo user = userService.selectUserByOpenId(openid); - VisitorLoginUser loginUser = new VisitorLoginUser(); - if (ObjectUtil.isNull(user)) { - SysUserBo sysUser = new SysUserBo(); - // 改为自增 - String name = "游客" + RandomUtil.randomInt(10000); - // 设置默认用户名 - sysUser.setUserName(name); - // 设置默认昵称 - sysUser.setNickName(name); - // 设置默认密码 - sysUser.setPassword(BCrypt.hashpw("123456")); - // 设置微信openId - sysUser.setOpenId(openid); - // 注册用户,设置默认租户为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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SysRegisterService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SysRegisterService.java deleted file mode 100644 index 985e8a5d..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/SysRegisterService.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.xmzs.system.service; - -import cn.dev33.satoken.secure.BCrypt; -import com.xmzs.common.chat.constant.OpenAIConst; -import com.xmzs.common.core.constant.Constants; -import com.xmzs.common.core.constant.GlobalConstants; -import com.xmzs.common.core.domain.model.RegisterBody; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.core.exception.user.CaptchaException; -import com.xmzs.common.core.exception.user.CaptchaExpireException; -import com.xmzs.common.core.exception.user.UserException; -import com.xmzs.common.core.utils.MessageUtils; -import com.xmzs.common.core.utils.ServletUtils; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.log.event.LogininforEvent; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.SysUserRole; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.system.domain.vo.SysUserVo; -import com.xmzs.system.mapper.SysUserRoleMapper; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; - -/** - * 注册校验方法 - * - * @author Lion Li - */ -@RequiredArgsConstructor -@Service -public class SysRegisterService { - - private final ISysUserService userService; - - private final SysUserRoleMapper userRoleMapper; - - /** - * 注册 - */ - 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.setUserName(username); - sysUser.setNickName(username); - sysUser.setPassword(BCrypt.hashpw(password)); - if (!userService.checkUserNameUnique(sysUser)) { - throw new UserException("user.register.save.error", username); - } - // 设置默认余额 - sysUser.setUserBalance(new BigDecimal(OpenAIConst.USER_BALANCE)); - SysUser user = userService.registerUser(sysUser, tenantId); - if (user == null) { - throw new UserException("user.register.error"); - } - // 设置默认角色 - 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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/TextReviewService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/TextReviewService.java deleted file mode 100644 index 3117bf9c..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/TextReviewService.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.xmzs.system.service; - -import com.alibaba.fastjson.JSONObject; -import lombok.extern.slf4j.Slf4j; -import okhttp3.*; -import org.springframework.beans.factory.annotation.Value; - -import java.io.IOException; -import java.net.URLEncoder; - - -/** - * 文本审核服务 - * - * @author: wangle - * @date: 2023/5/27 - */ -//@Service -@Slf4j -public class TextReviewService { - @Value("${baidu.textReview.apiKey}") - private String API_KEY; - @Value("${baidu.textReview.secretKey}") - private String SECRET_KEY; - - static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build(); - - /** - * 文本内容审核 - * - * @param msg - * @return String - * @Date 2023/5/27 - **/ - public String textReview(String msg) { - String conclusionType = ""; - try { - String text = URLEncoder.encode(msg); - MediaType mediaType = 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 { - MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); - RequestBody body = RequestBody.create(mediaType, "grant_type=client_credentials&client_id=" + API_KEY - + "&client_secret=" + SECRET_KEY); - 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"); - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatCostServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatCostServiceImpl.java deleted file mode 100644 index 67aea20b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatCostServiceImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.xmzs.system.service.impl; - -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.ChatToken; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.bo.ChatMessageBo; -import com.xmzs.system.domain.bo.SysModelBo; -import com.xmzs.system.domain.vo.SysModelVo; -import com.xmzs.system.mapper.SysUserMapper; -import com.xmzs.system.service.IChatCostService; -import com.xmzs.system.service.IChatMessageService; -import com.xmzs.system.service.IChatTokenService; -import com.xmzs.system.service.ISysModelService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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.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("免费用户暂时不支持此模型,请切换gpt-3.5-turbo模型或者点击《进入市场选购您的商品》充值后使用!"); - } - } - - /** - * 获取用户Id - * - * @return - */ - public Long getUserId() { - LoginUser loginUser = LoginHelper.getLoginUser(); - if (loginUser == null) { - throw new BaseException("用户未登录!"); - } - return loginUser.getUserId(); - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatMessageServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatMessageServiceImpl.java deleted file mode 100644 index a7b4d968..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatMessageServiceImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.ChatMessage; -import com.xmzs.system.domain.bo.ChatMessageBo; -import com.xmzs.system.domain.vo.ChatMessageVo; -import com.xmzs.system.mapper.ChatMessageMapper; -import com.xmzs.system.service.IChatMessageService; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -/** - * 聊天消息Service业务层处理 - * - * @author Lion Li - * @date 2023-11-26 - */ -@RequiredArgsConstructor -@Service -public class ChatMessageServiceImpl implements IChatMessageService { - - private final ChatMessageMapper baseMapper; - - /** - * 查询聊天消息 - */ - @Override - public ChatMessageVo queryById(Long id){ - return baseMapper.selectVoById(id); - } - - /** - * 查询聊天消息列表 - */ - @Override - public TableDataInfo queryPageList(ChatMessageBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } - - /** - * 查询聊天消息列表 - */ - @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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatServiceImpl.java deleted file mode 100644 index 37be027b..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatServiceImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.xmzs.system.service.impl; - -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.xmzs.common.chat.constant.OpenAIConst; -import com.xmzs.common.chat.entity.chat.ChatCompletion; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.ChatToken; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.bo.ChatMessageBo; -import com.xmzs.system.mapper.SysUserMapper; -import com.xmzs.system.service.IChatMessageService; -import com.xmzs.system.service.IChatService; -import com.xmzs.system.service.IChatTokenService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -/** - * @author hncboy - * @date 2023/3/22 19:41 - * 聊天相关业务实现类 - */ -@Slf4j -@Service -@RequiredArgsConstructor -public class ChatServiceImpl implements IChatService { - - private final SysUserMapper sysUserMapper; - - private final IChatMessageService chatMessageService; - - private final IChatTokenService chatTokenService; - - - /** - * 根据消耗的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.setToken(token2); - chatTokenService.editToken(chatToken); - } else { - chatTokenService.resetToken(chatMessageBo.getUserId(), chatMessageBo.getModelName()); - } - // 扣除用户余额 - Double numberCost = token1 * ChatCompletion.getModelCost(chatMessageBo.getModelName()); - 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 < OpenAIConst.GPT4_COST) { - throw new ServiceException("余额不足,请联系管理员充值!"); - } - - sysUserMapper.update(null, - new LambdaUpdateWrapper() - .set(SysUser::getUserBalance, Math.max(userBalance - numberCost, 0)) - .eq(SysUser::getUserId, userId)); - } - - /** - * 扣除mj任务费用 - * - * @param prompt - * @param cost - */ - @Override - public void mjTaskDeduct(String prompt, double cost) { - deductUserBalance(getUserId(), cost); - // 保存消息记录 - ChatMessageBo chatMessageBo = new ChatMessageBo(); - chatMessageBo.setUserId(getUserId()); - chatMessageBo.setModelName("mj"); - chatMessageBo.setContent(prompt); - chatMessageBo.setDeductCost(cost); - chatMessageBo.setTotalTokens(0); - chatMessageService.insertByBo(chatMessageBo); - } - - /** - * 获取用户Id - * - * @return - */ - public Long getUserId() { - LoginUser loginUser = LoginHelper.getLoginUser(); - if (loginUser == null) { - throw new BaseException("用户未登录!"); - } - return loginUser.getUserId(); - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatTokenServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatTokenServiceImpl.java deleted file mode 100644 index 23d4de05..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/ChatTokenServiceImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.xmzs.system.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.xmzs.system.domain.ChatToken; -import com.xmzs.system.mapper.ChatTokenMapper; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/PaymentOrdersServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/PaymentOrdersServiceImpl.java deleted file mode 100644 index 7f6712ad..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/PaymentOrdersServiceImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.PaymentOrders; -import com.xmzs.system.domain.bo.PaymentOrdersBo; -import com.xmzs.system.domain.vo.PaymentOrdersVo; -import com.xmzs.system.mapper.PaymentOrdersMapper; -import com.xmzs.system.service.IPaymentOrdersService; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -/** - * 支付订单Service业务层处理 - * - * @author Lion Li - * @date 2023-12-29 - */ -@RequiredArgsConstructor -@Service -public class PaymentOrdersServiceImpl implements IPaymentOrdersService { - - private final PaymentOrdersMapper baseMapper; - - /** - * 查询支付订单 - */ - @Override - public PaymentOrdersVo queryById(Long id){ - return baseMapper.selectVoById(id); - } - - /** - * 查询支付订单列表 - */ - @Override - public TableDataInfo queryPageList(PaymentOrdersBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } - - /** - * 查询支付订单列表 - */ - @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()), PaymentOrders::getOrderNo, bo.getOrderNo()); - lqw.like(StringUtils.isNotBlank(bo.getOrderName()), PaymentOrders::getOrderName, bo.getOrderName()); - lqw.eq(bo.getAmount() != null, PaymentOrders::getAmount, bo.getAmount()); - lqw.eq(StringUtils.isNotBlank(bo.getPaymentStatus()), PaymentOrders::getPaymentStatus, bo.getPaymentStatus()); - lqw.eq(StringUtils.isNotBlank(bo.getPaymentMethod()), PaymentOrders::getPaymentMethod, bo.getPaymentMethod()); - lqw.eq(bo.getUserId() != null, PaymentOrders::getUserId, bo.getUserId()); - return lqw; - } - - /** - * 新增支付订单 - */ - @Override - public Boolean insertByBo(PaymentOrdersBo bo) { - PaymentOrders add = MapstructUtils.convert(bo, PaymentOrders.class); - validEntityBeforeSave(add); - boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setId(add.getId()); - } - return flag; - } - - /** - * 修改支付订单 - */ - @Override - public Boolean updateByBo(PaymentOrdersBo bo) { - PaymentOrders update = MapstructUtils.convert(bo, PaymentOrders.class); - validEntityBeforeSave(update); - return baseMapper.updateById(update) > 0; - } - - /** - * 保存前的数据校验 - */ - private void validEntityBeforeSave(PaymentOrders entity){ - //TODO 做一些数据校验,如唯一约束 - } - - /** - * 批量删除支付订单 - */ - @Override - public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ - //TODO 做一些业务上的校验,判断是否需要校验 - } - return baseMapper.deleteBatchIds(ids) > 0; - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SseServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SseServiceImpl.java deleted file mode 100644 index b0b29d17..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SseServiceImpl.java +++ /dev/null @@ -1,353 +0,0 @@ -package com.xmzs.system.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.xmzs.common.chat.config.LocalCache; -import com.xmzs.common.chat.constant.OpenAIConst; -import com.xmzs.common.chat.domain.request.ChatRequest; -import com.xmzs.common.chat.domain.request.Dall3Request; -import com.xmzs.common.chat.entity.Tts.TextToSpeech; -import com.xmzs.common.chat.entity.chat.*; -import com.xmzs.common.chat.entity.files.UploadFileResponse; -import com.xmzs.common.chat.entity.images.Image; -import com.xmzs.common.chat.entity.images.ImageResponse; -import com.xmzs.common.chat.entity.images.Item; -import com.xmzs.common.chat.entity.whisper.WhisperResponse; -import com.xmzs.common.chat.openai.OpenAiStreamClient; -import com.xmzs.common.chat.utils.TikTokensUtil; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.exception.base.BaseException; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.bo.ChatMessageBo; -import com.xmzs.system.domain.bo.SysModelBo; -import com.xmzs.system.domain.vo.SysModelVo; -import com.xmzs.system.listener.SSEEventSourceListener; -import com.xmzs.system.mapper.SysUserMapper; -import com.xmzs.system.service.IChatCostService; -import com.xmzs.system.service.IChatMessageService; -import com.xmzs.system.service.ISseService; -import com.xmzs.system.service.ISysModelService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import okhttp3.ResponseBody; -import org.springframework.beans.factory.annotation.Value; -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.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** - * 描述: - * - * @author https:www.unfbx.com - * @date 2023-04-08 - */ -@Service -@Slf4j -@RequiredArgsConstructor -public class SseServiceImpl implements ISseService { - - private final OpenAiStreamClient openAiStreamClient; - - private final IChatCostService chatService; - - private final SysUserMapper sysUserMapper; - - private final IChatMessageService chatMessageService; - - private final ISysModelService sysModelService; - - @Value("${chat.apiKey}") - private String apiKey; - @Value("${chat.apiHost}") - private String apiHost; - - @Override - public SseEmitter sseChat(ChatRequest chatRequest) { - LocalCache.CACHE.put("userId",getUserId()); - SseEmitter sseEmitter = new SseEmitter(0L); - SSEEventSourceListener openAIEventSourceListener = new SSEEventSourceListener(sseEmitter); - // 获取对话消息列表 - List msgList = chatRequest.getMessages(); - - // 图文识别上下文信息 - List contentList = chatRequest.getImageContent(); - // 消息记录 - Message message = msgList.get(msgList.size() - 1); - ChatMessageBo chatMessageBo = new ChatMessageBo(); - chatMessageBo.setUserId(getUserId()); - chatMessageBo.setModelName(chatRequest.getModel()); - chatMessageBo.setContent(message.getContent()); - try{ - if(!chatRequest.getModel().startsWith("gpt-3.5")){ - // 判断用户是否付费 - checkUserGrade(); - } - //根据模型名称查询模型信息 - SysModelBo sysModelBo = new SysModelBo(); - sysModelBo.setModelName(chatRequest.getModel()); - List sysModelList = sysModelService.queryList(sysModelBo); - if (CollectionUtil.isEmpty(sysModelList)) { - // 如果模型不存在默认使用token扣费方式 - processByToken(chatRequest.getModel(), msgList, chatMessageBo); - } else { - // 模型设置默认提示词 - SysModelVo firstModel = sysModelList.get(0); - if (StringUtils.isNotEmpty(firstModel.getSystemPrompt())) { - Message sysMessage = Message.builder().content(firstModel.getSystemPrompt()).role(Message.Role.SYSTEM).build(); - // 假设 msgList 不为空并且至少有一个元素 - if (msgList.get(0).equals(sysMessage)) { - // 如果第一个元素与sysMessage相等,替换第一个元素 - msgList.set(0, sysMessage); - } else { - // 如果不相等,将sysMessage插入到列表的第一个位置 - msgList.add(0, sysMessage); - } - } - // 计费类型: 1 token扣费 2 次数扣费 - if ("2".equals(firstModel.getModelType())) { - processByModelPrice(firstModel, chatMessageBo); - } else { - processByToken(chatRequest.getModel(), msgList, chatMessageBo); - } - } - } catch (Exception e) { - sendErrorEvent(sseEmitter, e.getMessage()); - return sseEmitter; - } - // 图文识别模型 - if (ChatCompletion.Model.GPT_4_VISION_PREVIEW.getName().equals(chatRequest.getModel())) { - MessagePicture messagePicture = MessagePicture.builder().role(Message.Role.USER.getName()).content(contentList).build(); - ChatCompletionWithPicture chatCompletion = ChatCompletionWithPicture - .builder() - .messages(Collections.singletonList(messagePicture)) - .model(chatRequest.getModel()) - .temperature(chatRequest.getTemperature()) - .topP(chatRequest.getTop_p()) - .stream(true) - .build(); - openAiStreamClient.streamChatCompletion(chatCompletion, openAIEventSourceListener); - } else { - ChatCompletion completion = ChatCompletion - .builder() - .messages(msgList) - .model(chatRequest.getModel()) - .temperature(chatRequest.getTemperature()) - .topP(chatRequest.getTop_p()) - .stream(true) - .build(); - openAiStreamClient.streamChatCompletion(completion, openAIEventSourceListener); - } - return sseEmitter; - } - - /** - * 根据次数扣除余额 - * - * @param model 模型信息 - * @param chatMessageBo 对话信息 - */ - private void processByModelPrice(SysModelVo model, ChatMessageBo chatMessageBo) { - double cost = model.getModelPrice(); - chatService.deductUserBalance(getUserId(), cost); - chatMessageBo.setDeductCost(cost); - chatMessageService.insertByBo(chatMessageBo); - } - - /** - * 根据token扣除余额 - * - * @param modelName 模型名称 - * @param msgList 消息列表 - * @param chatMessageBo 消息记录 - */ - private void processByToken(String modelName, List msgList, ChatMessageBo chatMessageBo) { - int tokens = TikTokensUtil.tokens(modelName, msgList); - chatMessageBo.setTotalTokens(tokens); - chatService.deductToken(chatMessageBo); - } - - /** - * 文字转语音 - * - */ - @Override - public ResponseEntity textToSpeed(TextToSpeech textToSpeech) { - try (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")) // 假设是MP3文件 - .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"); - } - // 创建一个文件对象 - 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) { - Message message = Message.builder().role(Message.Role.USER).content(chatRequest.getPrompt()).build(); - ChatCompletion chatCompletion = ChatCompletion - .builder() - .messages(Collections.singletonList(message)) - .model(chatRequest.getModel()) - .build(); - ChatCompletionResponse chatCompletionResponse = openAiStreamClient.chatCompletion(chatCompletion); - return chatCompletionResponse.getChoices().get(0).getMessage().getContent(); - } - - /** - * dall-e-3绘画接口 - * - * @param request - * @return - */ - public List dall3(Dall3Request request) { - checkUserGrade(); - // DALL3 绘图模型 - Image image = Image.builder() - .responseFormat(com.xmzs.common.chat.entity.images.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); - - // 扣除费用 - if(Objects.equals(request.getSize(), "1792x1024") || Objects.equals(request.getSize(), "1024x1792")){ - chatService.deductUserBalance(getUserId(),OpenAIConst.DALL3_HD_COST); - }else { - chatService.deductUserBalance(getUserId(),OpenAIConst.DALL3_COST); - } - // 保存消息记录 - ChatMessageBo chatMessageBo = new ChatMessageBo(); - chatMessageBo.setUserId(getUserId()); - chatMessageBo.setModelName(Image.Model.DALL_E_3.getName()); - chatMessageBo.setContent(request.getPrompt()); - chatMessageBo.setDeductCost(OpenAIConst.GPT4_COST); - chatMessageBo.setTotalTokens(0); - chatMessageService.insertByBo(chatMessageBo); - return imageResponse.getData(); - } - - /** - * 判断用户是否付费 - */ - @Override - public void checkUserGrade() { - SysUser sysUser = sysUserMapper.selectById(getUserId()); - if("0".equals(sysUser.getUserGrade())){ - throw new BaseException("免费用户暂时不支持此模型,请切换gpt-3.5-turbo模型或者点击《进入市场选购您的商品》充值后使用!"); - } - } - - /** - * 获取用户Id - * - * @return - */ - public Long getUserId(){ - LoginUser loginUser = LoginHelper.getLoginUser(); - if (loginUser == null) { - throw new BaseException("用户未登录!"); - } - return loginUser.getUserId(); - } - - @Override - public UploadFileResponse upload(MultipartFile file) { - 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(); - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysConfigServiceImpl.java deleted file mode 100644 index 0aeb0068..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysConfigServiceImpl.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.service.ConfigService; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.redis.utils.CacheUtils; -import com.xmzs.common.tenant.helper.TenantHelper; -import com.xmzs.system.domain.SysConfig; -import com.xmzs.system.domain.bo.SysConfigBo; -import com.xmzs.system.domain.vo.SysConfigVo; -import com.xmzs.system.mapper.SysConfigMapper; -import com.xmzs.system.service.ISysConfigService; -import lombok.RequiredArgsConstructor; -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, ConfigService { - - 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; - } - - /** - * 根据参数 key 获取参数值 - * - * @param configKey 参数 key - * @return 参数值 - */ - @Override - public String getConfigValue(String configKey) { - return SpringUtils.getAopProxy(this).selectConfigByKey(configKey); - } - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDataScopeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDataScopeServiceImpl.java deleted file mode 100644 index a2f28cda..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDataScopeServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xmzs.system.service.impl; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.convert.Convert; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.mybatis.helper.DataBaseHelper; -import com.xmzs.system.domain.SysDept; -import com.xmzs.system.domain.SysRoleDept; -import com.xmzs.system.mapper.SysDeptMapper; -import com.xmzs.system.mapper.SysRoleDeptMapper; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDeptServiceImpl.java deleted file mode 100644 index 0402cf79..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDeptServiceImpl.java +++ /dev/null @@ -1,325 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.service.DeptService; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.TreeBuildUtils; -import com.xmzs.common.mybatis.helper.DataBaseHelper; -import com.xmzs.common.redis.utils.CacheUtils; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.SysDept; -import com.xmzs.system.domain.SysRole; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.bo.SysDeptBo; -import com.xmzs.system.domain.vo.SysDeptVo; -import com.xmzs.system.mapper.SysDeptMapper; -import com.xmzs.system.mapper.SysRoleMapper; -import com.xmzs.system.mapper.SysUserMapper; -import com.xmzs.system.service.ISysDeptService; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDictDataServiceImpl.java deleted file mode 100644 index 8d5c50f3..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDictDataServiceImpl.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.redis.utils.CacheUtils; -import com.xmzs.system.domain.SysDictData; -import com.xmzs.system.domain.bo.SysDictDataBo; -import com.xmzs.system.domain.vo.SysDictDataVo; -import com.xmzs.system.mapper.SysDictDataMapper; -import com.xmzs.system.service.ISysDictDataService; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDictTypeServiceImpl.java deleted file mode 100644 index d43157fe..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysDictTypeServiceImpl.java +++ /dev/null @@ -1,268 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheConstants; -import com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.service.DictService; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.redis.utils.CacheUtils; -import com.xmzs.system.domain.SysDictData; -import com.xmzs.system.domain.SysDictType; -import com.xmzs.system.domain.bo.SysDictTypeBo; -import com.xmzs.system.domain.vo.SysDictDataVo; -import com.xmzs.system.domain.vo.SysDictTypeVo; -import com.xmzs.system.mapper.SysDictDataMapper; -import com.xmzs.system.mapper.SysDictTypeMapper; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysLogininforServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysLogininforServiceImpl.java deleted file mode 100644 index 59843f50..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysLogininforServiceImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.Constants; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.ServletUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.ip.AddressUtils; -import com.xmzs.common.log.event.LogininforEvent; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.SysLogininfor; -import com.xmzs.system.domain.bo.SysLogininforBo; -import com.xmzs.system.domain.vo.SysLogininforVo; -import com.xmzs.system.mapper.SysLogininforMapper; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysMenuServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysMenuServiceImpl.java deleted file mode 100644 index 52a4631e..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysMenuServiceImpl.java +++ /dev/null @@ -1,365 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.TreeBuildUtils; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.SysMenu; -import com.xmzs.system.domain.SysRole; -import com.xmzs.system.domain.SysRoleMenu; -import com.xmzs.system.domain.SysTenantPackage; -import com.xmzs.system.domain.bo.SysMenuBo; -import com.xmzs.system.domain.vo.MetaVo; -import com.xmzs.system.domain.vo.RouterVo; -import com.xmzs.system.domain.vo.SysMenuVo; -import com.xmzs.system.mapper.SysMenuMapper; -import com.xmzs.system.mapper.SysRoleMapper; -import com.xmzs.system.mapper.SysRoleMenuMapper; -import com.xmzs.system.mapper.SysTenantPackageMapper; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysModelServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysModelServiceImpl.java deleted file mode 100644 index d298efcc..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysModelServiceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.SysModel; -import com.xmzs.system.domain.bo.SysModelBo; -import com.xmzs.system.domain.vo.SysModelVo; -import com.xmzs.system.mapper.SysModelMapper; -import com.xmzs.system.service.ISysModelService; -import lombok.RequiredArgsConstructor; -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; - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysNoticeServiceImpl.java deleted file mode 100644 index dec307d8..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysNoticeServiceImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.xmzs.system.service.impl; - -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 com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.SysNotice; -import com.xmzs.system.domain.bo.SysNoticeBo; -import com.xmzs.system.domain.vo.SysNoticeVo; -import com.xmzs.system.domain.vo.SysUserVo; -import com.xmzs.system.mapper.SysNoticeMapper; -import com.xmzs.system.mapper.SysUserMapper; -import com.xmzs.system.service.ISysNoticeService; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.Arrays; -import java.util.List; - -/** - * 公告 服务层实现 - * - * @author Lion Li - */ -@RequiredArgsConstructor -@Service -public class SysNoticeServiceImpl implements ISysNoticeService { - - private final SysNoticeMapper baseMapper; - 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 List selectNoticeList(SysNoticeBo notice) { - LambdaQueryWrapper lqw = buildQueryWrapper(notice); - return baseMapper.selectVoList(lqw); - } - - 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); - return baseMapper.insert(notice); - } - - /** - * 修改公告 - * - * @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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOperLogServiceImpl.java deleted file mode 100644 index 50b76438..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOperLogServiceImpl.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.ip.AddressUtils; -import com.xmzs.common.log.event.OperLogEvent; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.SysOperLog; -import com.xmzs.system.domain.bo.SysOperLogBo; -import com.xmzs.system.domain.vo.SysOperLogVo; -import com.xmzs.system.mapper.SysOperLogMapper; -import com.xmzs.system.service.ISysOperLogService; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOssConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOssConfigServiceImpl.java deleted file mode 100644 index d6f08cac..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOssConfigServiceImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.json.utils.JsonUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.oss.constant.OssConstant; -import com.xmzs.common.redis.utils.CacheUtils; -import com.xmzs.common.redis.utils.RedisUtils; -import com.xmzs.common.tenant.core.TenantEntity; -import com.xmzs.common.tenant.helper.TenantHelper; -import com.xmzs.system.domain.SysOssConfig; -import com.xmzs.system.domain.bo.SysOssConfigBo; -import com.xmzs.system.domain.vo.SysOssConfigVo; -import com.xmzs.system.mapper.SysOssConfigMapper; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOssServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOssServiceImpl.java deleted file mode 100644 index d9a9b0a3..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysOssServiceImpl.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.service.OssService; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.core.utils.file.FileUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.oss.core.OssClient; -import com.xmzs.common.oss.entity.UploadResult; -import com.xmzs.common.oss.enumd.AccessPolicyType; -import com.xmzs.common.oss.factory.OssFactory; -import com.xmzs.system.domain.SysOss; -import com.xmzs.system.domain.bo.SysOssBo; -import com.xmzs.system.domain.vo.SysOssVo; -import com.xmzs.system.mapper.SysOssMapper; -import com.xmzs.system.service.ISysOssService; -import jakarta.servlet.http.HttpServletResponse; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysPermissionServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysPermissionServiceImpl.java deleted file mode 100644 index f4ccf3a5..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysPermissionServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xmzs.system.service.impl; - -import com.xmzs.common.core.constant.TenantConstants; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.service.ISysMenuService; -import com.xmzs.system.service.ISysPermissionService; -import com.xmzs.system.service.ISysRoleService; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.HashSet; -import java.util.Set; - -/** - * 用户权限处理 - * - * @author ruoyi - */ -@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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysPostServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysPostServiceImpl.java deleted file mode 100644 index 90b0ed11..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysPostServiceImpl.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.SysPost; -import com.xmzs.system.domain.SysUserPost; -import com.xmzs.system.domain.bo.SysPostBo; -import com.xmzs.system.domain.vo.SysPostVo; -import com.xmzs.system.mapper.SysPostMapper; -import com.xmzs.system.mapper.SysUserPostMapper; -import com.xmzs.system.service.ISysPostService; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysRoleServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysRoleServiceImpl.java deleted file mode 100644 index 4a744e72..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysRoleServiceImpl.java +++ /dev/null @@ -1,458 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.domain.model.LoginUser; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.SysRole; -import com.xmzs.system.domain.SysRoleDept; -import com.xmzs.system.domain.SysRoleMenu; -import com.xmzs.system.domain.SysUserRole; -import com.xmzs.system.domain.bo.SysRoleBo; -import com.xmzs.system.domain.vo.SysRoleVo; -import com.xmzs.system.mapper.SysRoleDeptMapper; -import com.xmzs.system.mapper.SysRoleMapper; -import com.xmzs.system.mapper.SysRoleMenuMapper; -import com.xmzs.system.mapper.SysUserRoleMapper; -import com.xmzs.system.service.ISysRoleService; -import lombok.RequiredArgsConstructor; -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); - if (loginUser.getRoles().stream().anyMatch(r -> r.getRoleId().equals(roleId))) { - try { - StpUtil.logoutByTokenValue(token); - } catch (NotLoginException ignored) { - } - } - }); - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysSensitiveServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysSensitiveServiceImpl.java deleted file mode 100644 index ac396fbe..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysSensitiveServiceImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.xmzs.system.service.impl; - -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysTenantPackageServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysTenantPackageServiceImpl.java deleted file mode 100644 index dd765d85..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysTenantPackageServiceImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.TenantConstants; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.SysTenant; -import com.xmzs.system.domain.SysTenantPackage; -import com.xmzs.system.domain.bo.SysTenantPackageBo; -import com.xmzs.system.domain.vo.SysTenantPackageVo; -import com.xmzs.system.mapper.SysTenantMapper; -import com.xmzs.system.mapper.SysTenantPackageMapper; -import com.xmzs.system.service.ISysTenantPackageService; -import lombok.RequiredArgsConstructor; -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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysTenantServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysTenantServiceImpl.java deleted file mode 100644 index a95ee8e9..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysTenantServiceImpl.java +++ /dev/null @@ -1,367 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.constant.Constants; -import com.xmzs.common.core.constant.TenantConstants; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.SpringUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.system.domain.*; -import com.xmzs.system.domain.bo.SysTenantBo; -import com.xmzs.system.domain.vo.SysTenantVo; -import com.xmzs.system.mapper.*; -import com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysUserServiceImpl.java deleted file mode 100644 index 8a44a325..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/service/impl/SysUserServiceImpl.java +++ /dev/null @@ -1,560 +0,0 @@ -package com.xmzs.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 com.xmzs.common.core.constant.CacheNames; -import com.xmzs.common.core.constant.UserConstants; -import com.xmzs.common.core.exception.ServiceException; -import com.xmzs.common.core.service.UserService; -import com.xmzs.common.core.utils.MapstructUtils; -import com.xmzs.common.core.utils.StreamUtils; -import com.xmzs.common.core.utils.StringUtils; -import com.xmzs.common.mybatis.core.page.PageQuery; -import com.xmzs.common.mybatis.core.page.TableDataInfo; -import com.xmzs.common.mybatis.helper.DataBaseHelper; -import com.xmzs.common.satoken.utils.LoginHelper; -import com.xmzs.system.domain.SysDept; -import com.xmzs.system.domain.SysUser; -import com.xmzs.system.domain.SysUserPost; -import com.xmzs.system.domain.SysUserRole; -import com.xmzs.system.domain.bo.SysUserBo; -import com.xmzs.system.domain.vo.SysPostVo; -import com.xmzs.system.domain.vo.SysRoleVo; -import com.xmzs.system.domain.vo.SysUserVo; -import com.xmzs.system.mapper.*; -import com.xmzs.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(); - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/util/BotUtil.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/util/BotUtil.java deleted file mode 100644 index f2074d14..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/util/BotUtil.java +++ /dev/null @@ -1,107 +0,0 @@ -//package com.xmzs.system.util; -// -// -//import com.xmzs.system.cofing.GptConfig; -//import com.xmzs.system.domain.ChatMessage; -//import jakarta.annotation.PostConstruct; -//import lombok.Getter; -//import lombok.RequiredArgsConstructor; -//import org.springframework.stereotype.Component; -// -//import java.util.*; -// -///** -// * bot工具类 -// * -// * @author ashinnotfound -// * @date 2023/2/1 -// */ -//@Component -//@RequiredArgsConstructor -//public class BotUtil { -// -// private final GptConfig gptConfig; -// -// private GptClient gptClient; -// -// private Tokenizer tokenizer; -// -// private final Map> PROMPT_MAP = new HashMap<>(); -// private final Map COUNT_FOR_OPEN_AI_SERVICE = new HashMap<>(); -// @Getter -// private ChatCompletionRequest.ChatCompletionRequestBuilder completionRequestBuilder; -// private final List BASIC_PROMPT_LIST = new ArrayList<>(); -// -// @PostConstruct -// public void init() { -// completionRequestBuilder = ChatCompletionRequest.builder().model(gptConfig.getModel()).temperature(gptConfig.getTemperature()).maxTokens(gptConfig.getMaxToken()); -// for (OpenAiService openAiService : gptClient.getOpenAiServiceList()) { -// COUNT_FOR_OPEN_AI_SERVICE.put(openAiService, 0); -// } -// for (String prompt : gptConfig.getBasicPrompt()){ -// BASIC_PROMPT_LIST.add(new ChatMessage("system", prompt)); -// } -// } -// -// public OpenAiService getOpenAiService() { -// //获取使用次数最小的openAiService 否则获取map中的第一个 -// Optional openAiServiceToUse = COUNT_FOR_OPEN_AI_SERVICE.entrySet().stream() -// .min(Map.Entry.comparingByValue()) -// .map(Map.Entry::getKey); -// if (openAiServiceToUse.isPresent()) { -// COUNT_FOR_OPEN_AI_SERVICE.put(openAiServiceToUse.get(), COUNT_FOR_OPEN_AI_SERVICE.get(openAiServiceToUse.get()) + 1); -// return openAiServiceToUse.get(); -// } else { -// COUNT_FOR_OPEN_AI_SERVICE.put(COUNT_FOR_OPEN_AI_SERVICE.keySet().iterator().next(), COUNT_FOR_OPEN_AI_SERVICE.get(COUNT_FOR_OPEN_AI_SERVICE.keySet().iterator().next()) + 1); -// return COUNT_FOR_OPEN_AI_SERVICE.keySet().iterator().next(); -// } -// } -// -// public List buildPrompt(String sessionId, String newPrompt) { -// if (!PROMPT_MAP.containsKey(sessionId)) { -// if (!BASIC_PROMPT_LIST.isEmpty()){ -// List promptList = new ArrayList<>(BASIC_PROMPT_LIST); -// PROMPT_MAP.put(sessionId, promptList); -// } -// } -// List promptList = PROMPT_MAP.getOrDefault(sessionId, new ArrayList<>()); -// promptList.add(new ChatMessage("user", newPrompt)); -// if (tokenizer.countMessageTokens(gptConfig.getModel(), promptList) > gptConfig.getMaxToken()){ -// List tempChatMessage = deleteFirstPrompt(sessionId); -// if (tempChatMessage != null){ -// return buildPrompt(sessionId, newPrompt); -// } -// return null; -// } -// return promptList; -// } -// -// public boolean isPromptEmpty(String sessionId){ -// if (!PROMPT_MAP.containsKey(sessionId)){ -// return true; -// } -// return PROMPT_MAP.get(sessionId).size() == BASIC_PROMPT_LIST.size(); -// } -// public List deleteFirstPrompt(String sessionId) { -// if (!isPromptEmpty(sessionId)){ -// int index = BASIC_PROMPT_LIST.size(); -// List promptList = PROMPT_MAP.get(sessionId); -// //问 -// promptList.remove(index); -// //答 -// if (index < promptList.size()){ -// promptList.remove(index); -// return promptList; -// }else { -// // 已经是初始聊天记录 -// return null; -// } -// } -// // 已经是初始聊天记录 -// return null; -// } -// -// public void resetPrompt(String sessionId) { -// PROMPT_MAP.remove(sessionId); -// } -//} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/util/OrderNumberGenerator.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/util/OrderNumberGenerator.java deleted file mode 100644 index 819fe984..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/xmzs/system/util/OrderNumberGenerator.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xmzs.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/AbstractBuilder.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/AbstractBuilder.java new file mode 100644 index 00000000..18763372 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/AbstractBuilder.java @@ -0,0 +1,16 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/ImageBuilder.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/ImageBuilder.java new file mode 100644 index 00000000..048372e0 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/ImageBuilder.java @@ -0,0 +1,25 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/TextBuilder.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/TextBuilder.java new file mode 100644 index 00000000..c60fe8fe --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/builder/TextBuilder.java @@ -0,0 +1,22 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/OkHttpConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/OkHttpConfig.java index 90127bfe..b7406c11 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/OkHttpConfig.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/OkHttpConfig.java @@ -26,6 +26,7 @@ public class OkHttpConfig { public void init() { initializeOkHttpUtil("suno"); initializeOkHttpUtil("luma"); + initializeOkHttpUtil("ppt"); } private void initializeOkHttpUtil(String modelName) { diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/WxCpConfiguration.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/WxCpConfiguration.java new file mode 100644 index 00000000..784c939c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/WxCpConfiguration.java @@ -0,0 +1,130 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/WxCpProperties.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/WxCpProperties.java new file mode 100644 index 00000000..7b27f15b --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/cofing/WxCpProperties.java @@ -0,0 +1,48 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatConfigController.java index 5e304c8c..4af23486 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatConfigController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatConfigController.java @@ -36,8 +36,8 @@ public class ChatConfigController extends BaseController { */ @GetMapping("/list") @SaCheckPermission("system:config:list") - public R> list(ChatConfigBo bo) { - return R.ok(chatConfigService.queryList(bo)); + public List list(ChatConfigBo bo) { + return chatConfigService.queryList(bo); } /** @@ -46,7 +46,8 @@ public class ChatConfigController extends BaseController { * @param id 主键 */ @GetMapping("/{id}") - public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { return R.ok(chatConfigService.queryById(id)); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatStoreController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatStoreController.java new file mode 100644 index 00000000..a5a6bb07 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatStoreController.java @@ -0,0 +1,42 @@ +package org.ruoyi.system.controller.system; + +import lombok.RequiredArgsConstructor; +import org.ruoyi.common.core.domain.R; +import org.ruoyi.common.web.core.BaseController; +import org.ruoyi.system.domain.bo.ChatAppStoreBo; +import org.ruoyi.system.domain.bo.ChatMessageBo; +import org.ruoyi.system.domain.vo.ChatAppStoreVo; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatVoucherController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatVoucherController.java index fcda82df..cd9fae7d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatVoucherController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/ChatVoucherController.java @@ -15,6 +15,7 @@ import org.ruoyi.common.log.enums.BusinessType; import org.ruoyi.common.mybatis.core.page.PageQuery; import org.ruoyi.common.mybatis.core.page.TableDataInfo; import org.ruoyi.common.web.core.BaseController; +import org.ruoyi.common.wechat.web.utils.UUIDShortUtil; import org.ruoyi.system.domain.bo.ChatVoucherBo; import org.ruoyi.system.domain.vo.ChatVoucherVo; import org.ruoyi.system.service.IChatVoucherService; @@ -22,7 +23,6 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; -import java.util.UUID; /** * 用户兑换记录 @@ -78,7 +78,7 @@ public class ChatVoucherController extends BaseController { @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody ChatVoucherBo bo) { - bo.setCode(UUID.randomUUID().toString().replace("-", "")); + bo.setCode(UUIDShortUtil.generateShortUuid()); return toAjax(chatVoucherService.insertByBo(bo)); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/WeChatController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/WeChatController.java new file mode 100644 index 00000000..a2702b2b --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/WeChatController.java @@ -0,0 +1,81 @@ +package org.ruoyi.system.controller.system; + +import cn.dev33.satoken.annotation.SaIgnore; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.ruoyi.common.core.exception.ServiceException; +import org.ruoyi.common.wechat.itchat4j.api.WechatTools; +import org.ruoyi.common.wechat.itchat4j.controller.LoginController; +import org.ruoyi.common.wechat.itchat4j.core.MsgCenter; +import org.ruoyi.common.wechat.itchat4j.face.IMsgHandlerFace; +import org.ruoyi.common.wechat.web.base.BaseException; +import org.ruoyi.system.domain.bo.WxRobConfigBo; +import org.ruoyi.system.domain.vo.WxRobConfigVo; +import org.ruoyi.system.handler.MyMsgHandler; +import org.ruoyi.system.service.ISseService; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/WxRobConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/WxRobConfigController.java new file mode 100644 index 00000000..c5346834 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/system/WxRobConfigController.java @@ -0,0 +1,114 @@ +package org.ruoyi.system.controller.system; + +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.ruoyi.common.core.domain.R; +import org.ruoyi.common.core.validate.AddGroup; +import org.ruoyi.common.core.validate.EditGroup; +import org.ruoyi.common.excel.utils.ExcelUtil; +import org.ruoyi.common.idempotent.annotation.RepeatSubmit; +import org.ruoyi.common.log.annotation.Log; +import org.ruoyi.common.log.enums.BusinessType; +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.common.satoken.utils.LoginHelper; +import org.ruoyi.common.web.core.BaseController; +import org.ruoyi.common.wechat.web.utils.UUIDShortUtil; +import org.ruoyi.system.domain.bo.WxRobConfigBo; +import org.ruoyi.system.domain.vo.WxRobConfigVo; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/wxsingle/WxJsController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/wxsingle/WxJsController.java new file mode 100644 index 00000000..a6ff01f2 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/wxsingle/WxJsController.java @@ -0,0 +1,62 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/wxsingle/WxPortalController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/wxsingle/WxPortalController.java new file mode 100644 index 00000000..1ca67d1f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/controller/wxsingle/WxPortalController.java @@ -0,0 +1,85 @@ +package org.ruoyi.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.ruoyi.common.core.utils.JsonUtils; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/VoiceRole.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/ChatAppStore.java similarity index 73% rename from ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/VoiceRole.java rename to ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/ChatAppStore.java index a74ef975..b98cbeae 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/VoiceRole.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/ChatAppStore.java @@ -9,32 +9,32 @@ import lombok.EqualsAndHashCode; import java.io.Serial; /** - * 配音角色对象 voice_role + * 应用市场 * * @author Lion Li * @date 2024-03-19 */ @Data @EqualsAndHashCode(callSuper = true) -@TableName("chat_audio_role") -public class VoiceRole extends BaseEntity { +@TableName("chat_app_store") +public class ChatAppStore extends BaseEntity { @Serial private static final long serialVersionUID = 1L; /** - * id + * 主键 */ @TableId(value = "id") private Long id; /** - * 角色名称 + * 名称 */ private String name; /** - * 角色描述 + * 描述 */ private String description; @@ -44,14 +44,9 @@ public class VoiceRole extends BaseEntity { private String avatar; /** - * 角色id + * 应用地址 */ - private String voiceId; - - /** - * 音频地址 - */ - private String fileUrl; + private String appUrl; /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/ChatConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/ChatConfig.java index 47174617..bad6bf4f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/ChatConfig.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/ChatConfig.java @@ -10,8 +10,7 @@ import org.ruoyi.common.tenant.core.TenantEntity; import java.io.Serial; /** - * 对话配置信息 -对象 chat_config + * 对话配置信息对象 chat_config * * @author Lion Li * @date 2024-04-13 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/Cover.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/Cover.java new file mode 100644 index 00000000..4ce348dd --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/Cover.java @@ -0,0 +1,58 @@ +package org.ruoyi.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/CoverPromptAudio.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/CoverPromptAudio.java new file mode 100644 index 00000000..b44b9381 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/CoverPromptAudio.java @@ -0,0 +1,38 @@ +package org.ruoyi.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/bo/VoiceRoleBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/bo/ChatAppStoreBo.java similarity index 63% rename from ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/bo/VoiceRoleBo.java rename to ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/bo/ChatAppStoreBo.java index 2243af68..5af1096a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/bo/VoiceRoleBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/bo/ChatAppStoreBo.java @@ -1,7 +1,7 @@ package org.ruoyi.system.domain.bo; import org.ruoyi.common.mybatis.core.domain.BaseEntity; -import org.ruoyi.system.domain.VoiceRole; +import org.ruoyi.system.domain.ChatAppStore; import io.github.linpeilie.annotations.AutoMapper; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; @@ -9,15 +9,15 @@ import lombok.Data; import lombok.EqualsAndHashCode; /** - * 配音角色业务对象 voice_role + * 应用市场业务对象 voice_role * * @author Lion Li * @date 2024-03-19 */ @Data @EqualsAndHashCode(callSuper = true) -@AutoMapper(target = VoiceRole.class, reverseConvertGenerate = false) -public class VoiceRoleBo extends BaseEntity { +@AutoMapper(target = ChatAppStore.class, reverseConvertGenerate = false) +public class ChatAppStoreBo extends BaseEntity { /** * id @@ -28,13 +28,13 @@ public class VoiceRoleBo extends BaseEntity { /** * 角色名称 */ - @NotBlank(message = "角色名称不能为空") + @NotBlank(message = "名称不能为空") private String name; /** * 角色描述 */ - @NotBlank(message = "角色描述不能为空") + @NotBlank(message = "描述不能为空") private String description; /** @@ -43,18 +43,11 @@ public class VoiceRoleBo extends BaseEntity { @NotBlank(message = "头像不能为空") private String avatar; - /** - * 角色id - */ - @NotBlank(message = "角色id不能为空") - private String voiceId; - /** * 音频地址 */ - @NotBlank(message = "音频地址不能为空") - private String fileUrl; - + @NotBlank(message = "应用地址不能为空") + private String appUrl; /** * 备注 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/request/translation/TranslationRequest.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/request/translation/TranslationRequest.java new file mode 100644 index 00000000..5148f34e --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/request/translation/TranslationRequest.java @@ -0,0 +1,34 @@ +package org.ruoyi.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 sourceLanguage; + + /** + * 目标语言 + */ + private String targetLanguage; + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/VoiceRoleVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ChatAppStoreVo.java similarity index 60% rename from ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/VoiceRoleVo.java rename to ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ChatAppStoreVo.java index d8430850..ff46912a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/VoiceRoleVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ChatAppStoreVo.java @@ -4,7 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; -import org.ruoyi.system.domain.VoiceRole; +import org.ruoyi.system.domain.ChatAppStore; import java.io.Serial; import java.io.Serializable; @@ -12,15 +12,15 @@ import java.io.Serializable; /** - * 配音角色视图对象 voice_role + * 应用市场视图对象 * * @author Lion Li * @date 2024-03-19 */ @Data @ExcelIgnoreUnannotated -@AutoMapper(target = VoiceRole.class) -public class VoiceRoleVo implements Serializable { +@AutoMapper(target = ChatAppStore.class) +public class ChatAppStoreVo implements Serializable { @Serial private static final long serialVersionUID = 1L; @@ -34,13 +34,13 @@ public class VoiceRoleVo implements Serializable { /** * 角色名称 */ - @ExcelProperty(value = "角色名称") + @ExcelProperty(value = "名称") private String name; /** * 角色描述 */ - @ExcelProperty(value = "角色描述") + @ExcelProperty(value = "描述") private String description; /** @@ -49,23 +49,11 @@ public class VoiceRoleVo implements Serializable { @ExcelProperty(value = "头像") private String avatar; - /** - * 角色id - */ - @ExcelProperty(value = "角色id") - private String voiceId; - /** * 音频地址 */ - @ExcelProperty(value = "音频地址") - private String fileUrl; - - /** - * 音频预处理(实验性) - */ - @ExcelProperty(value = "音频预处理") - private String preProcess; + @ExcelProperty(value = "应用地址") + private String appUrl; /** * 备注 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverCallbackVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverCallbackVo.java new file mode 100644 index 00000000..fe0cc46d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverCallbackVo.java @@ -0,0 +1,24 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverParamVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverParamVo.java new file mode 100644 index 00000000..b07909ea --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverParamVo.java @@ -0,0 +1,60 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverPromptAudioVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverPromptAudioVo.java new file mode 100644 index 00000000..c6d554ef --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverPromptAudioVo.java @@ -0,0 +1,44 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverVo.java new file mode 100644 index 00000000..cffb757c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/CoverVo.java @@ -0,0 +1,68 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/MusicVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/MusicVo.java new file mode 100644 index 00000000..5d960949 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/cover/MusicVo.java @@ -0,0 +1,35 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptAllQueryDto.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptAllQueryDto.java new file mode 100644 index 00000000..cda01155 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptAllQueryDto.java @@ -0,0 +1,29 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGenerateContentDto.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGenerateContentDto.java new file mode 100644 index 00000000..82bc517b --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGenerateContentDto.java @@ -0,0 +1,27 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGenerateOutlineDto.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGenerateOutlineDto.java new file mode 100644 index 00000000..bb547544 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGenerateOutlineDto.java @@ -0,0 +1,25 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGeneratePptxDto.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGeneratePptxDto.java new file mode 100644 index 00000000..427e9d66 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptGeneratePptxDto.java @@ -0,0 +1,24 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptTemplateFilterDto.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptTemplateFilterDto.java new file mode 100644 index 00000000..2c441462 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptTemplateFilterDto.java @@ -0,0 +1,24 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptTemplateQueryDto.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptTemplateQueryDto.java new file mode 100644 index 00000000..c2199849 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/domain/vo/ppt/PptTemplateQueryDto.java @@ -0,0 +1,19 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/MyMsgHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/MyMsgHandler.java new file mode 100644 index 00000000..26936ed1 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/MyMsgHandler.java @@ -0,0 +1,230 @@ +package org.ruoyi.system.handler; + +import com.jfinal.kit.PropKit; +import org.ruoyi.common.chat.domain.request.ChatRequest; +import org.ruoyi.common.chat.entity.chat.ChatCompletion; +import org.ruoyi.common.chat.entity.images.Item; +import org.ruoyi.common.wechat.itchat4j.beans.BaseMsg; +import org.ruoyi.common.wechat.itchat4j.core.CoreManage; +import org.ruoyi.common.wechat.itchat4j.face.IMsgHandlerFace; +import org.ruoyi.common.wechat.itchat4j.utils.LogInterface; +import org.ruoyi.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.ruoyi.common.wechat.itchat4j.utils.tools.CommonTools; +import org.ruoyi.common.wechat.web.constant.ConfigKeys; +import org.ruoyi.common.wechat.web.model.WxRobConfig; +import org.ruoyi.common.wechat.web.model.WxRobKeyword; +import org.ruoyi.system.domain.vo.WxRobConfigVo; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/AbstractHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/AbstractHandler.java new file mode 100644 index 00000000..fa2ad943 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/AbstractHandler.java @@ -0,0 +1,9 @@ +package org.ruoyi.system.handler.wxcp; + +import me.chanjar.weixin.cp.message.WxCpMessageHandler; + +/** + * @author Binary Wang + */ +public abstract class AbstractHandler implements WxCpMessageHandler { +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/ContactChangeHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/ContactChangeHandler.java new file mode 100644 index 00000000..7beb8200 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/ContactChangeHandler.java @@ -0,0 +1,33 @@ +package org.ruoyi.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.ruoyi.common.core.utils.JsonUtils; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/EnterAgentHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/EnterAgentHandler.java new file mode 100644 index 00000000..82806aac --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/EnterAgentHandler.java @@ -0,0 +1,29 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/LocationHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/LocationHandler.java new file mode 100644 index 00000000..45696171 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/LocationHandler.java @@ -0,0 +1,44 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/LogHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/LogHandler.java new file mode 100644 index 00000000..af32e160 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/LogHandler.java @@ -0,0 +1,26 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/MenuHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/MenuHandler.java new file mode 100644 index 00000000..fe4617de --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/MenuHandler.java @@ -0,0 +1,34 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/MsgHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/MsgHandler.java new file mode 100644 index 00000000..155f042d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/MsgHandler.java @@ -0,0 +1,44 @@ +package org.ruoyi.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.ruoyi.system.builder.TextBuilder; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/NullHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/NullHandler.java new file mode 100644 index 00000000..b755444a --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/NullHandler.java @@ -0,0 +1,23 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/ScanHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/ScanHandler.java new file mode 100644 index 00000000..8a797a1d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/ScanHandler.java @@ -0,0 +1,8 @@ +package org.ruoyi.system.handler.wxcp; + +/** + * @author Binary Wang + */ +public abstract class ScanHandler extends AbstractHandler { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/SubscribeHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/SubscribeHandler.java new file mode 100644 index 00000000..6146c004 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/SubscribeHandler.java @@ -0,0 +1,63 @@ +package org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/UnsubscribeHandler.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/UnsubscribeHandler.java new file mode 100644 index 00000000..b89713f2 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/handler/wxcp/UnsubscribeHandler.java @@ -0,0 +1,28 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/listener/SSEEventSourceListener.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/listener/SSEEventSourceListener.java index 7c35d578..787cba4c 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/listener/SSEEventSourceListener.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/listener/SSEEventSourceListener.java @@ -104,8 +104,8 @@ public class SSEEventSourceListener extends EventSourceListener { if(completionResponse == null || CollectionUtil.isEmpty(completionResponse.getChoices())){ return; } - String content = "completionResponse.getChoices().get(0).getDelta().getContent()"; - if(StringUtils.isEmpty(content)){ + Object content = completionResponse.getChoices().get(0).getDelta().getContent(); + if(content == null){ return; } if(StringUtils.isEmpty(modelName)){ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/ChatAppStoreMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/ChatAppStoreMapper.java new file mode 100644 index 00000000..db27f687 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/ChatAppStoreMapper.java @@ -0,0 +1,15 @@ +package org.ruoyi.system.mapper; + +import org.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; +import org.ruoyi.system.domain.ChatAppStore; +import org.ruoyi.system.domain.vo.ChatAppStoreVo; + +/** + * 应用市场Mapper接口 + * + * @author Lion Li + * @date 2024-03-19 + */ +public interface ChatAppStoreMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/CoverMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/CoverMapper.java new file mode 100644 index 00000000..1a6f7921 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/CoverMapper.java @@ -0,0 +1,15 @@ +package org.ruoyi.system.mapper; + +import org.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; +import org.ruoyi.system.domain.Cover; +import org.ruoyi.system.domain.vo.cover.CoverVo; + +/** + * 翻唱Mapper接口 + * + * @author NSL + * @since 2024-12-25 + */ +public interface CoverMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/CoverPromptAudioMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/CoverPromptAudioMapper.java new file mode 100644 index 00000000..2bf27ec7 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/CoverPromptAudioMapper.java @@ -0,0 +1,23 @@ +package org.ruoyi.system.mapper; + +import org.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; +import org.ruoyi.system.domain.CoverPromptAudio; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/VoiceRoleMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/VoiceRoleMapper.java deleted file mode 100644 index bd7e22ed..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/mapper/VoiceRoleMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.ruoyi.system.mapper; - -import org.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; -import org.ruoyi.system.domain.VoiceRole; -import org.ruoyi.system.domain.vo.VoiceRoleVo; - -/** - * 配音角色Mapper接口 - * - * @author Lion Li - * @date 2024-03-19 - */ -public interface VoiceRoleMapper extends BaseMapperPlus { - -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/response/rolelist/ChatAppStoreVO.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/response/rolelist/ChatAppStoreVO.java new file mode 100644 index 00000000..0d22f208 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/response/rolelist/ChatAppStoreVO.java @@ -0,0 +1,19 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/response/rolelist/RoleListVO.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/response/rolelist/RoleListVO.java deleted file mode 100644 index cff24721..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/response/rolelist/RoleListVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.ruoyi.system.response.rolelist; - -import lombok.Data; - -/** - * 描述: - * - * @author ageerle@163.com - * date 2024/4/27 - */ -@Data -public class RoleListVO { - - - private String name; - - private String description; - - private String voicesId; - - private String avatar; - - private String previewAudio; - - public RoleListVO(String name, String description, String voicesId, String previewAudio,String avatar) { - this.name = name; - this.description = description; - this.voicesId = voicesId; - this.previewAudio = previewAudio; - this.avatar = avatar; - } -} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IVoiceRoleService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IChatAppStoreService.java similarity index 59% rename from ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IVoiceRoleService.java rename to ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IChatAppStoreService.java index e0782968..44b49675 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IVoiceRoleService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IChatAppStoreService.java @@ -1,43 +1,43 @@ package org.ruoyi.system.service; -import org.ruoyi.system.domain.vo.VoiceRoleVo; -import org.ruoyi.system.domain.bo.VoiceRoleBo; +import org.ruoyi.system.domain.vo.ChatAppStoreVo; +import org.ruoyi.system.domain.bo.ChatAppStoreBo; import org.ruoyi.common.mybatis.core.page.TableDataInfo; import org.ruoyi.common.mybatis.core.page.PageQuery; import org.ruoyi.system.request.RoleListDto; import org.ruoyi.system.request.RoleRequest; import org.ruoyi.system.request.SimpleGenerateRequest; import org.ruoyi.system.response.SimpleGenerateDataResponse; -import org.ruoyi.system.response.rolelist.RoleListVO; +import org.ruoyi.system.response.rolelist.ChatAppStoreVO; import java.util.Collection; import java.util.List; /** - * 配音角色Service接口 + * 应用市场Service接口 * * @author Lion Li * @date 2024-03-19 */ -public interface IVoiceRoleService { +public interface IChatAppStoreService { /** - * 查询配音角色 + * 查询应用市场 */ - VoiceRoleVo queryById(Long id); + ChatAppStoreVo queryById(Long id); /** - * 查询配音角色列表 + * 查询应用市场列表 */ - TableDataInfo queryPageList(VoiceRoleBo bo, PageQuery pageQuery); + TableDataInfo queryPageList(ChatAppStoreBo bo, PageQuery pageQuery); /** - * 查询配音角色列表 + * 查询应用市场列表 */ - List queryList(VoiceRoleBo bo); + List queryList(ChatAppStoreBo bo); /** - * 新增配音角色 + * 新增应用市场 */ Boolean insertByBo(RoleRequest roleRequest); @@ -47,12 +47,12 @@ public interface IVoiceRoleService { SimpleGenerateDataResponse simpleGenerate(SimpleGenerateRequest simpleGenerateRequest); /** - * 修改配音角色 + * 修改应用市场 */ - Boolean updateByBo(VoiceRoleBo bo); + Boolean updateByBo(ChatAppStoreBo bo); /** - * 校验并批量删除配音角色信息 + * 校验并批量删除应用市场信息 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); @@ -61,7 +61,7 @@ public interface IVoiceRoleService { * * @return 角色列表 */ - List roleList(); + List roleList(); /** * 收藏市场角色 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ICoverPromptAudioService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ICoverPromptAudioService.java new file mode 100644 index 00000000..d610a688 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ICoverPromptAudioService.java @@ -0,0 +1,11 @@ +package org.ruoyi.system.service; + +/** + * 翻唱用户参考音频Service接口 + * + * @author NSL + * @since 2024-12-25 + */ +public interface ICoverPromptAudioService { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ICoverService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ICoverService.java new file mode 100644 index 00000000..f6c22bd3 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ICoverService.java @@ -0,0 +1,49 @@ +package org.ruoyi.system.service; + +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.system.domain.vo.cover.CoverCallbackVo; +import org.ruoyi.system.domain.vo.cover.CoverParamVo; +import org.ruoyi.system.domain.vo.cover.CoverVo; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IPptService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IPptService.java new file mode 100644 index 00000000..eb284ab8 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/IPptService.java @@ -0,0 +1,63 @@ +package org.ruoyi.system.service; + +import com.alibaba.fastjson.JSONObject; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ISseService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ISseService.java index e6f89211..7230c78e 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ISseService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/ISseService.java @@ -8,6 +8,7 @@ import org.ruoyi.common.chat.entity.Tts.TextToSpeech; import org.ruoyi.common.chat.entity.files.UploadFileResponse; import org.ruoyi.common.chat.entity.images.Item; import org.ruoyi.common.chat.entity.whisper.WhisperResponse; +import org.ruoyi.system.domain.request.translation.TranslationRequest; import org.springframework.core.io.Resource; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; @@ -59,4 +60,23 @@ public interface ISseService { 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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/SysLoginService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/SysLoginService.java index 9caac087..29f96169 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/SysLoginService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/SysLoginService.java @@ -27,6 +27,7 @@ import org.ruoyi.common.redis.utils.RedisUtils; import org.ruoyi.common.satoken.utils.LoginHelper; import org.ruoyi.common.tenant.exception.TenantException; import org.ruoyi.common.tenant.helper.TenantHelper; +import org.ruoyi.common.wechat.web.utils.UUIDShortUtil; import org.ruoyi.system.domain.SysUser; import org.ruoyi.system.domain.bo.SysUserBo; import org.ruoyi.system.domain.vo.LoginVo; @@ -43,7 +44,6 @@ import org.springframework.stereotype.Service; import java.time.Duration; import java.util.Date; import java.util.List; -import java.util.UUID; import java.util.function.Supplier; /** @@ -159,7 +159,7 @@ public class SysLoginService { if (ObjectUtil.isNull(user)) { SysUserBo sysUser = new SysUserBo(); // 改为自增 - String name = "用户" + UUID.randomUUID(); + String name = "用户" + UUIDShortUtil.generateShortUuid();; // 设置默认用户名 sysUser.setUserName(name); // 设置默认昵称 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/VoiceRoleServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/ChatAppStoreImpl.java similarity index 75% rename from ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/VoiceRoleServiceImpl.java rename to ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/ChatAppStoreImpl.java index b242b896..25a76867 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/VoiceRoleServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/ChatAppStoreImpl.java @@ -16,10 +16,10 @@ import org.ruoyi.common.core.utils.StringUtils; import org.ruoyi.common.mybatis.core.page.PageQuery; import org.ruoyi.common.mybatis.core.page.TableDataInfo; import org.ruoyi.common.satoken.utils.LoginHelper; -import org.ruoyi.system.domain.VoiceRole; -import org.ruoyi.system.domain.bo.VoiceRoleBo; -import org.ruoyi.system.domain.vo.VoiceRoleVo; -import org.ruoyi.system.mapper.VoiceRoleMapper; +import org.ruoyi.system.domain.ChatAppStore; +import org.ruoyi.system.domain.bo.ChatAppStoreBo; +import org.ruoyi.system.domain.vo.ChatAppStoreVo; +import org.ruoyi.system.mapper.ChatAppStoreMapper; import org.ruoyi.system.request.RoleListDto; import org.ruoyi.system.request.RoleRequest; import org.ruoyi.system.request.SimpleGenerateRequest; @@ -28,9 +28,9 @@ import org.ruoyi.system.response.SimpleGenerateDataResponse; import org.ruoyi.system.response.SimpleGenerateResponse; import org.ruoyi.system.response.rolelist.ContentResponse; import org.ruoyi.system.response.rolelist.RoleListResponse; -import org.ruoyi.system.response.rolelist.RoleListVO; +import org.ruoyi.system.response.rolelist.ChatAppStoreVO; import org.ruoyi.system.service.IChatCostService; -import org.ruoyi.system.service.IVoiceRoleService; +import org.ruoyi.system.service.IChatAppStoreService; import org.ruoyi.system.util.AudioOkHttpUtil; import org.springframework.stereotype.Service; @@ -38,7 +38,7 @@ import java.io.IOException; import java.util.*; /** - * 配音角色Service业务层处理 + * 应用市场Service业务层处理 * * @author Lion Li * @date 2024-03-19 @@ -46,55 +46,53 @@ import java.util.*; @RequiredArgsConstructor @Service @Slf4j -public class VoiceRoleServiceImpl implements IVoiceRoleService { +public class ChatAppStoreImpl implements IChatAppStoreService { - private final VoiceRoleMapper baseMapper; + private final ChatAppStoreMapper baseMapper; private final IChatCostService chatService; private final AudioOkHttpUtil audioOkHttpUtil; /** - * 查询配音角色 + * 查询应用市场 */ @Override - public VoiceRoleVo queryById(Long id) { + public ChatAppStoreVo queryById(Long id) { return baseMapper.selectVoById(id); } /** - * 查询配音角色列表 + * 查询应用市场列表 */ @Override - public TableDataInfo queryPageList(VoiceRoleBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + 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(VoiceRoleBo bo) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); + public List queryList(ChatAppStoreBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); return baseMapper.selectVoList(lqw); } - private LambdaQueryWrapper buildQueryWrapper(VoiceRoleBo bo) { + private LambdaQueryWrapper buildQueryWrapper(ChatAppStoreBo bo) { Map params = bo.getParams(); - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.like(StringUtils.isNotBlank(bo.getName()), VoiceRole::getName, bo.getName()); - lqw.eq(StringUtils.isNotBlank(bo.getDescription()), VoiceRole::getDescription, bo.getDescription()); - lqw.eq(StringUtils.isNotBlank(bo.getAvatar()), VoiceRole::getAvatar, bo.getAvatar()); - lqw.eq(bo.getCreateBy()!=null, VoiceRole::getCreateBy, bo.getCreateBy()); - lqw.eq(StringUtils.isNotBlank(bo.getVoiceId()), VoiceRole::getVoiceId, bo.getVoiceId()); - lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), VoiceRole::getFileUrl, bo.getFileUrl()); + 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) { @@ -113,12 +111,11 @@ public class VoiceRoleServiceImpl implements IVoiceRoleService { Request postRequest = audioOkHttpUtil.createPostRequest("api/tts/voice", json); String body = audioOkHttpUtil.executeRequest(postRequest); RoleResponse bean = JSONUtil.toBean(body, RoleResponse.class); - VoiceRole addVoiceRole = new VoiceRole(); + ChatAppStore addVoiceRole = new ChatAppStore(); addVoiceRole.setName(roleRequest.getName()); addVoiceRole.setDescription(roleRequest.getDescription()); addVoiceRole.setAvatar(bean.getData().getMetadata().getAvatar()); - addVoiceRole.setVoiceId(bean.getData().getId()); - addVoiceRole.setFileUrl(bean.getData().getMetadata().getPrompts().get(0).getPromptOriginAudioStorageUrl()); + return baseMapper.insert(addVoiceRole) > 0; } @@ -132,11 +129,11 @@ public class VoiceRoleServiceImpl implements IVoiceRoleService { } /** - * 修改配音角色 + * 修改应用市场 */ @Override - public Boolean updateByBo(VoiceRoleBo bo) { - VoiceRole update = MapstructUtils.convert(bo, VoiceRole.class); + public Boolean updateByBo(ChatAppStoreBo bo) { + ChatAppStore update = MapstructUtils.convert(bo, ChatAppStore.class); validEntityBeforeSave(update); return baseMapper.updateById(update) > 0; } @@ -144,12 +141,12 @@ public class VoiceRoleServiceImpl implements IVoiceRoleService { /** * 保存前的数据校验 */ - private void validEntityBeforeSave(VoiceRole entity) { + private void validEntityBeforeSave(ChatAppStore entity) { //TODO 做一些数据校验,如唯一约束 } /** - * 批量删除配音角色 + * 批量删除应用市场 */ @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { @@ -184,11 +181,11 @@ public class VoiceRoleServiceImpl implements IVoiceRoleService { * @return 角色列表 */ @Override - public List roleList() { + 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<>(); + List roleList = new ArrayList<>(); for (ContentResponse element : bean.getData()) { String name = element.getName(); String description = element.getMetadata().getDescription(); @@ -201,7 +198,7 @@ public class VoiceRoleServiceImpl implements IVoiceRoleService { } else { previewAudio = element.getMetadata().getPrompts().get(0).getPromptOriginAudioStorageUrl(); } - roleList.add(new RoleListVO(name, description, voicesId, previewAudio, avatar)); + //roleList.add(new ChatAppStoreVO()); } return roleList; @@ -213,11 +210,9 @@ public class VoiceRoleServiceImpl implements IVoiceRoleService { @Override public void copyRole(RoleListDto roleListDto) { // 保存至数据库 - VoiceRole voiceRole = new VoiceRole(); + ChatAppStore voiceRole = new ChatAppStore(); voiceRole.setName(roleListDto.getName()); voiceRole.setDescription(roleListDto.getDescription()); - voiceRole.setFileUrl(roleListDto.getPreviewAudio()); - voiceRole.setVoiceId(roleListDto.getVoicesId()); voiceRole.setAvatar(roleListDto.getAvatar()); baseMapper.insert(voiceRole); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/CoverPromptAudioServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/CoverPromptAudioServiceImpl.java new file mode 100644 index 00000000..51200fc8 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/CoverPromptAudioServiceImpl.java @@ -0,0 +1,22 @@ +package org.ruoyi.system.service.impl; + +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.ruoyi.system.mapper.CoverPromptAudioMapper; +import org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/CoverServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/CoverServiceImpl.java new file mode 100644 index 00000000..b2dbba6c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/CoverServiceImpl.java @@ -0,0 +1,134 @@ +package org.ruoyi.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.ruoyi.common.core.exception.base.BaseException; +import org.ruoyi.common.core.service.ConfigService; +import org.ruoyi.common.mybatis.core.page.PageQuery; +import org.ruoyi.common.mybatis.core.page.TableDataInfo; +import org.ruoyi.common.wechat.itchat4j.utils.enums.ResultEnum; +import org.ruoyi.system.cofing.OkHttpConfig; +import org.ruoyi.system.domain.Cover; +import org.ruoyi.system.domain.CoverPromptAudio; +import org.ruoyi.system.domain.model.ApiResult; +import org.ruoyi.system.domain.vo.cover.*; +import org.ruoyi.system.mapper.CoverMapper; +import org.ruoyi.system.mapper.CoverPromptAudioMapper; +import org.ruoyi.system.service.IChatCostService; +import org.ruoyi.system.service.ICoverService; +import org.ruoyi.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.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/PptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/PptServiceImpl.java new file mode 100644 index 00000000..dcb3c2c9 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/PptServiceImpl.java @@ -0,0 +1,140 @@ +package org.ruoyi.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.ruoyi.common.core.constant.Constants; +import org.ruoyi.common.core.domain.model.LoginUser; +import org.ruoyi.common.core.exception.base.BaseException; +import org.ruoyi.common.core.service.ConfigService; +import org.ruoyi.common.redis.utils.RedisUtils; +import org.ruoyi.common.satoken.utils.LoginHelper; +import org.ruoyi.system.cofing.OkHttpConfig; +import org.ruoyi.system.domain.vo.ppt.*; +import org.ruoyi.system.service.IChatCostService; +import org.ruoyi.system.service.IPptService; +import org.ruoyi.system.util.HttpUtils; +import org.ruoyi.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; + +import static org.ruoyi.common.satoken.utils.LoginHelper.getLoginUser; + +/** + * 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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/SseServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/SseServiceImpl.java index 610b025e..7ada900f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/SseServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/service/impl/SseServiceImpl.java @@ -3,6 +3,16 @@ package org.ruoyi.system.service.impl; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSONObject; +import com.azure.ai.openai.OpenAIClient; +import com.azure.ai.openai.OpenAIClientBuilder; +import com.azure.ai.openai.models.*; +import com.azure.core.credential.AzureKeyCredential; +import io.github.ollama4j.OllamaAPI; +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 io.github.ollama4j.utils.Options; import jakarta.servlet.http.HttpServletRequest; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -12,7 +22,10 @@ import org.ruoyi.common.chat.config.LocalCache; import org.ruoyi.common.chat.domain.request.ChatRequest; import org.ruoyi.common.chat.domain.request.Dall3Request; import org.ruoyi.common.chat.entity.Tts.TextToSpeech; -import org.ruoyi.common.chat.entity.chat.*; +import org.ruoyi.common.chat.entity.chat.ChatCompletion; +import org.ruoyi.common.chat.entity.chat.ChatCompletionResponse; +import org.ruoyi.common.chat.entity.chat.Content; +import org.ruoyi.common.chat.entity.chat.Message; import org.ruoyi.common.chat.entity.files.UploadFileResponse; import org.ruoyi.common.chat.entity.images.Image; import org.ruoyi.common.chat.entity.images.ImageResponse; @@ -25,18 +38,17 @@ import org.ruoyi.common.core.domain.model.LoginUser; import org.ruoyi.common.core.exception.base.BaseException; import org.ruoyi.common.core.service.ConfigService; import org.ruoyi.common.core.utils.StringUtils; -import org.ruoyi.common.redis.utils.RedisUtils; import org.ruoyi.common.satoken.utils.LoginHelper; import org.ruoyi.system.domain.bo.ChatMessageBo; import org.ruoyi.system.domain.bo.SysModelBo; -import org.ruoyi.system.domain.bo.SysPackagePlanBo; +import org.ruoyi.system.domain.request.translation.TranslationRequest; import org.ruoyi.system.domain.vo.SysModelVo; -import org.ruoyi.system.domain.vo.SysPackagePlanVo; import org.ruoyi.system.domain.vo.SysUserVo; import org.ruoyi.system.listener.SSEEventSourceListener; import org.ruoyi.system.service.*; import org.springframework.core.io.InputStreamResource; import org.springframework.core.io.Resource; +import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -50,8 +62,11 @@ import java.io.InputStream; import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CompletableFuture; + +import io.github.ollama4j.utils.OptionsBuilder; @Service @Slf4j @@ -87,12 +102,13 @@ public class SseServiceImpl implements ISseService { try { if (StpUtil.isLogin()) { SysUserVo sysUserVo = userService.selectUserById(getUserId()); - if (!checkModel(sysUserVo.getUserPlan(), chatRequest.getModel())) { - throw new BaseException("当前套餐不支持此模型!"); - } +// if (!checkModel(sysUserVo.getUserPlan(), chatRequest.getModel())) { +// throw new BaseException("当前套餐不支持此模型!"); +// } LocalCache.CACHE.put("userId", getUserId()); - Object content = messages.get(0).getContent(); + Object content = messages.get(messages.size() - 1).getContent(); + String chatString = ""; if (content instanceof List listContent) { if (!listContent.isEmpty() && listContent.get(0) instanceof Content) { @@ -144,28 +160,28 @@ public class SseServiceImpl implements ISseService { processByToken(chatRequest.getModel(), chatString, chatMessageBo); } } - } else { - if (checkModel("Visitor", chatRequest.getModel())) { - // 初始请求次数 - int number = 1; - // 获取请求IP - String realIp = getClientIpAddress(request); - // 根据IP获取次数 - Integer requestNumber = RedisUtils.getCacheObject(realIp); - if (requestNumber == null) { - // 记录ip使用次数 - RedisUtils.setCacheObject(realIp, number); - } else { - String configValue = configService.getConfigValue("mail", "free"); - if (requestNumber > Integer.parseInt(configValue)) { - throw new BaseException("剩余次数不足,请充值后使用"); - } - RedisUtils.setCacheObject(realIp, requestNumber + 1); - } - } else { - throw new BaseException("当前套餐不支持此模型!"); - } } + +// else { +// +// // 初始请求次数 +// int number = 1; +// // 获取请求IP +// String realIp = getClientIpAddress(request); +// // 根据IP获取次数 +// Integer requestNumber = RedisUtils.getCacheObject(realIp); +// if (requestNumber == null) { +// // 记录ip使用次数 +// RedisUtils.setCacheObject(realIp, number); +// } else { +// String configValue = configService.getConfigValue("mail", "free"); +// if (requestNumber > Integer.parseInt(configValue)) { +// throw new BaseException("剩余次数不足,请充值后使用"); +// } +// RedisUtils.setCacheObject(realIp, requestNumber + 1); +// } +// +// } ChatCompletion completion = ChatCompletion .builder() .messages(messages) @@ -184,31 +200,31 @@ public class SseServiceImpl implements ISseService { } - /** - * 查当前用户是否可以调用此模型 - * - * @param planId - * @return - */ - public Boolean checkModel(String planId, String modelName) { - SysPackagePlanBo sysPackagePlanBo = new SysPackagePlanBo(); - if (modelName.startsWith("gpt-4-gizmo")) { - modelName = "gpt-4-gizmo"; - } - if (StringUtils.isEmpty(planId)) { - sysPackagePlanBo.setName("Visitor"); - } else if ("Visitor".equals(planId) || "Free".equals(planId)) { - sysPackagePlanBo.setName(planId); - } else { - // sysPackagePlanBo.setId(Long.valueOf(planId)); - return true; - } - - SysPackagePlanVo sysPackagePlanVo = sysPackagePlanService.queryList(sysPackagePlanBo).get(0); - // 将字符串转换为数组 - String[] array = sysPackagePlanVo.getPlanDetail().split(","); - return Arrays.asList(array).contains(modelName); - } +// /** +// * 查当前用户是否可以调用此模型 +// * +// * @param planId +// * @return +// */ +// public Boolean checkModel(String planId, String modelName) { +// SysPackagePlanBo sysPackagePlanBo = new SysPackagePlanBo(); +// if (modelName.startsWith("gpt-4-gizmo")) { +// modelName = "gpt-4-gizmo"; +// } +// if (StringUtils.isEmpty(planId)) { +// sysPackagePlanBo.setName("Visitor"); +// } else if ("Visitor".equals(planId) || "Free".equals(planId)) { +// sysPackagePlanBo.setName(planId); +// } else { +// // sysPackagePlanBo.setId(Long.valueOf(planId)); +// return true; +// } +// +// SysPackagePlanVo sysPackagePlanVo = sysPackagePlanService.queryList(sysPackagePlanBo).get(0); +// // 将字符串转换为数组 +// String[] array = sysPackagePlanVo.getPlanDetail().split(","); +// return Arrays.asList(array).contains(modelName); +// } /** * 根据次数扣除余额 @@ -241,24 +257,22 @@ public class SseServiceImpl implements ISseService { */ @Override public ResponseEntity textToSpeed(TextToSpeech textToSpeech) { + ResponseBody body = openAiStreamClient.textToSpeech(textToSpeech); + if (body != null) { + // 将ResponseBody转换为InputStreamResource + InputStreamResource resource = new InputStreamResource(body.byteStream()); - try (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(); - } + // 创建并返回ResponseEntity + return ResponseEntity.ok() + .contentType(MediaType.parseMediaType("audio/mpeg")) + .body(resource); + } else { + // 如果ResponseBody为空,返回404状态码 + return ResponseEntity.notFound().build(); } } + /** * 语音转文字 */ @@ -309,6 +323,7 @@ public class SseServiceImpl implements ISseService { * @param request * @return */ + @Override public List dall3(Dall3Request request) { openAiStreamClient = chatConfig.getOpenAiStreamClient(); chatService.checkUserGrade(); @@ -521,4 +536,100 @@ public class SseServiceImpl implements ISseService { return "unknown"; } + + + @Override + public String translation(TranslationRequest translationRequest) { + + 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("作为英汉翻译,您的任务是准确地在两种语言之间翻译文本。翻译时,请注意上下文,准确解释成语和谚语。如果连续收到多个英文单词,请默认将其翻译成中文句子。但如果前面有'phrase:’,则应翻译为短语;如果有'norma!:',则翻译为多个无关的单词。您的翻译应接近母语者的水平,并考虑用户要求的特定语言风格或语气。避免使用冒犯性词汇,必要时用x替换。提供翻译时,请用中文解释每句话的时态、从句、主语、谓语、宾语、特殊短语和谚语对于需要翻译的短语或单词,请提供来源(词典)。如果要求翻译多个短语,请用|符号分隔。请记住:您是英汉翻译,不是汉汉翻译或英英翻译。提交前请仔细检查和修订答案,回复控制在50字以内").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) { + final SseEmitter emitter = new SseEmitter(); + String host = "http://localhost:11434/"; + + List msgList = chatRequest.getMessages(); + Message message = msgList.get(msgList.size() - 1); + + OllamaAPI ollamaAPI = new OllamaAPI(host); + + ollamaAPI.setRequestTimeoutSeconds(100); + + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance("qwen2.5:7b"); + + OllamaChatRequestModel requestModel = builder + .withMessage(OllamaChatMessageRole.USER, + message.getContent().toString()) + .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()); + } + }; + ollamaAPI.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/HttpUtils.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/HttpUtils.java new file mode 100644 index 00000000..24ddccb6 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/HttpUtils.java @@ -0,0 +1,634 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/WddPptApi.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/WddPptApi.java new file mode 100644 index 00000000..9693975c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/WddPptApi.java @@ -0,0 +1,438 @@ +package org.ruoyi.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/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/MjOkHttpUtil.java b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/WeChatScanHttpUtil.java similarity index 60% rename from ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/MjOkHttpUtil.java rename to ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/WeChatScanHttpUtil.java index 3088fd4d..b303d774 100644 --- a/ruoyi-modules/ruoyi-midjourney/src/main/java/com/xmzs/midjourney/util/MjOkHttpUtil.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/ruoyi/system/util/WeChatScanHttpUtil.java @@ -1,29 +1,28 @@ -package com.xmzs.midjourney.util; +package org.ruoyi.system.util; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import okhttp3.*; -import org.springframework.beans.factory.annotation.Value; +import org.ruoyi.common.core.service.ConfigService; import org.springframework.stereotype.Component; import java.io.IOException; -import java.util.List; import java.util.concurrent.TimeUnit; /** - * @author WangLe + * 绘声美音HTTP请求工具类 + * + * @author NSL + * @since 2024-12-25 */ @RequiredArgsConstructor @Component @Slf4j -public class MjOkHttpUtil { +public class WeChatScanHttpUtil { - @Value("${chat.apiKey}") - private List apiKey; - @Value("${chat.apiHost}") - private String apiHost; + private final ConfigService configService; - private static final String API_SECRET_HEADER = "mj-api-secret"; + private static final String TOKEN = "token"; private final OkHttpClient client = new OkHttpClient.Builder() .connectTimeout(300, TimeUnit.SECONDS) @@ -45,21 +44,16 @@ public class MjOkHttpUtil { } public Request createPostRequest(String url, String json) { - MediaType JSON = MediaType.get("application/json; charset=utf-8"); - RequestBody body = RequestBody.create(json, JSON); + RequestBody body = RequestBody.create(json, MediaType.get("application/json; charset=utf-8")); return new Request.Builder() - .url(apiHost + url) + .url(url) .post(body) - .header(API_SECRET_HEADER, apiKey.get(0)) + .header("Content-Type", "application/json") + .header(TOKEN, getKey(TOKEN)) .build(); } - public Request createGetRequest(String url) { - return new Request.Builder() - .url(apiHost + url) - .header(API_SECRET_HEADER, apiKey.get(0)) - .build(); + public String getKey(String key) { + return configService.getConfigValue("cover", key); } - } - diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/package-info.md b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/package-info.md deleted file mode 100644 index c938b1e5..00000000 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/package-info.md +++ /dev/null @@ -1,3 +0,0 @@ -java包使用 `.` 分割 resource 目录使用 `/` 分割 -
-此文件目的 防止文件夹粘连找不到 `xml` 文件 \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CoverMapper.xml similarity index 71% rename from ruoyi-modules/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm rename to ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CoverMapper.xml index 9fb48d99..b5745320 100644 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CoverMapper.xml @@ -2,6 +2,6 @@ - + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CoverPromptAudioMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CoverPromptAudioMapper.xml new file mode 100644 index 00000000..0871a29e --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CoverPromptAudioMapper.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/script/bin/ry.bat b/script/bin/ry.bat deleted file mode 100644 index 94434a91..00000000 --- a/script/bin/ry.bat +++ /dev/null @@ -1,68 +0,0 @@ -rem 使用者应根据自身平台编码自行转换 防止乱码 例如 win使用gbk编码 -@echo off - -rem jar平级目录 -set AppName=ruoyi-admin.jar - -rem JVM参数 -set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" - - -ECHO. - ECHO. [1] 启动%AppName% - ECHO. [2] 关闭%AppName% - ECHO. [3] 重启%AppName% - ECHO. [4] 启动状态 %AppName% - ECHO. [5] 退 出 -ECHO. - -ECHO.请输入选择项目的序号: -set /p ID= - IF "%id%"=="1" GOTO start - IF "%id%"=="2" GOTO stop - IF "%id%"=="3" GOTO restart - IF "%id%"=="4" GOTO status - IF "%id%"=="5" EXIT -PAUSE -:start - for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if defined pid ( - echo %%is running - PAUSE - ) - -start javaw %JVM_OPTS% -jar %AppName% - -echo starting…… -echo Start %AppName% success... -goto:eof - -rem 函数stop通过jps命令查找pid并结束进程 -:stop - for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if not defined pid (echo process %AppName% does not exists) else ( - echo prepare to kill %image_name% - echo start kill %pid% ... - rem 根据进程ID,kill进程 - taskkill /f /pid %pid% - ) -goto:eof -:restart - call :stop - call :start -goto:eof -:status - for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if not defined pid (echo process %AppName% is dead ) else ( - echo %image_name% is running - ) -goto:eof diff --git a/script/bin/ry.sh b/script/bin/ry.sh deleted file mode 100644 index 0cf5ce9b..00000000 --- a/script/bin/ry.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh -# ./ry.sh start 启动 stop 停止 restart 重启 status 状态 -AppName=ruoyi-admin.jar - -# JVM参数 -JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" -APP_HOME=`pwd` -LOG_PATH=$APP_HOME/logs/$AppName.log - -if [ "$1" = "" ]; -then - echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m" - exit 1 -fi - -if [ "$AppName" = "" ]; -then - echo -e "\033[0;31m 未输入应用名 \033[0m" - exit 1 -fi - -function start() -{ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` - - if [ x"$PID" != x"" ]; then - echo "$AppName is running..." - else - nohup java $JVM_OPTS -jar $AppName > /dev/null 2>&1 & - echo "Start $AppName success..." - fi -} - -function stop() -{ - echo "Stop $AppName" - - PID="" - query(){ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` - } - - query - if [ x"$PID" != x"" ]; then - kill -TERM $PID - echo "$AppName (pid:$PID) exiting..." - while [ x"$PID" != x"" ] - do - sleep 1 - query - done - echo "$AppName exited." - else - echo "$AppName already stopped." - fi -} - -function restart() -{ - stop - sleep 2 - start -} - -function status() -{ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l` - if [ $PID != 0 ];then - echo "$AppName is running..." - else - echo "$AppName is not running..." - fi -} - -case $1 in - start) - start;; - stop) - stop;; - restart) - restart;; - status) - status;; - *) - -esac diff --git a/script/docker/.env b/script/docker/.env deleted file mode 100644 index 69c2a7ee..00000000 --- a/script/docker/.env +++ /dev/null @@ -1,5 +0,0 @@ -CHAT_API_KEY= sk-xx -CHAT_API_HOST=https://api.pandarobot.chat/ -MAIL_PASS=your_mail_pass -PAY_PID=your_pay_pid -PAY_KEY=your_pay_key diff --git a/script/docker/milvus/docker-compose.yml b/script/docker/milvus/docker-compose.yml new file mode 100644 index 00000000..37506bee --- /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/ry-vue.sql b/script/docker/ruoyi-ai.sql similarity index 99% rename from script/docker/ry-vue.sql rename to script/docker/ruoyi-ai.sql index 5473fabb..c60acaa0 100644 --- a/script/docker/ry-vue.sql +++ b/script/docker/ruoyi-ai.sql @@ -611,7 +611,7 @@ CREATE TABLE `sys_audio_role` ( `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `voice_id`(`create_by`, `voice_id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '配音角色' ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '应用市场' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_audio_role diff --git a/script/docker/weaviate/docker-compose.yml b/script/docker/weaviate/docker-compose.yml new file mode 100644 index 00000000..b43bd5d9 --- /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/oracle/oracle_ry_vue_5.X.sql b/script/sql/oracle/oracle_ry_vue_5.X.sql deleted file mode 100644 index 0456f11e..00000000 --- a/script/sql/oracle/oracle_ry_vue_5.X.sql +++ /dev/null @@ -1,1119 +0,0 @@ --- ---------------------------- --- 租户表 --- ---------------------------- -create table sys_tenant ( - id number(20) not null, - tenant_id varchar2(20) not null, - contact_user_name varchar2(20) default '', - contact_phone varchar2(20) default '', - company_name varchar2(50) default '', - license_number varchar2(30) default '', - address varchar2(200) default '', - intro varchar2(200) default '', - domain varchar2(200) default '', - remark varchar2(200) default '', - package_id number(20) default null, - expire_time date default null, - account_count number(4) default -1, - status char(1) default '0', - del_flag char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date -); - -alter table sys_tenant add constraint pk_sys_tenant primary key (id); - -comment on table sys_tenant is '租户表'; -comment on column sys_tenant.tenant_id is '租户编号'; -comment on column sys_tenant.contact_phone is '联系电话'; -comment on column sys_tenant.company_name is '企业名称'; -comment on column sys_tenant.company_name is '联系人'; -comment on column sys_tenant.license_number is '统一社会信用代码'; -comment on column sys_tenant.address is '地址'; -comment on column sys_tenant.intro is '企业简介'; -comment on column sys_tenant.remark is '备注'; -comment on column sys_tenant.package_id is '租户套餐编号'; -comment on column sys_tenant.expire_time is '过期时间'; -comment on column sys_tenant.account_count is '用户数量(-1不限制)'; -comment on column sys_tenant.status is '租户状态(0正常 1停用)'; -comment on column sys_tenant.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_tenant.create_dept is '创建部门'; -comment on column sys_tenant.create_by is '创建者'; -comment on column sys_tenant.create_time is '创建时间'; -comment on column sys_tenant.update_by is '更新者'; -comment on column sys_tenant.update_time is '更新时间'; - --- ---------------------------- --- 初始化-租户表数据 --- ---------------------------- - -insert into sys_tenant values(1, '000000', '管理组', '15888888888', 'XXX有限公司', null, null, '多租户通用后台管理管理系统', null, null, null, null, -1, '0', '0', 103, 1, sysdate, null, null); - - --- ---------------------------- --- 租户套餐表 --- ---------------------------- -create table sys_tenant_package ( - package_id number(20) not null, - package_name varchar2(20) default '', - menu_ids varchar2(3000) default '', - remark varchar2(200) default '', - menu_check_strictly number(1) default 1, - status char(1) default '0', - del_flag char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date -); - -alter table sys_tenant_package add constraint pk_sys_tenant_package primary key (package_id); - -comment on table sys_tenant_package is '租户套餐表'; -comment on column sys_tenant_package.package_id is '租户套餐id'; -comment on column sys_tenant_package.package_name is '套餐名称'; -comment on column sys_tenant_package.menu_ids is '关联菜单id'; -comment on column sys_tenant_package.remark is '备注'; -comment on column sys_tenant_package.status is '状态(0正常 1停用)'; -comment on column sys_tenant_package.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_tenant_package.create_dept is '创建部门'; -comment on column sys_tenant_package.create_by is '创建者'; -comment on column sys_tenant_package.create_time is '创建时间'; -comment on column sys_tenant_package.update_by is '更新者'; -comment on column sys_tenant_package.update_time is '更新时间'; - - --- ---------------------------- --- 1、部门表 --- ---------------------------- -create table sys_dept ( - dept_id number(20) not null, - tenant_id varchar2(20) default '000000', - parent_id number(20) default 0, - ancestors varchar2(500) default '', - dept_name varchar2(30) default '', - order_num number(4) default 0, - leader varchar2(20) default null, - phone varchar2(11) default null, - email varchar2(50) default null, - status char(1) default '0', - del_flag char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date -); - -alter table sys_dept add constraint pk_sys_dept primary key (dept_id); - -comment on table sys_dept is '部门表'; -comment on column sys_dept.dept_id is '部门id'; -comment on column sys_dept.tenant_id is '租户编号'; -comment on column sys_dept.parent_id is '父部门id'; -comment on column sys_dept.ancestors is '祖级列表'; -comment on column sys_dept.dept_name is '部门名称'; -comment on column sys_dept.order_num is '显示顺序'; -comment on column sys_dept.leader is '负责人'; -comment on column sys_dept.phone is '联系电话'; -comment on column sys_dept.email is '邮箱'; -comment on column sys_dept.status is '部门状态(0正常 1停用)'; -comment on column sys_dept.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_dept.create_dept is '创建部门'; -comment on column sys_dept.create_by is '创建者'; -comment on column sys_dept.create_time is '创建时间'; -comment on column sys_dept.update_by is '更新者'; -comment on column sys_dept.update_time is '更新时间'; - --- ---------------------------- --- 初始化-部门表数据 --- ---------------------------- -insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); -insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate, null, null); - - --- ---------------------------- --- 2、用户信息表 --- ---------------------------- -create table sys_user ( - user_id number(20) not null, - tenant_id varchar2(20) default '000000', - dept_id number(20) default null, - user_name varchar2(40) not null, - nick_name varchar2(40) not null, - user_type varchar2(10) default 'sys_user', - email varchar2(50) default '', - phonenumber varchar2(11) default '', - sex char(1) default '0', - avatar number(20) default null, - password varchar2(100) default '', - status char(1) default '0', - del_flag char(1) default '0', - login_ip varchar2(128) default '', - login_date date, - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date, - remark varchar2(500) default '' -); - -alter table sys_user add constraint pk_sys_user primary key (user_id); - -comment on table sys_user is '用户信息表'; -comment on column sys_user.user_id is '用户ID'; -comment on column sys_user.tenant_id is '租户编号'; -comment on column sys_user.dept_id is '部门ID'; -comment on column sys_user.user_name is '用户账号'; -comment on column sys_user.nick_name is '用户昵称'; -comment on column sys_user.user_type is '用户类型(sys_user系统用户)'; -comment on column sys_user.email is '用户邮箱'; -comment on column sys_user.phonenumber is '手机号码'; -comment on column sys_user.sex is '用户性别(0男 1女 2未知)'; -comment on column sys_user.avatar is '头像路径'; -comment on column sys_user.password is '密码'; -comment on column sys_user.status is '帐号状态(0正常 1停用)'; -comment on column sys_user.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_user.login_ip is '最后登录IP'; -comment on column sys_user.login_date is '最后登录时间'; -comment on column sys_user.create_dept is '创建部门'; -comment on column sys_user.create_by is '创建者'; -comment on column sys_user.create_time is '创建时间'; -comment on column sys_user.update_by is '更新者'; -comment on column sys_user.update_time is '更新时间'; -comment on column sys_user.remark is '备注'; - --- ---------------------------- --- 初始化-用户信息表数据 --- ---------------------------- -insert into sys_user values(1, '000000', 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, null, null, '管理员'); -insert into sys_user values(2, '000000', 105, 'lionli', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@qq.com', '15666666666', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, null, null, '测试员'); - - --- ---------------------------- --- 3、岗位信息表 --- ---------------------------- -create table sys_post ( - post_id number(20) not null, - tenant_id varchar2(20) default '000000', - post_code varchar2(64) not null, - post_name varchar2(50) not null, - post_sort number(4) not null, - status char(1) not null, - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date, - remark varchar2(500) -); - -alter table sys_post add constraint pk_sys_post primary key (post_id); - -comment on table sys_post is '岗位信息表'; -comment on column sys_post.post_id is '岗位ID'; -comment on column sys_post.tenant_id is '租户编号'; -comment on column sys_post.post_code is '岗位编码'; -comment on column sys_post.post_name is '岗位名称'; -comment on column sys_post.post_sort is '显示顺序'; -comment on column sys_post.status is '状态(0正常 1停用)'; -comment on column sys_post.create_dept is '创建部门'; -comment on column sys_post.create_by is '创建者'; -comment on column sys_post.create_time is '创建时间'; -comment on column sys_post.update_by is '更新者'; -comment on column sys_post.update_time is '更新时间'; -comment on column sys_post.remark is '备注'; - --- ---------------------------- --- 初始化-岗位信息表数据 --- ---------------------------- -insert into sys_post values(1, '000000', 'ceo', '董事长', 1, '0', 103, 1, sysdate, null, null, ''); -insert into sys_post values(2, '000000', 'se', '项目经理', 2, '0', 103, 1, sysdate, null, null, ''); -insert into sys_post values(3, '000000', 'hr', '人力资源', 3, '0', 103, 1, sysdate, null, null, ''); -insert into sys_post values(4, '000000', 'user', '普通员工', 4, '0', 103, 1, sysdate, null, null, ''); - - --- ---------------------------- --- 4、角色信息表 --- ---------------------------- -create table sys_role ( - role_id number(20) not null, - tenant_id varchar2(20) default '000000', - role_name varchar2(30) not null, - role_key varchar2(100) not null, - role_sort number(4) not null, - data_scope char(1) default '1', - menu_check_strictly number(1) default 1, - dept_check_strictly number(1) default 1, - status char(1) not null, - del_flag char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date, - remark varchar2(500) default null -); - -alter table sys_role add constraint pk_sys_role primary key (role_id); - -comment on table sys_role is '角色信息表'; -comment on column sys_role.role_id is '角色ID'; -comment on column sys_role.tenant_id is '租户编号'; -comment on column sys_role.role_name is '角色名称'; -comment on column sys_role.role_key is '角色权限字符串'; -comment on column sys_role.role_sort is '显示顺序'; -comment on column sys_role.data_scope is '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)'; -comment on column sys_role.menu_check_strictly is '菜单树选择项是否关联显示'; -comment on column sys_role.dept_check_strictly is '部门树选择项是否关联显示'; -comment on column sys_role.status is '角色状态(0正常 1停用)'; -comment on column sys_role.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_role.create_dept is '创建部门'; -comment on column sys_role.create_by is '创建者'; -comment on column sys_role.create_time is '创建时间'; -comment on column sys_role.update_by is '更新者'; -comment on column sys_role.update_time is '更新时间'; -comment on column sys_role.remark is '备注'; - --- ---------------------------- --- 初始化-角色信息表数据 --- ---------------------------- -insert into sys_role values('1', '000000', '超级管理员', 'superadmin', 1, 1, 1, 1, '0', '0', 103, 1, sysdate, null, null, '超级管理员'); -insert into sys_role values('2', '000000', '普通角色', 'common', 2, 2, 1, 1, '0', '0', 103, 1, sysdate, null, null, '普通角色'); - - --- ---------------------------- --- 5、菜单权限表 --- ---------------------------- -create table sys_menu ( - menu_id number(20) not null, - menu_name varchar2(50) not null, - parent_id number(20) default 0, - order_num number(4) default 0, - path varchar(200) default '', - component varchar(255) default null, - query_param varchar(255) default null, - is_frame number(1) default 1, - is_cache number(1) default 0, - menu_type char(1) default '', - visible char(1) default 0, - status char(1) default 0, - perms varchar2(100) default null, - icon varchar2(100) default '#', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date , - remark varchar2(500) default '' -); - -alter table sys_menu add constraint pk_sys_menu primary key (menu_id); - -comment on table sys_menu is '菜单权限表'; -comment on column sys_menu.menu_id is '菜单ID'; -comment on column sys_menu.menu_name is '菜单名称'; -comment on column sys_menu.parent_id is '父菜单ID'; -comment on column sys_menu.order_num is '显示顺序'; -comment on column sys_menu.path is '请求地址'; -comment on column sys_menu.component is '路由地址'; -comment on column sys_menu.query_param is '路由参数'; -comment on column sys_menu.is_frame is '是否为外链(0是 1否)'; -comment on column sys_menu.is_cache is '是否缓存(0缓存 1不缓存)'; -comment on column sys_menu.menu_type is '菜单类型(M目录 C菜单 F按钮)'; -comment on column sys_menu.visible is '显示状态(0显示 1隐藏)'; -comment on column sys_menu.status is '菜单状态(0正常 1停用)'; -comment on column sys_menu.perms is '权限标识'; -comment on column sys_menu.icon is '菜单图标'; -comment on column sys_menu.create_dept is '创建部门'; -comment on column sys_menu.create_by is '创建者'; -comment on column sys_menu.create_time is '创建时间'; -comment on column sys_menu.update_by is '更新者'; -comment on column sys_menu.update_time is '更新时间'; -comment on column sys_menu.remark is '备注'; - --- ---------------------------- --- 初始化-菜单信息表数据 --- ---------------------------- --- 一级菜单 -insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', 1, 0, 'M', '0', '0', '', 'system', 103, 1, sysdate, null, null, '系统管理目录'); -insert into sys_menu values('6', '租户管理', '0', '2', 'tenant', null, '', 1, 0, 'M', '0', '0', '', 'chart', 103, 1, sysdate, null, null, '租户管理目录'); -insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', 1, 0, 'M', '0', '0', '', 'monitor', 103, 1, sysdate, null, null, '系统监控目录'); -insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', 1, 0, 'M', '0', '0', '', 'tool', 103, 1, sysdate, null, null, '系统工具目录'); -insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', 0, 0, 'M', '0', '0', '', 'guide', 103, 1, sysdate, null, null, 'RuoYi-Vue-Plus官网地址'); --- 二级菜单 -insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 103, 1, sysdate, null, null, '用户管理菜单'); -insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 103, 1, sysdate, null, null, '角色管理菜单'); -insert into sys_menu values('102', '菜单管理', '1', '3', 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 103, 1, sysdate, null, null, '菜单管理菜单'); -insert into sys_menu values('103', '部门管理', '1', '4', 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 103, 1, sysdate, null, null, '部门管理菜单'); -insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 103, 1, sysdate, null, null, '岗位管理菜单'); -insert into sys_menu values('105', '字典管理', '1', '6', 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 103, 1, sysdate, null, null, '字典管理菜单'); -insert into sys_menu values('106', '参数设置', '1', '7', 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 103, 1, sysdate, null, null, '参数设置菜单'); -insert into sys_menu values('107', '通知公告', '1', '8', 'notice', 'system/notice/index', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 103, 1, sysdate, null, null, '通知公告菜单'); -insert into sys_menu values('108', '日志管理', '1', '9', 'log', '', '', 1, 0, 'M', '0', '0', '', 'log', 103, 1, sysdate, null, null, '日志管理菜单'); -insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 103, 1, sysdate, null, null, '在线用户菜单'); -insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 103, 1, sysdate, null, null, '缓存监控菜单'); -insert into sys_menu values('114', '表单构建', '3', '1', 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 103, 1, sysdate, null, null, '表单构建菜单'); -insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, sysdate, null, null, '代码生成菜单'); -insert into sys_menu values('121', '租户管理', '6', '1', 'tenant', 'system/tenant/index', '', 1, 0, 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, sysdate, null, null, '租户管理菜单'); -insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', 1, 0, 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, sysdate, null, null, '租户套餐管理菜单'); --- springboot-admin监控 -insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', 1, 0, 'C', '0', '0', 'monitor:admin:list', 'dashboard', 103, 1, sysdate, null, null, 'Admin监控菜单'); --- oss菜单 -insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', 1, 0, 'C', '0', '0', 'system:oss:list', 'upload', 103, 1, sysdate, null, null, '文件管理菜单'); --- xxl-job-admin控制台 -insert into sys_menu values('120', '任务调度中心', '2', '5', 'XxlJob', 'monitor/xxljob/index', '', 1, 0, 'C', '0', '0', 'monitor:xxljob:list', 'job', 103, 1, sysdate, null, null, 'Xxl-Job控制台菜单'); - --- 三级菜单 -insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 103, 1, sysdate, null, null, '操作日志菜单'); -insert into sys_menu values('501', '登录日志', '108', '2', 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 103, 1, sysdate, null, null, '登录日志菜单'); --- 用户管理按钮 -insert into sys_menu values('1001', '用户查询', '100', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1002', '用户新增', '100', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1003', '用户修改', '100', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1004', '用户删除', '100', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1005', '用户导出', '100', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1006', '用户导入', '100', '6', '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1007', '重置密码', '100', '7', '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 103, 1, sysdate, null, null, ''); --- 角色管理按钮 -insert into sys_menu values('1008', '角色查询', '101', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1009', '角色新增', '101', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1010', '角色修改', '101', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1011', '角色删除', '101', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1012', '角色导出', '101', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 103, 1, sysdate, null, null, ''); --- 菜单管理按钮 -insert into sys_menu values('1013', '菜单查询', '102', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1014', '菜单新增', '102', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1015', '菜单修改', '102', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1016', '菜单删除', '102', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 103, 1, sysdate, null, null, ''); --- 部门管理按钮 -insert into sys_menu values('1017', '部门查询', '103', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1018', '部门新增', '103', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1019', '部门修改', '103', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1020', '部门删除', '103', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 103, 1, sysdate, null, null, ''); --- 岗位管理按钮 -insert into sys_menu values('1021', '岗位查询', '104', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1022', '岗位新增', '104', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1023', '岗位修改', '104', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1024', '岗位删除', '104', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1025', '岗位导出', '104', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 103, 1, sysdate, null, null, ''); --- 字典管理按钮 -insert into sys_menu values('1026', '字典查询', '105', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1027', '字典新增', '105', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1028', '字典修改', '105', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1029', '字典删除', '105', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1030', '字典导出', '105', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 103, 1, sysdate, null, null, ''); --- 参数设置按钮 -insert into sys_menu values('1031', '参数查询', '106', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 103, 1, sysdate, null, null, ''); --- 通知公告按钮 -insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 103, 1, sysdate, null, null, ''); --- 操作日志按钮 -insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 103, 1, sysdate, null, null, ''); --- 登录日志按钮 -insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1050', '账户解锁', '501', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 103, 1, sysdate, null, null, ''); --- 在线用户按钮 -insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 103, 1, sysdate, null, null, ''); --- 代码生成按钮 -insert into sys_menu values('1055', '生成查询', '115', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1057', '生成删除', '115', '3', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1058', '导入代码', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1059', '预览代码', '115', '4', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1060', '生成代码', '115', '5', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 103, 1, sysdate, null, null, ''); --- oss相关按钮 -insert into sys_menu values('1600', '文件查询', '118', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1601', '文件上传', '118', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:upload', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1602', '文件下载', '118', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:download', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1603', '文件删除', '118', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1604', '配置添加', '118', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1605', '配置编辑', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:edit', '#', 103, 1, sysdate, null, null, ''); --- 租户管理相关按钮 -insert into sys_menu values('1606', '租户查询', '121', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1607', '租户新增', '121', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1608', '租户修改', '121', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1609', '租户删除', '121', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1610', '租户导出', '121', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:export', '#', 103, 1, sysdate, null, null, ''); --- 租户套餐管理相关按钮 -insert into sys_menu values('1611', '租户套餐查询', '122', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:query', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1612', '租户套餐新增', '122', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:add', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1613', '租户套餐修改', '122', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:edit', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1614', '租户套餐删除', '122', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:remove', '#', 103, 1, sysdate, null, null, ''); -insert into sys_menu values('1615', '租户套餐导出', '122', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:export', '#', 103, 1, sysdate, null, null, ''); - - --- ---------------------------- --- 6、用户和角色关联表 用户N-1角色 --- ---------------------------- -create table sys_user_role ( - user_id number(20) not null, - role_id number(20) not null -); - -alter table sys_user_role add constraint pk_sys_user_role primary key (user_id, role_id); - -comment on table sys_user_role is '用户和角色关联表'; -comment on column sys_user_role.user_id is '用户ID'; -comment on column sys_user_role.role_id is '角色ID'; - --- ---------------------------- --- 初始化-用户和角色关联表数据 --- ---------------------------- -insert into sys_user_role values ('1', '1'); -insert into sys_user_role values ('2', '2'); - - --- ---------------------------- --- 7、角色和菜单关联表 角色1-N菜单 --- ---------------------------- -create table sys_role_menu ( - role_id number(20) not null, - menu_id number(20) not null -); - -alter table sys_role_menu add constraint pk_sys_role_menu primary key (role_id, menu_id); - -comment on table sys_role_menu is '角色和菜单关联表'; -comment on column sys_role_menu.role_id is '角色ID'; -comment on column sys_role_menu.menu_id is '菜单ID'; - --- ---------------------------- --- 初始化-角色和菜单关联表数据 --- ---------------------------- -insert into sys_role_menu values ('2', '1'); -insert into sys_role_menu values ('2', '2'); -insert into sys_role_menu values ('2', '3'); -insert into sys_role_menu values ('2', '4'); -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', '109'); -insert into sys_role_menu values ('2', '110'); -insert into sys_role_menu values ('2', '111'); -insert into sys_role_menu values ('2', '112'); -insert into sys_role_menu values ('2', '113'); -insert into sys_role_menu values ('2', '114'); -insert into sys_role_menu values ('2', '115'); -insert into sys_role_menu values ('2', '116'); -insert into sys_role_menu values ('2', '500'); -insert into sys_role_menu values ('2', '501'); -insert into sys_role_menu values ('2', '1000'); -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', '1046'); -insert into sys_role_menu values ('2', '1047'); -insert into sys_role_menu values ('2', '1048'); -insert into sys_role_menu values ('2', '1055'); -insert into sys_role_menu values ('2', '1056'); -insert into sys_role_menu values ('2', '1057'); -insert into sys_role_menu values ('2', '1058'); -insert into sys_role_menu values ('2', '1059'); -insert into sys_role_menu values ('2', '1060'); - --- ---------------------------- --- 8、角色和部门关联表 角色1-N部门 --- ---------------------------- -create table sys_role_dept ( - role_id number(20) not null, - dept_id number(20) not null -); - -alter table sys_role_dept add constraint pk_sys_role_dept primary key (role_id, dept_id); - -comment on table sys_role_dept is '角色和部门关联表'; -comment on column sys_role_dept.role_id is '角色ID'; -comment on column sys_role_dept.dept_id is '部门ID'; - --- ---------------------------- --- 初始化-角色和部门关联表数据 --- ---------------------------- -insert into sys_role_dept values ('2', '100'); -insert into sys_role_dept values ('2', '101'); -insert into sys_role_dept values ('2', '105'); - - --- ---------------------------- --- 9、用户与岗位关联表 用户1-N岗位 --- ---------------------------- -create table sys_user_post ( - user_id number(20) not null, - post_id number(20) not null -); - -alter table sys_user_post add constraint pk_sys_user_post primary key (user_id, post_id); - -comment on table sys_user_post is '用户与岗位关联表'; -comment on column sys_user_post.user_id is '用户ID'; -comment on column sys_user_post.post_id is '岗位ID'; - --- ---------------------------- --- 初始化-用户与岗位关联表数据 --- ---------------------------- -insert into sys_user_post values ('1', '1'); -insert into sys_user_post values ('2', '2'); - - --- ---------------------------- --- 10、操作日志记录 --- ---------------------------- -create table sys_oper_log ( - oper_id number(20) not null, - tenant_id varchar2(20) default '000000', - title varchar2(50) default '', - business_type number(2) default 0, - method varchar2(100) default '', - request_method varchar(10) default '', - operator_type number(1) default 0, - oper_name varchar2(50) default '', - dept_name varchar2(50) default '', - oper_url varchar2(255) default '', - oper_ip varchar2(128) default '', - oper_location varchar2(255) default '', - oper_param varchar2(2100) default '', - json_result varchar2(2100) default '', - status number(1) default 0, - error_msg varchar2(2100) default '', - oper_time date, - cost_time number(20) default 0 -); - -alter table sys_oper_log add constraint pk_sys_oper_log primary key (oper_id); -create index idx_sys_oper_log_bt on sys_oper_log (business_type); -create index idx_sys_oper_log_s on sys_oper_log (status); -create index idx_sys_oper_log_ot on sys_oper_log (oper_time); - -comment on table sys_oper_log is '操作日志记录'; -comment on column sys_oper_log.oper_id is '日志主键'; -comment on column sys_oper_log.tenant_id is '租户编号'; -comment on column sys_oper_log.title is '模块标题'; -comment on column sys_oper_log.business_type is '业务类型(0其它 1新增 2修改 3删除)'; -comment on column sys_oper_log.method is '方法名称'; -comment on column sys_oper_log.request_method is '请求方式'; -comment on column sys_oper_log.operator_type is '操作类别(0其它 1后台用户 2手机端用户)'; -comment on column sys_oper_log.oper_name is '操作人员'; -comment on column sys_oper_log.dept_name is '部门名称'; -comment on column sys_oper_log.oper_url is '请求URL'; -comment on column sys_oper_log.oper_ip is '主机地址'; -comment on column sys_oper_log.oper_location is '操作地点'; -comment on column sys_oper_log.oper_param is '请求参数'; -comment on column sys_oper_log.json_result is '返回参数'; -comment on column sys_oper_log.status is '操作状态(0正常 1异常)'; -comment on column sys_oper_log.error_msg is '错误消息'; -comment on column sys_oper_log.oper_time is '操作时间'; -comment on column sys_oper_log.cost_time is '消耗时间'; - - --- ---------------------------- --- 11、字典类型表 --- ---------------------------- -create table sys_dict_type ( - dict_id number(20) not null, - tenant_id varchar2(20) default '000000', - dict_name varchar2(100) default '', - dict_type varchar2(100) default '', - status char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date, - remark varchar2(500) default null -); - -alter table sys_dict_type add constraint pk_sys_dict_type primary key (dict_id); -create unique index sys_dict_type_index1 on sys_dict_type (tenant_id, dict_type); - -comment on table sys_dict_type is '字典类型表'; -comment on column sys_dict_type.dict_id is '字典主键'; -comment on column sys_dict_type.tenant_id is '租户编号'; -comment on column sys_dict_type.dict_name is '字典名称'; -comment on column sys_dict_type.dict_type is '字典类型'; -comment on column sys_dict_type.status is '状态(0正常 1停用)'; -comment on column sys_dict_type.create_dept is '创建部门'; -comment on column sys_dict_type.create_by is '创建者'; -comment on column sys_dict_type.create_time is '创建时间'; -comment on column sys_dict_type.update_by is '更新者'; -comment on column sys_dict_type.update_time is '更新时间'; -comment on column sys_dict_type.remark is '备注'; - -insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', '0', 103, 1, sysdate, null, null, '用户性别列表'); -insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', '0', 103, 1, sysdate, null, null, '菜单状态列表'); -insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', '0', 103, 1, sysdate, null, null, '系统开关列表'); -insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', '0', 103, 1, sysdate, null, null, '系统是否列表'); -insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', '0', 103, 1, sysdate, null, null, '通知类型列表'); -insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', '0', 103, 1, sysdate, null, null, '通知状态列表'); -insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', '0', 103, 1, sysdate, null, null, '操作类型列表'); -insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', '0', 103, 1, sysdate, null, null, '登录状态列表'); - - --- ---------------------------- --- 12、字典数据表 --- ---------------------------- -create table sys_dict_data ( - dict_code number(20) not null, - tenant_id varchar2(20) default '000000', - dict_sort number(4) default 0, - dict_label varchar2(100) default '', - dict_value varchar2(100) default '', - dict_type varchar2(100) default '', - css_class varchar2(100) default null, - list_class varchar2(100) default null, - is_default char(1) default 'N', - status char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date, - remark varchar2(500) default null -); - -alter table sys_dict_data add constraint pk_sys_dict_data primary key (dict_code); - -comment on table sys_dict_data is '字典数据表'; -comment on column sys_dict_data.dict_code is '字典主键'; -comment on column sys_dict_data.tenant_id is '租户编号'; -comment on column sys_dict_data.dict_sort is '字典排序'; -comment on column sys_dict_data.dict_label is '字典标签'; -comment on column sys_dict_data.dict_value is '字典键值'; -comment on column sys_dict_data.dict_type is '字典类型'; -comment on column sys_dict_data.css_class is '样式属性(其他样式扩展)'; -comment on column sys_dict_data.list_class is '表格回显样式'; -comment on column sys_dict_data.is_default is '是否默认(Y是 N否)'; -comment on column sys_dict_data.status is '状态(0正常 1停用)'; -comment on column sys_dict_data.create_dept is '创建部门'; -comment on column sys_dict_data.create_by is '创建者'; -comment on column sys_dict_data.create_time is '创建时间'; -comment on column sys_dict_data.update_by is '更新者'; -comment on column sys_dict_data.update_time is '更新时间'; -comment on column sys_dict_data.remark is '备注'; - -insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 103, 1, sysdate, null, null, '性别男'); -insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 103, 1, sysdate, null, null, '性别女'); -insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 103, 1, sysdate, null, null, '性别未知'); -insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 103, 1, sysdate, null, null, '显示菜单'); -insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '隐藏菜单'); -insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '停用状态'); -insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 103, 1, sysdate, null, null, '系统默认是'); -insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '系统默认否'); -insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 103, 1, sysdate, null, null, '通知'); -insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 103, 1, sysdate, null, null, '公告'); -insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '关闭状态'); -insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate, null, null, '其他操作'); -insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate, null, null, '新增操作'); -insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, sysdate, null, null, '修改操作'); -insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '删除操作'); -insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 103, 1, sysdate, null, null, '授权操作'); -insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate, null, null, '导出操作'); -insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate, null, null, '导入操作'); -insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '强退操作'); -insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, sysdate, null, null, '生成操作'); -insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '清空操作'); -insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 103, 1, sysdate, null, null, '正常状态'); -insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 103, 1, sysdate, null, null, '停用状态'); - - --- ---------------------------- --- 13、参数配置表 --- ---------------------------- -create table sys_config ( - config_id number(20) not null, - tenant_id varchar2(20) default '000000', - config_name varchar2(100) default '', - config_key varchar2(100) default '', - config_value varchar2(100) default '', - config_type char(1) default 'N', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date, - remark varchar2(500) default null -); -alter table sys_config add constraint pk_sys_config primary key (config_id); - -comment on table sys_config is '参数配置表'; -comment on column sys_config.config_id is '参数主键'; -comment on column sys_config.tenant_id is '租户编号'; -comment on column sys_config.config_name is '参数名称'; -comment on column sys_config.config_key is '参数键名'; -comment on column sys_config.config_value is '参数键值'; -comment on column sys_config.config_type is '系统内置(Y是 N否)'; -comment on column sys_config.create_dept is '创建部门'; -comment on column sys_config.create_by is '创建者'; -comment on column sys_config.create_time is '创建时间'; -comment on column sys_config.update_by is '更新者'; -comment on column sys_config.update_time is '更新时间'; -comment on column sys_config.remark is '备注'; - -insert into sys_config values(1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, sysdate, null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); -insert into sys_config values(2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, sysdate, null, null, '初始化密码 123456' ); -insert into sys_config values(3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, sysdate, null, null, '深色主题theme-dark,浅色主题theme-light' ); -insert into sys_config values(5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, sysdate, null, null, '是否开启注册用户功能(true开启,false关闭)'); -insert into sys_config values(11, '000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, sysdate, null, null, 'true:开启, false:关闭'); - - --- ---------------------------- --- 14、系统访问记录 --- ---------------------------- -create table sys_logininfor ( - info_id number(20) not null, - tenant_id varchar2(20) default '000000', - user_name varchar2(50) default '', - ipaddr varchar2(128) default '', - login_location varchar2(255) default '', - browser varchar2(50) default '', - os varchar2(50) default '', - status char(1) default '0', - msg varchar2(255) default '', - login_time date -); - -alter table sys_logininfor add constraint pk_sys_logininfor primary key (info_id); -create index idx_sys_logininfor_s on sys_logininfor (status); -create index idx_sys_logininfor_lt on sys_logininfor (login_time); - -comment on table sys_logininfor is '系统访问记录'; -comment on column sys_logininfor.info_id is '访问ID'; -comment on column sys_logininfor.tenant_id is '租户编号'; -comment on column sys_logininfor.user_name is '登录账号'; -comment on column sys_logininfor.ipaddr is '登录IP地址'; -comment on column sys_logininfor.login_location is '登录地点'; -comment on column sys_logininfor.browser is '浏览器类型'; -comment on column sys_logininfor.os is '操作系统'; -comment on column sys_logininfor.status is '登录状态(0成功 1失败)'; -comment on column sys_logininfor.msg is '提示消息'; -comment on column sys_logininfor.login_time is '访问时间'; - - --- ---------------------------- --- 17、通知公告表 --- ---------------------------- -create table sys_notice ( - notice_id number(20) not null, - tenant_id varchar2(20) default '000000', - notice_title varchar2(50) not null, - notice_type char(1) not null, - notice_content clob default null, - status char(1) default '0', - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date, - remark varchar2(255) default null -); - -alter table sys_notice add constraint pk_sys_notice primary key (notice_id); - -comment on table sys_notice is '通知公告表'; -comment on column sys_notice.notice_id is '公告主键'; -comment on column sys_notice.tenant_id is '租户编号'; -comment on column sys_notice.notice_title is '公告标题'; -comment on column sys_notice.notice_type is '公告类型(1通知 2公告)'; -comment on column sys_notice.notice_content is '公告内容'; -comment on column sys_notice.status is '公告状态(0正常 1关闭)'; -comment on column sys_notice.create_dept is '创建部门'; -comment on column sys_notice.create_by is '创建者'; -comment on column sys_notice.create_time is '创建时间'; -comment on column sys_notice.update_by is '更新者'; -comment on column sys_notice.update_time is '更新时间'; -comment on column sys_notice.remark is '备注'; - --- ---------------------------- --- 初始化-公告信息表数据 --- ---------------------------- -insert into sys_notice values('1', '000000', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, sysdate, null, null, '管理员'); -insert into sys_notice values('2', '000000', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, sysdate, null, null, '管理员'); - - --- ---------------------------- --- 18、代码生成业务表 --- ---------------------------- -create table gen_table ( - table_id number(20) not null, - table_name varchar2(200) default '', - table_comment varchar2(500) default '', - sub_table_name varchar(64) default null, - sub_table_fk_name varchar(64) default null, - class_name varchar2(100) default '', - tpl_category varchar2(200) default 'crud', - package_name varchar2(100), - module_name varchar2(30), - business_name varchar2(30), - function_name varchar2(50), - function_author varchar2(50), - gen_type char(1) default '0', - gen_path varchar2(200) default '/', - options varchar2(1000), - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date, - remark varchar2(500) default null -); - -alter table gen_table add constraint pk_gen_table primary key (table_id); - -comment on table gen_table is '代码生成业务表'; -comment on column gen_table.table_id is '编号'; -comment on column gen_table.table_name is '表名称'; -comment on column gen_table.table_comment is '表描述'; -comment on column gen_table.sub_table_name is '关联子表的表名'; -comment on column gen_table.sub_table_fk_name is '子表关联的外键名'; -comment on column gen_table.class_name is '实体类名称'; -comment on column gen_table.tpl_category is '使用的模板(crud单表操作 tree树表操作)'; -comment on column gen_table.package_name is '生成包路径'; -comment on column gen_table.module_name is '生成模块名'; -comment on column gen_table.business_name is '生成业务名'; -comment on column gen_table.function_name is '生成功能名'; -comment on column gen_table.function_author is '生成功能作者'; -comment on column gen_table.gen_type is '生成代码方式(0zip压缩包 1自定义路径)'; -comment on column gen_table.gen_path is '生成路径(不填默认项目路径)'; -comment on column gen_table.options is '其它生成选项'; -comment on column gen_table.create_dept is '创建部门'; -comment on column gen_table.create_by is '创建者'; -comment on column gen_table.create_time is '创建时间'; -comment on column gen_table.update_by is '更新者'; -comment on column gen_table.update_time is '更新时间'; -comment on column gen_table.remark is '备注'; - - --- ---------------------------- --- 19、代码生成业务表字段 --- ---------------------------- -create table gen_table_column ( - column_id number(20) not null, - table_id number(20), - column_name varchar2(200), - column_comment varchar2(500), - column_type varchar2(100), - java_type varchar2(500), - java_field varchar2(200), - is_pk char(1), - is_increment char(1), - is_required char(1), - is_insert char(1), - is_edit char(1), - is_list char(1), - is_query char(1), - query_type varchar(200) default 'EQ', - html_type varchar(200), - dict_type varchar(200) default '', - sort number(4), - create_dept number(20) default null, - create_by number(20) default null, - create_time date , - update_by number(20) default null, - update_time date -); - -alter table gen_table_column add constraint pk_gen_table_column primary key (column_id); - -comment on table gen_table_column is '代码生成业务表字段'; -comment on column gen_table_column.column_id is '编号'; -comment on column gen_table_column.table_id is '归属表编号'; -comment on column gen_table_column.column_name is '列名称'; -comment on column gen_table_column.column_comment is '列描述'; -comment on column gen_table_column.column_type is '列类型'; -comment on column gen_table_column.java_type is 'JAVA类型'; -comment on column gen_table_column.java_field is 'JAVA字段名'; -comment on column gen_table_column.is_pk is '是否主键(1是)'; -comment on column gen_table_column.is_increment is '是否自增(1是)'; -comment on column gen_table_column.is_required is '是否必填(1是)'; -comment on column gen_table_column.is_insert is '是否为插入字段(1是)'; -comment on column gen_table_column.is_edit is '是否编辑字段(1是)'; -comment on column gen_table_column.is_list is '是否列表字段(1是)'; -comment on column gen_table_column.is_query is '是否查询字段(1是)'; -comment on column gen_table_column.query_type is '查询方式(等于、不等于、大于、小于、范围)'; -comment on column gen_table_column.html_type is '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)'; -comment on column gen_table_column.dict_type is '字典类型'; -comment on column gen_table_column.sort is '排序'; -comment on column gen_table_column.create_dept is '创建部门'; -comment on column gen_table_column.create_by is '创建者'; -comment on column gen_table_column.create_time is '创建时间'; -comment on column gen_table_column.update_by is '更新者'; -comment on column gen_table_column.update_time is '更新时间'; - - --- ---------------------------- --- OSS对象存储表 --- ---------------------------- -create table sys_oss ( - oss_id number(20) not null, - tenant_id varchar2(20) default '000000', - file_name varchar(255) not null, - original_name varchar(255) not null, - file_suffix varchar(10) not null, - url varchar(500) not null, - service varchar(20) default 'minio' not null, - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date -); - -alter table sys_oss add constraint pk_sys_oss primary key (oss_id); - -comment on table sys_oss is 'OSS对象存储表'; -comment on column sys_oss.oss_id is '对象存储主键'; -comment on column sys_oss.tenant_id is '租户编码'; -comment on column sys_oss.file_name is '文件名'; -comment on column sys_oss.original_name is '原名'; -comment on column sys_oss.file_suffix is '文件后缀名'; -comment on column sys_oss.url is 'URL地址'; -comment on column sys_oss.service is '服务商'; -comment on column sys_oss.create_dept is '创建部门'; -comment on column sys_oss.create_time is '创建时间'; -comment on column sys_oss.create_by is '上传者'; -comment on column sys_oss.update_time is '更新时间'; -comment on column sys_oss.update_by is '更新者'; - - --- ---------------------------- --- OSS对象存储动态配置表 --- ---------------------------- -create table sys_oss_config ( - oss_config_id number(20) not null, - tenant_id varchar2(20) default '000000', - config_key varchar(20) not null, - access_key varchar(255) default '', - secret_key varchar(255) default '', - bucket_name varchar(255) default '', - prefix varchar(255) default '', - endpoint varchar(255) default '', - domain varchar(255) default '', - is_https char(1) default 'N', - region varchar(255) default '', - access_policy char(1) default '1' not null, - status char(1) default '1', - ext1 varchar(255) default '', - remark varchar(500) default null, - create_dept number(20) default null, - create_by number(20) default null, - create_time date, - update_by number(20) default null, - update_time date -); - -alter table sys_oss_config add constraint pk_sys_oss_config primary key (oss_config_id); - -comment on table sys_oss_config is '对象存储配置表'; -comment on column sys_oss_config.oss_config_id is '主建'; -comment on column sys_oss_config.tenant_id is '租户编码'; -comment on column sys_oss_config.config_key is '配置key'; -comment on column sys_oss_config.access_key is 'accesskey'; -comment on column sys_oss_config.secret_key is '秘钥'; -comment on column sys_oss_config.bucket_name is '桶名称'; -comment on column sys_oss_config.prefix is '前缀'; -comment on column sys_oss_config.endpoint is '访问站点'; -comment on column sys_oss_config.domain is '自定义域名'; -comment on column sys_oss_config.is_https is '是否https(Y=是,N=否)'; -comment on column sys_oss_config.region is '域'; -comment on column sys_oss_config.access_policy is '桶权限类型(0=private 1=public 2=custom)'; -comment on column sys_oss_config.status is '是否默认(0=是,1=否)'; -comment on column sys_oss_config.ext1 is '扩展字段'; -comment on column sys_oss_config.remark is '备注'; -comment on column sys_oss_config.create_dept is '创建部门'; -comment on column sys_oss_config.create_by is '创建者'; -comment on column sys_oss_config.create_time is '创建时间'; -comment on column sys_oss_config.update_by is '更新者'; -comment on column sys_oss_config.update_time is '更新时间'; - -insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', NULL, 103, 1, sysdate, 1, sysdate); -insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); -insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); -insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); -insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', NULL, 103, 1, sysdate, 1, sysdate); - - --- ---------------------------- --- 钩子 ,用于session连接之后 自动设置默认的date类型格式化 简化时间查询 --- 如需设置其它配置 可在此钩子内任意增加处理语句 --- 例如: SELECT * FROM sys_user WHERE create_time BETWEEN '2022-03-01 00:00:00' AND '2022-04-01 00:00:00' --- ---------------------------- -create or replace trigger login_trg -after logon on database -begin -execute immediate 'alter session set nls_date_format=''YYYY-MM-DD HH24:MI:SS'''; -end; diff --git a/script/sql/oracle/oracle_test.sql b/script/sql/oracle/oracle_test.sql deleted file mode 100644 index fd93786d..00000000 --- a/script/sql/oracle/oracle_test.sql +++ /dev/null @@ -1,204 +0,0 @@ -create table test_demo ( - id number(20) not null, - tenant_id varchar2(20) default '000000', - dept_id number(20) default null, - user_id number(20) default null, - order_num number(10) default 0, - test_key varchar2(255) default null, - value varchar2(255) default null, - version number(10) default 0, - create_dept number(20) default null, - create_time date, - create_by number(20) default null, - update_time date, - update_by number(20) default null, - del_flag number(2) default 0 -); - -alter table test_demo add constraint pk_test_demo primary key (id); - -comment on table test_demo is '测试单表'; -comment on column test_demo.id is '主键'; -comment on column test_demo.tenant_id is '租户编号'; -comment on column test_demo.dept_id is '部门id'; -comment on column test_demo.user_id is '用户id'; -comment on column test_demo.order_num is '排序号'; -comment on column test_demo.test_key is 'key键'; -comment on column test_demo.value is '值'; -comment on column test_demo.version is '版本'; -comment on column test_demo.create_dept is '创建部门'; -comment on column test_demo.create_time is '创建时间'; -comment on column test_demo.create_by is '创建人'; -comment on column test_demo.update_time is '更新时间'; -comment on column test_demo.update_by is '更新人'; -comment on column test_demo.del_flag is '删除标志'; - -create table test_tree ( - id number(20) not null, - tenant_id varchar2(20) default '000000', - parent_id number(20) default 0, - dept_id number(20) default null, - user_id number(20) default null, - tree_name varchar2(255) default null, - version number(10) default 0, - create_dept number(20) default null, - create_time date, - create_by number(20) default null, - update_time date, - update_by number(20) default null, - del_flag number(2) default 0 -); - -alter table test_tree add constraint pk_test_tree primary key (id); - -comment on table test_tree is '测试树表'; -comment on column test_tree.id is '主键'; -comment on column test_tree.tenant_id is '租户编号'; -comment on column test_tree.parent_id is '父id'; -comment on column test_tree.dept_id is '部门id'; -comment on column test_tree.user_id is '用户id'; -comment on column test_tree.tree_name is '值'; -comment on column test_tree.version is '版本'; -comment on column test_tree.create_dept is '创建部门'; -comment on column test_tree.create_time is '创建时间'; -comment on column test_tree.create_by is '创建人'; -comment on column test_tree.update_time is '更新时间'; -comment on column test_tree.update_by is '更新人'; -comment on column test_tree.del_flag is '删除标志'; - -insert into sys_user(user_id, tenant_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_dept, create_by, create_time, update_by, update_time, remark) values (3, '000000', 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, 3, sysdate, null); -insert into sys_user(user_id, tenant_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_dept, create_by, create_time, update_by, update_time, remark) values (4, '000000', 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate, 103, 1, sysdate, 4, sysdate, 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 (5, '测试菜单', 0, 5, 'demo', null, 1, 0, 'M', '0', '0', null, 'star', 103, 1, sysdate, 1, sysdate, ''); - -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 (1500, '测试单表', 5, 1, 'demo', 'demo/demo/index', 1, 0, 'C', '0', '0', 'demo:demo:list', '#', 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 (1501, '测试单表查询', 1500, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:demo: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 (1502, '测试单表新增', 1500, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:demo: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 (1503, '测试单表修改', 1500, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:demo: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 (1504, '测试单表删除', 1500, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:demo: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 (1505, '测试单表导出', 1500, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:export', '#', 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 (1506, '测试树表', 5, 1, 'tree', 'demo/tree/index', 1, 0, 'C', '0', '0', 'demo:tree:list', '#', 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 (1507, '测试树表查询', 1506, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:tree: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 (1508, '测试树表新增', 1506, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:tree: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 (1509, '测试树表修改', 1506, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:tree: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 (1510, '测试树表删除', 1506, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:tree: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 (1511, '测试树表导出', 1506, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 103, 1, sysdate, null, null, ''); - -insert into sys_role(role_id, tenant_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_dept, create_by, create_time, update_by, update_time, remark) values (3, '000000', '本部门及以下', 'test1', 3, '4', 1, 1, '0', '0', 103, 1, sysdate, null, null, null); -insert into sys_role(role_id, tenant_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_dept, create_by, create_time, update_by, update_time, remark) values (4, '000000', '仅本人', 'test2', 4, '5', 1, 1, '0', '0', 103, 1, sysdate, null, null, null); - -insert into sys_role_menu(role_id, menu_id) values (3, 1); -insert into sys_role_menu(role_id, menu_id) values (3, 5); -insert into sys_role_menu(role_id, menu_id) values (3, 100); -insert into sys_role_menu(role_id, menu_id) values (3, 101); -insert into sys_role_menu(role_id, menu_id) values (3, 102); -insert into sys_role_menu(role_id, menu_id) values (3, 103); -insert into sys_role_menu(role_id, menu_id) values (3, 104); -insert into sys_role_menu(role_id, menu_id) values (3, 105); -insert into sys_role_menu(role_id, menu_id) values (3, 106); -insert into sys_role_menu(role_id, menu_id) values (3, 107); -insert into sys_role_menu(role_id, menu_id) values (3, 108); -insert into sys_role_menu(role_id, menu_id) values (3, 500); -insert into sys_role_menu(role_id, menu_id) values (3, 501); -insert into sys_role_menu(role_id, menu_id) values (3, 1001); -insert into sys_role_menu(role_id, menu_id) values (3, 1002); -insert into sys_role_menu(role_id, menu_id) values (3, 1003); -insert into sys_role_menu(role_id, menu_id) values (3, 1004); -insert into sys_role_menu(role_id, menu_id) values (3, 1005); -insert into sys_role_menu(role_id, menu_id) values (3, 1006); -insert into sys_role_menu(role_id, menu_id) values (3, 1007); -insert into sys_role_menu(role_id, menu_id) values (3, 1008); -insert into sys_role_menu(role_id, menu_id) values (3, 1009); -insert into sys_role_menu(role_id, menu_id) values (3, 1010); -insert into sys_role_menu(role_id, menu_id) values (3, 1011); -insert into sys_role_menu(role_id, menu_id) values (3, 1012); -insert into sys_role_menu(role_id, menu_id) values (3, 1013); -insert into sys_role_menu(role_id, menu_id) values (3, 1014); -insert into sys_role_menu(role_id, menu_id) values (3, 1015); -insert into sys_role_menu(role_id, menu_id) values (3, 1016); -insert into sys_role_menu(role_id, menu_id) values (3, 1017); -insert into sys_role_menu(role_id, menu_id) values (3, 1018); -insert into sys_role_menu(role_id, menu_id) values (3, 1019); -insert into sys_role_menu(role_id, menu_id) values (3, 1020); -insert into sys_role_menu(role_id, menu_id) values (3, 1021); -insert into sys_role_menu(role_id, menu_id) values (3, 1022); -insert into sys_role_menu(role_id, menu_id) values (3, 1023); -insert into sys_role_menu(role_id, menu_id) values (3, 1024); -insert into sys_role_menu(role_id, menu_id) values (3, 1025); -insert into sys_role_menu(role_id, menu_id) values (3, 1026); -insert into sys_role_menu(role_id, menu_id) values (3, 1027); -insert into sys_role_menu(role_id, menu_id) values (3, 1028); -insert into sys_role_menu(role_id, menu_id) values (3, 1029); -insert into sys_role_menu(role_id, menu_id) values (3, 1030); -insert into sys_role_menu(role_id, menu_id) values (3, 1031); -insert into sys_role_menu(role_id, menu_id) values (3, 1032); -insert into sys_role_menu(role_id, menu_id) values (3, 1033); -insert into sys_role_menu(role_id, menu_id) values (3, 1034); -insert into sys_role_menu(role_id, menu_id) values (3, 1035); -insert into sys_role_menu(role_id, menu_id) values (3, 1036); -insert into sys_role_menu(role_id, menu_id) values (3, 1037); -insert into sys_role_menu(role_id, menu_id) values (3, 1038); -insert into sys_role_menu(role_id, menu_id) values (3, 1039); -insert into sys_role_menu(role_id, menu_id) values (3, 1040); -insert into sys_role_menu(role_id, menu_id) values (3, 1041); -insert into sys_role_menu(role_id, menu_id) values (3, 1042); -insert into sys_role_menu(role_id, menu_id) values (3, 1043); -insert into sys_role_menu(role_id, menu_id) values (3, 1044); -insert into sys_role_menu(role_id, menu_id) values (3, 1045); -insert into sys_role_menu(role_id, menu_id) values (3, 1500); -insert into sys_role_menu(role_id, menu_id) values (3, 1501); -insert into sys_role_menu(role_id, menu_id) values (3, 1502); -insert into sys_role_menu(role_id, menu_id) values (3, 1503); -insert into sys_role_menu(role_id, menu_id) values (3, 1504); -insert into sys_role_menu(role_id, menu_id) values (3, 1505); -insert into sys_role_menu(role_id, menu_id) values (3, 1506); -insert into sys_role_menu(role_id, menu_id) values (3, 1507); -insert into sys_role_menu(role_id, menu_id) values (3, 1508); -insert into sys_role_menu(role_id, menu_id) values (3, 1509); -insert into sys_role_menu(role_id, menu_id) values (3, 1510); -insert into sys_role_menu(role_id, menu_id) values (3, 1511); -insert into sys_role_menu(role_id, menu_id) values (4, 5); -insert into sys_role_menu(role_id, menu_id) values (4, 1500); -insert into sys_role_menu(role_id, menu_id) values (4, 1501); -insert into sys_role_menu(role_id, menu_id) values (4, 1502); -insert into sys_role_menu(role_id, menu_id) values (4, 1503); -insert into sys_role_menu(role_id, menu_id) values (4, 1504); -insert into sys_role_menu(role_id, menu_id) values (4, 1505); -insert into sys_role_menu(role_id, menu_id) values (4, 1506); -insert into sys_role_menu(role_id, menu_id) values (4, 1507); -insert into sys_role_menu(role_id, menu_id) values (4, 1508); -insert into sys_role_menu(role_id, menu_id) values (4, 1509); -insert into sys_role_menu(role_id, menu_id) values (4, 1510); -insert into sys_role_menu(role_id, menu_id) values (4, 1511); - -insert into sys_user_role(user_id, role_id) values (3, 3); -insert into sys_user_role(user_id, role_id) values (4, 4); - -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (1, '000000', 102, 4, 1, '测试数据权限', '测试', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (2, '000000', 102, 3, 2, '子节点1', '111', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (3, '000000', 102, 3, 3, '子节点2', '222', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (4, '000000', 108, 4, 4, '测试数据', 'demo', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (5, '000000', 108, 3, 13, '子节点11', '1111', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (6, '000000', 108, 3, 12, '子节点22', '2222', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (7, '000000', 108, 3, 11, '子节点33', '3333', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (8, '000000', 108, 3, 10, '子节点44', '4444', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (9, '000000', 108, 3, 9, '子节点55', '5555', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (10, '000000', 108, 3, 8, '子节点66', '6666', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (11, '000000', 108, 3, 7, '子节点77', '7777', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (12, '000000', 108, 3, 6, '子节点88', '8888', 0, 103, sysdate, 1, null, null, 0); -insert into test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (13, '000000', 108, 3, 5, '子节点99', '9999', 0, 103, sysdate, 1, null, null, 0); - -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (1, '000000', 0, 102, 4, '测试数据权限', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (2, '000000', 1, 102, 3, '子节点1', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (3, '000000', 2, 102, 3, '子节点2', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (4, '000000', 0, 108, 4, '测试树1', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (5, '000000', 4, 108, 3, '子节点11', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (6, '000000', 4, 108, 3, '子节点22', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (7, '000000', 4, 108, 3, '子节点33', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (8, '000000', 5, 108, 3, '子节点44', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (9, '000000', 6, 108, 3, '子节点55', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (10, '000000', 7, 108, 3, '子节点66', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (11, '000000', 7, 108, 3, '子节点77', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (12, '000000', 10, 108, 3, '子节点88', 0, 103, sysdate, 1, null, null, 0); -insert into test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) values (13, '000000', 10, 108, 3, '子节点99', 0, 103, sysdate, 1, null, null, 0); diff --git a/script/sql/postgres/postgres_ry_vue_5.X.sql b/script/sql/postgres/postgres_ry_vue_5.X.sql deleted file mode 100644 index bdf28b49..00000000 --- a/script/sql/postgres/postgres_ry_vue_5.X.sql +++ /dev/null @@ -1,1138 +0,0 @@ --- ---------------------------- --- 租户表 --- ---------------------------- -drop table if exists sys_tenant; -create table if not exists sys_tenant -( - id int8, - tenant_id varchar(20) not null, - contact_user_name varchar(20) default null::varchar, - contact_phone varchar(20) default null::varchar, - company_name varchar(50) default null::varchar, - license_number varchar(30) default null::varchar, - address varchar(200) default null::varchar, - intro varchar(200) default null::varchar, - domain varchar(200) default null::varchar, - remark varchar(200) default null::varchar, - package_id int8, - expire_time timestamp, - account_count int4 default -1, - status char default '0'::bpchar, - del_flag char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - constraint "pk_sys_tenant" primary key (id) -); - - -comment on table sys_tenant is '租户表'; -comment on column sys_tenant.tenant_id is '租户编号'; -comment on column sys_tenant.contact_phone is '联系电话'; -comment on column sys_tenant.company_name is '企业名称'; -comment on column sys_tenant.company_name is '联系人'; -comment on column sys_tenant.license_number is '统一社会信用代码'; -comment on column sys_tenant.address is '地址'; -comment on column sys_tenant.intro is '企业简介'; -comment on column sys_tenant.domain is '域名'; -comment on column sys_tenant.remark is '备注'; -comment on column sys_tenant.package_id is '租户套餐编号'; -comment on column sys_tenant.expire_time is '过期时间'; -comment on column sys_tenant.account_count is '用户数量(-1不限制)'; -comment on column sys_tenant.status is '租户状态(0正常 1停用)'; -comment on column sys_tenant.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_tenant.create_dept is '创建部门'; -comment on column sys_tenant.create_by is '创建者'; -comment on column sys_tenant.create_time is '创建时间'; -comment on column sys_tenant.update_by is '更新者'; -comment on column sys_tenant.update_time is '更新时间'; - - --- ---------------------------- --- 初始化-租户表数据 --- ---------------------------- - -insert into sys_tenant values(1, '000000', '管理组', '15888888888', 'XXX有限公司', null, null, '多租户通用后台管理管理系统', null, null, null, null, -1, '0', '0', 103, 1, now(), null, null); - - --- ---------------------------- --- 租户套餐表 --- ---------------------------- -drop table if exists sys_tenant_package; -create table if not exists sys_tenant_package -( - package_id int8, - package_name varchar(20) default ''::varchar, - menu_ids varchar(3000) default ''::varchar, - remark varchar(200) default ''::varchar, - menu_check_strictly bool default true, - status char default '0'::bpchar, - del_flag char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - constraint "pk_sys_tenant_package" primary key (package_id) -); - - -comment on table sys_tenant_package is '租户套餐表'; -comment on column sys_tenant_package.package_id is '租户套餐id'; -comment on column sys_tenant_package.package_name is '套餐名称'; -comment on column sys_tenant_package.menu_ids is '关联菜单id'; -comment on column sys_tenant_package.remark is '备注'; -comment on column sys_tenant_package.status is '状态(0正常 1停用)'; -comment on column sys_tenant_package.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_tenant_package.create_dept is '创建部门'; -comment on column sys_tenant_package.create_by is '创建者'; -comment on column sys_tenant_package.create_time is '创建时间'; -comment on column sys_tenant_package.update_by is '更新者'; -comment on column sys_tenant_package.update_time is '更新时间'; - - --- ---------------------------- --- 1、部门表 --- ---------------------------- -drop table if exists sys_dept; -create table if not exists sys_dept -( - dept_id int8, - tenant_id varchar(20) default '000000'::varchar, - parent_id int8 default 0, - ancestors varchar(500)default ''::varchar, - dept_name varchar(30) default ''::varchar, - order_num int4 default 0, - leader varchar(20) default null::varchar, - phone varchar(11) default null::varchar, - email varchar(50) default null::varchar, - status char default '0'::bpchar, - del_flag char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - constraint "sys_dept_pk" primary key (dept_id) -); - -comment on table sys_dept is '部门表'; -comment on column sys_dept.dept_id is '部门ID'; -comment on column sys_dept.tenant_id is '租户编号'; -comment on column sys_dept.parent_id is '父部门ID'; -comment on column sys_dept.ancestors is '祖级列表'; -comment on column sys_dept.dept_name is '部门名称'; -comment on column sys_dept.order_num is '显示顺序'; -comment on column sys_dept.leader is '负责人'; -comment on column sys_dept.phone is '联系电话'; -comment on column sys_dept.email is '邮箱'; -comment on column sys_dept.status is '部门状态(0正常 1停用)'; -comment on column sys_dept.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_dept.create_dept is '创建部门'; -comment on column sys_dept.create_by is '创建者'; -comment on column sys_dept.create_time is '创建时间'; -comment on column sys_dept.update_by is '更新者'; -comment on column sys_dept.update_time is '更新时间'; - --- ---------------------------- --- 初始化-部门表数据 --- ---------------------------- -insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); -insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); - --- ---------------------------- --- 2、用户信息表 --- ---------------------------- -drop table if exists sys_user; -create table if not exists sys_user -( - user_id int8, - tenant_id varchar(20) default '000000'::varchar, - dept_id int8, - user_name varchar(30) not null, - nick_name varchar(30) not null, - user_type varchar(10) default 'sys_user'::varchar, - email varchar(50) default ''::varchar, - phonenumber varchar(11) default ''::varchar, - sex char default '0'::bpchar, - avatar int8, - password varchar(100) default ''::varchar, - status char default '0'::bpchar, - del_flag char default '0'::bpchar, - login_ip varchar(128) default ''::varchar, - login_date timestamp, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default null::varchar, - constraint "sys_user_pk" primary key (user_id) -); - -comment on table sys_user is '用户信息表'; -comment on column sys_user.user_id is '用户ID'; -comment on column sys_user.tenant_id is '租户编号'; -comment on column sys_user.dept_id is '部门ID'; -comment on column sys_user.user_name is '用户账号'; -comment on column sys_user.nick_name is '用户昵称'; -comment on column sys_user.user_type is '用户类型(sys_user系统用户)'; -comment on column sys_user.email is '用户邮箱'; -comment on column sys_user.phonenumber is '手机号码'; -comment on column sys_user.sex is '用户性别(0男 1女 2未知)'; -comment on column sys_user.avatar is '头像地址'; -comment on column sys_user.password is '密码'; -comment on column sys_user.status is '帐号状态(0正常 1停用)'; -comment on column sys_user.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_user.login_ip is '最后登陆IP'; -comment on column sys_user.login_date is '最后登陆时间'; -comment on column sys_user.create_dept is '创建部门'; -comment on column sys_user.create_by is '创建者'; -comment on column sys_user.create_time is '创建时间'; -comment on column sys_user.update_by is '更新者'; -comment on column sys_user.update_time is '更新时间'; -comment on column sys_user.remark is '备注'; - --- ---------------------------- - --- 初始化-用户信息表数据 --- ---------------------------- -insert into sys_user values(1, '000000', 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', now(), 103, 1, now(), null, null, '管理员'); -insert into sys_user values(2, '000000', 105, 'lionli', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@qq.com', '15666666666', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', now(), 103, 1, now(), null, null, '测试员'); - - --- ---------------------------- --- 3、岗位信息表 --- ---------------------------- -drop table if exists sys_post; -create table if not exists sys_post -( - post_id int8, - tenant_id varchar(20) default '000000'::varchar, - post_code varchar(64) not null, - post_name varchar(50) not null, - post_sort int4 not null, - status char not null, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default null::varchar, - constraint "sys_post_pk" primary key (post_id) -); - -comment on table sys_post is '岗位信息表'; -comment on column sys_post.post_id is '岗位ID'; -comment on column sys_post.tenant_id is '租户编号'; -comment on column sys_post.post_code is '岗位编码'; -comment on column sys_post.post_name is '岗位名称'; -comment on column sys_post.post_sort is '显示顺序'; -comment on column sys_post.status is '状态(0正常 1停用)'; -comment on column sys_post.create_dept is '创建部门'; -comment on column sys_post.create_by is '创建者'; -comment on column sys_post.create_time is '创建时间'; -comment on column sys_post.update_by is '更新者'; -comment on column sys_post.update_time is '更新时间'; -comment on column sys_post.remark is '备注'; - --- ---------------------------- --- 初始化-岗位信息表数据 --- ---------------------------- -insert into sys_post values(1, '000000', 'ceo', '董事长', 1, '0', 103, 1, now(), null, null, ''); -insert into sys_post values(2, '000000', 'se', '项目经理', 2, '0', 103, 1, now(), null, null, ''); -insert into sys_post values(3, '000000', 'hr', '人力资源', 3, '0', 103, 1, now(), null, null, ''); -insert into sys_post values(4, '000000', 'user', '普通员工', 4, '0', 103, 1, now(), null, null, ''); - --- ---------------------------- --- 4、角色信息表 --- ---------------------------- -drop table if exists sys_role; -create table if not exists sys_role -( - role_id int8, - tenant_id varchar(20) default '000000'::varchar, - role_name varchar(30) not null, - role_key varchar(100) not null, - role_sort int4 not null, - data_scope char default '1'::bpchar, - menu_check_strictly bool default true, - dept_check_strictly bool default true, - status char not null, - del_flag char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default null::varchar, - constraint "sys_role_pk" primary key (role_id) -); - -comment on table sys_role is '角色信息表'; -comment on column sys_role.role_id is '角色ID'; -comment on column sys_role.tenant_id is '租户编号'; -comment on column sys_role.role_name is '角色名称'; -comment on column sys_role.role_key is '角色权限字符串'; -comment on column sys_role.role_sort is '显示顺序'; -comment on column sys_role.data_scope is '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)'; -comment on column sys_role.menu_check_strictly is '菜单树选择项是否关联显示'; -comment on column sys_role.dept_check_strictly is '部门树选择项是否关联显示'; -comment on column sys_role.status is '角色状态(0正常 1停用)'; -comment on column sys_role.del_flag is '删除标志(0代表存在 2代表删除)'; -comment on column sys_role.create_dept is '创建部门'; -comment on column sys_role.create_by is '创建者'; -comment on column sys_role.create_time is '创建时间'; -comment on column sys_role.update_by is '更新者'; -comment on column sys_role.update_time is '更新时间'; -comment on column sys_role.remark is '备注'; - --- ---------------------------- --- 初始化-角色信息表数据 --- ---------------------------- -insert into sys_role values('1', '000000', '超级管理员', 'superadmin', 1, '1', 't', 't', '0', '0', 103, 1, now(), null, null, '超级管理员'); -insert into sys_role values('2', '000000', '普通角色', 'common', 2, '2', 't', 't', '0', '0', 103, 1, now(), null, null, '普通角色'); - - --- ---------------------------- --- 5、菜单权限表 --- ---------------------------- -drop table if exists sys_menu; -create table if not exists sys_menu -( - menu_id int8, - menu_name varchar(50) not null, - parent_id int8 default 0, - order_num int4 default 0, - path varchar(200) default ''::varchar, - component varchar(255) default null::varchar, - query_param varchar(255) default null::varchar, - is_frame char default '1'::bpchar, - is_cache char default '0'::bpchar, - menu_type char default ''::bpchar, - visible char default '0'::bpchar, - status char default '0'::bpchar, - perms varchar(100) default null::varchar, - icon varchar(100) default '#'::varchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default ''::varchar, - constraint "sys_menu_pk" primary key (menu_id) -); - -comment on table sys_menu is '菜单权限表'; -comment on column sys_menu.menu_id is '菜单ID'; -comment on column sys_menu.menu_name is '菜单名称'; -comment on column sys_menu.parent_id is '父菜单ID'; -comment on column sys_menu.order_num is '显示顺序'; -comment on column sys_menu.path is '路由地址'; -comment on column sys_menu.component is '组件路径'; -comment on column sys_menu.query_param is '路由参数'; -comment on column sys_menu.is_frame is '是否为外链(0是 1否)'; -comment on column sys_menu.is_cache is '是否缓存(0缓存 1不缓存)'; -comment on column sys_menu.menu_type is '菜单类型(M目录 C菜单 F按钮)'; -comment on column sys_menu.visible is '显示状态(0显示 1隐藏)'; -comment on column sys_menu.status is '菜单状态(0正常 1停用)'; -comment on column sys_menu.perms is '权限标识'; -comment on column sys_menu.icon is '菜单图标'; -comment on column sys_menu.create_dept is '创建部门'; -comment on column sys_menu.create_by is '创建者'; -comment on column sys_menu.create_time is '创建时间'; -comment on column sys_menu.update_by is '更新者'; -comment on column sys_menu.update_time is '更新时间'; -comment on column sys_menu.remark is '备注'; - --- ---------------------------- --- 初始化-菜单信息表数据 --- ---------------------------- --- 一级菜单 -insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', '1', '0', 'M', '0', '0', '', 'system', 103, 1, now(), null, null, '系统管理目录'); -insert into sys_menu values('6', '系统管理', '0', '2', 'tenant', null, '', '1', '0', 'M', '0', '0', '', 'chart', 103, 1, now(), null, null, '租户管理目录'); -insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', '1', '0', 'M', '0', '0', '', 'monitor', 103, 1, now(), null, null, '系统监控目录'); -insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', '1', '0', 'M', '0', '0', '', 'tool', 103, 1, now(), null, null, '系统工具目录'); -insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', '0', '0', 'M', '0', '0', '', 'guide', 103, 1, now(), null, null, 'RuoYi-Vue-Plus官网地址'); --- 二级菜单 -insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', '1', '0', 'C', '0', '0', 'system:user:list', 'user', 103, 1, now(), null, null, '用户管理菜单'); -insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', '1', '0', 'C', '0', '0', 'system:role:list', 'peoples', 103, 1, now(), null, null, '角色管理菜单'); -insert into sys_menu values('102', '菜单管理', '1', '3', 'menu', 'system/menu/index', '', '1', '0', 'C', '0', '0', 'system:menu:list', 'tree-table', 103, 1, now(), null, null, '菜单管理菜单'); -insert into sys_menu values('103', '部门管理', '1', '4', 'dept', 'system/dept/index', '', '1', '0', 'C', '0', '0', 'system:dept:list', 'tree', 103, 1, now(), null, null, '部门管理菜单'); -insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 'system/post/index', '', '1', '0', 'C', '0', '0', 'system:post:list', 'post', 103, 1, now(), null, null, '岗位管理菜单'); -insert into sys_menu values('105', '字典管理', '1', '6', 'dict', 'system/dict/index', '', '1', '0', 'C', '0', '0', 'system:dict:list', 'dict', 103, 1, now(), null, null, '字典管理菜单'); -insert into sys_menu values('106', '参数设置', '1', '7', 'config', 'system/config/index', '', '1', '0', 'C', '0', '0', 'system:config:list', 'edit', 103, 1, now(), null, null, '参数设置菜单'); -insert into sys_menu values('107', '通知公告', '1', '8', 'notice', 'system/notice/index', '', '1', '0', 'C', '0', '0', 'system:notice:list', 'message', 103, 1, now(), null, null, '通知公告菜单'); -insert into sys_menu values('108', '日志管理', '1', '9', 'log', '', '', '1', '0', 'M', '0', '0', '', 'log', 103, 1, now(), null, null, '日志管理菜单'); -insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', '1', '0', 'C', '0', '0', 'monitor:online:list', 'online', 103, 1, now(), null, null, '在线用户菜单'); -insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', '1', '0', 'C', '0', '0', 'monitor:cache:list', 'redis', 103, 1, now(), null, null, '缓存监控菜单'); -insert into sys_menu values('114', '表单构建', '3', '1', 'build', 'tool/build/index', '', '1', '0', 'C', '0', '0', 'tool:build:list', 'build', 103, 1, now(), null, null, '表单构建菜单'); -insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', '1', '0', 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, now(), null, null, '代码生成菜单'); -insert into sys_menu values('121', '租户管理', '6', '1', 'tenant', 'system/tenant/index', '', '1', '0', 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, now(), null, null, '租户管理菜单'); -insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', '1', '0', 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, now(), null, null, '租户套餐管理菜单'); - --- springboot-admin监控 -insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', '1', '0', 'C', '0', '0', 'monitor:admin:list', 'dashboard', 103, 1, now(), null, null, 'Admin监控菜单'); --- oss菜单 -insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', '1', '0', 'C', '0', '0', 'system:oss:list', 'upload', 103, 1, now(), null, null, '文件管理菜单'); --- xxl-job-admin控制台 -insert into sys_menu values('120', '任务调度中心', '2', '5', 'XxlJob', 'monitor/xxljob/index', '', '1', '0', 'C', '0', '0', 'monitor:xxljob:list', 'job', 103, 1, now(), null, null, 'Xxl-Job控制台菜单'); - --- 三级菜单 -insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', '1', '0', 'C', '0', '0', 'monitor:operlog:list', 'form', 103, 1, now(), null, null, '操作日志菜单'); -insert into sys_menu values('501', '登录日志', '108', '2', 'logininfor', 'monitor/logininfor/index', '', '1', '0', 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 103, 1, now(), null, null, '登录日志菜单'); --- 用户管理按钮 -insert into sys_menu values('1001', '用户查询', '100', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:user:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1002', '用户新增', '100', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:user:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1003', '用户修改', '100', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:user:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1004', '用户删除', '100', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:user:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1005', '用户导出', '100', '5', '', '', '', '1', '0', 'F', '0', '0', 'system:user:export', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1006', '用户导入', '100', '6', '', '', '', '1', '0', 'F', '0', '0', 'system:user:import', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1007', '重置密码', '100', '7', '', '', '', '1', '0', 'F', '0', '0', 'system:user:resetPwd', '#', 103, 1, now(), null, null, ''); --- 角色管理按钮 -insert into sys_menu values('1008', '角色查询', '101', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:role:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1009', '角色新增', '101', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:role:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1010', '角色修改', '101', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:role:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1011', '角色删除', '101', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:role:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1012', '角色导出', '101', '5', '', '', '', '1', '0', 'F', '0', '0', 'system:role:export', '#', 103, 1, now(), null, null, ''); --- 菜单管理按钮 -insert into sys_menu values('1013', '菜单查询', '102', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:menu:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1014', '菜单新增', '102', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:menu:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1015', '菜单修改', '102', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:menu:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1016', '菜单删除', '102', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:menu:remove', '#', 103, 1, now(), null, null, ''); --- 部门管理按钮 -insert into sys_menu values('1017', '部门查询', '103', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:dept:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1018', '部门新增', '103', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:dept:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1019', '部门修改', '103', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:dept:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1020', '部门删除', '103', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:dept:remove', '#', 103, 1, now(), null, null, ''); --- 岗位管理按钮 -insert into sys_menu values('1021', '岗位查询', '104', '1', '', '', '', '1', '0', 'F', '0', '0', 'system:post:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1022', '岗位新增', '104', '2', '', '', '', '1', '0', 'F', '0', '0', 'system:post:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1023', '岗位修改', '104', '3', '', '', '', '1', '0', 'F', '0', '0', 'system:post:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1024', '岗位删除', '104', '4', '', '', '', '1', '0', 'F', '0', '0', 'system:post:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1025', '岗位导出', '104', '5', '', '', '', '1', '0', 'F', '0', '0', 'system:post:export', '#', 103, 1, now(), null, null, ''); --- 字典管理按钮 -insert into sys_menu values('1026', '字典查询', '105', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1027', '字典新增', '105', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1028', '字典修改', '105', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1029', '字典删除', '105', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1030', '字典导出', '105', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:dict:export', '#', 103, 1, now(), null, null, ''); --- 参数设置按钮 -insert into sys_menu values('1031', '参数查询', '106', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:config:export', '#', 103, 1, now(), null, null, ''); --- 通知公告按钮 -insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:notice:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:notice:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:notice:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:notice:remove', '#', 103, 1, now(), null, null, ''); --- 操作日志按钮 -insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:operlog:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:operlog:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:operlog:export', '#', 103, 1, now(), null, null, ''); --- 登录日志按钮 -insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:export', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1050', '账户解锁', '501', '4', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:unlock', '#', 103, 1, now(), null, null, ''); --- 在线用户按钮 -insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:online:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:online:batchLogout', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:online:forceLogout', '#', 103, 1, now(), null, null, ''); --- 代码生成按钮 -insert into sys_menu values('1055', '生成查询', '115', '1', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1057', '生成删除', '115', '3', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1058', '导入代码', '115', '2', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:import', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1059', '预览代码', '115', '4', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:preview', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1060', '生成代码', '115', '5', '#', '', '', '1', '0', 'F', '0', '0', 'tool:gen:code', '#', 103, 1, now(), null, null, ''); --- oss相关按钮 -insert into sys_menu values('1600', '文件查询', '118', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1601', '文件上传', '118', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:upload', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1602', '文件下载', '118', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:download', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1603', '文件删除', '118', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1604', '配置添加', '118', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1605', '配置编辑', '118', '6', '#', '', '', '1', '0', 'F', '0', '0', 'system:oss:edit', '#', 103, 1, now(), null, null, ''); --- 租户管理相关按钮 -insert into sys_menu values('1606', '租户查询', '121', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1607', '租户新增', '121', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1608', '租户修改', '121', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1609', '租户删除', '121', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1610', '租户导出', '121', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenant:export', '#', 103, 1, now(), null, null, ''); --- 租户套餐管理相关按钮 -insert into sys_menu values('1611', '租户套餐查询', '122', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:query', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1612', '租户套餐新增', '122', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:add', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1613', '租户套餐修改', '122', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:edit', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1614', '租户套餐删除', '122', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:remove', '#', 103, 1, now(), null, null, ''); -insert into sys_menu values('1615', '租户套餐导出', '122', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:export', '#', 103, 1, now(), null, null, ''); - - --- ---------------------------- --- 6、用户和角色关联表 用户N-1角色 --- ---------------------------- -drop table if exists sys_user_role; -create table if not exists sys_user_role -( - user_id int8 not null, - role_id int8 not null, - constraint sys_user_role_pk primary key (user_id, role_id) -); - -comment on table sys_user_role is '用户和角色关联表'; -comment on column sys_user_role.user_id is '用户ID'; -comment on column sys_user_role.role_id is '角色ID'; - --- ---------------------------- --- 初始化-用户和角色关联表数据 --- ---------------------------- -insert into sys_user_role values ('1', '1'); -insert into sys_user_role values ('2', '2'); - - --- ---------------------------- --- 7、角色和菜单关联表 角色1-N菜单 --- ---------------------------- -drop table if exists sys_role_menu; -create table if not exists sys_role_menu -( - role_id int8 not null, - menu_id int8 not null, - constraint sys_role_menu_pk primary key (role_id, menu_id) -); - -comment on table sys_role_menu is '角色和菜单关联表'; -comment on column sys_role_menu.role_id is '角色ID'; -comment on column sys_role_menu.menu_id is '菜单ID'; - --- ---------------------------- --- 初始化-角色和菜单关联表数据 --- ---------------------------- -insert into sys_role_menu values ('2', '1'); -insert into sys_role_menu values ('2', '2'); -insert into sys_role_menu values ('2', '3'); -insert into sys_role_menu values ('2', '4'); -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', '109'); -insert into sys_role_menu values ('2', '110'); -insert into sys_role_menu values ('2', '111'); -insert into sys_role_menu values ('2', '112'); -insert into sys_role_menu values ('2', '113'); -insert into sys_role_menu values ('2', '114'); -insert into sys_role_menu values ('2', '115'); -insert into sys_role_menu values ('2', '116'); -insert into sys_role_menu values ('2', '500'); -insert into sys_role_menu values ('2', '501'); -insert into sys_role_menu values ('2', '1000'); -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', '1046'); -insert into sys_role_menu values ('2', '1047'); -insert into sys_role_menu values ('2', '1048'); -insert into sys_role_menu values ('2', '1055'); -insert into sys_role_menu values ('2', '1056'); -insert into sys_role_menu values ('2', '1057'); -insert into sys_role_menu values ('2', '1058'); -insert into sys_role_menu values ('2', '1059'); -insert into sys_role_menu values ('2', '1060'); - --- ---------------------------- --- 8、角色和部门关联表 角色1-N部门 --- ---------------------------- -drop table if exists sys_role_dept; -create table if not exists sys_role_dept -( - role_id int8 not null, - dept_id int8 not null, - constraint sys_role_dept_pk primary key (role_id, dept_id) -); - -comment on table sys_role_dept is '角色和部门关联表'; -comment on column sys_role_dept.role_id is '角色ID'; -comment on column sys_role_dept.dept_id is '部门ID'; - --- ---------------------------- --- 初始化-角色和部门关联表数据 --- ---------------------------- -insert into sys_role_dept values ('2', '100'); -insert into sys_role_dept values ('2', '101'); -insert into sys_role_dept values ('2', '105'); - - --- ---------------------------- --- 9、用户与岗位关联表 用户1-N岗位 --- ---------------------------- -drop table if exists sys_user_post; -create table if not exists sys_user_post -( - user_id int8 not null, - post_id int8 not null, - constraint sys_user_post_pk primary key (user_id, post_id) -); - -comment on table sys_user_post is '用户与岗位关联表'; -comment on column sys_user_post.user_id is '用户ID'; -comment on column sys_user_post.post_id is '岗位ID'; - --- ---------------------------- --- 初始化-用户与岗位关联表数据 --- ---------------------------- -insert into sys_user_post values ('1', '1'); -insert into sys_user_post values ('2', '2'); - - --- ---------------------------- --- 10、操作日志记录 --- ---------------------------- -drop table if exists sys_oper_log; -create table if not exists sys_oper_log -( - oper_id int8, - tenant_id varchar(20) default '000000'::varchar, - title varchar(50) default ''::varchar, - business_type int4 default 0, - method varchar(100) default ''::varchar, - request_method varchar(10) default ''::varchar, - operator_type int4 default 0, - oper_name varchar(50) default ''::varchar, - dept_name varchar(50) default ''::varchar, - oper_url varchar(255) default ''::varchar, - oper_ip varchar(128) default ''::varchar, - oper_location varchar(255) default ''::varchar, - oper_param varchar(2000) default ''::varchar, - json_result varchar(2000) default ''::varchar, - status int4 default 0, - error_msg varchar(2000) default ''::varchar, - oper_time timestamp, - cost_time int8 default 0, - constraint sys_oper_log_pk primary key (oper_id) -); - -create index idx_sys_oper_log_bt ON sys_oper_log (business_type); -create index idx_sys_oper_log_s ON sys_oper_log (status); -create index idx_sys_oper_log_ot ON sys_oper_log (oper_time); - -comment on table sys_oper_log is '操作日志记录'; -comment on column sys_oper_log.oper_id is '日志主键'; -comment on column sys_oper_log.tenant_id is '租户编号'; -comment on column sys_oper_log.title is '模块标题'; -comment on column sys_oper_log.business_type is '业务类型(0其它 1新增 2修改 3删除)'; -comment on column sys_oper_log.method is '方法名称'; -comment on column sys_oper_log.request_method is '请求方式'; -comment on column sys_oper_log.operator_type is '操作类别(0其它 1后台用户 2手机端用户)'; -comment on column sys_oper_log.oper_name is '操作人员'; -comment on column sys_oper_log.dept_name is '部门名称'; -comment on column sys_oper_log.oper_url is '请求URL'; -comment on column sys_oper_log.oper_ip is '主机地址'; -comment on column sys_oper_log.oper_location is '操作地点'; -comment on column sys_oper_log.oper_param is '请求参数'; -comment on column sys_oper_log.json_result is '返回参数'; -comment on column sys_oper_log.status is '操作状态(0正常 1异常)'; -comment on column sys_oper_log.error_msg is '错误消息'; -comment on column sys_oper_log.oper_time is '操作时间'; -comment on column sys_oper_log.cost_time is '消耗时间'; - --- ---------------------------- --- 11、字典类型表 --- ---------------------------- -drop table if exists sys_dict_type; -create table if not exists sys_dict_type -( - dict_id int8, - tenant_id varchar(20) default '000000'::varchar, - dict_name varchar(100) default ''::varchar, - dict_type varchar(100) default ''::varchar, - status char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default null::varchar, - constraint sys_dict_type_pk primary key (dict_id) -); - -create unique index sys_dict_type_index1 ON sys_dict_type (tenant_id, dict_type); - -comment on table sys_dict_type is '字典类型表'; -comment on column sys_dict_type.dict_id is '字典主键'; -comment on column sys_dict_type.tenant_id is '租户编号'; -comment on column sys_dict_type.dict_name is '字典名称'; -comment on column sys_dict_type.dict_type is '字典类型'; -comment on column sys_dict_type.status is '状态(0正常 1停用)'; -comment on column sys_dict_type.create_dept is '创建部门'; -comment on column sys_dict_type.create_by is '创建者'; -comment on column sys_dict_type.create_time is '创建时间'; -comment on column sys_dict_type.update_by is '更新者'; -comment on column sys_dict_type.update_time is '更新时间'; -comment on column sys_dict_type.remark is '备注'; - -insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', '0', 103, 1, now(), null, null, '用户性别列表'); -insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', '0', 103, 1, now(), null, null, '菜单状态列表'); -insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', '0', 103, 1, now(), null, null, '系统开关列表'); -insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', '0', 103, 1, now(), null, null, '系统是否列表'); -insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', '0', 103, 1, now(), null, null, '通知类型列表'); -insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', '0', 103, 1, now(), null, null, '通知状态列表'); -insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', '0', 103, 1, now(), null, null, '操作类型列表'); -insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', '0', 103, 1, now(), null, null, '登录状态列表'); - - --- ---------------------------- --- 12、字典数据表 --- ---------------------------- -drop table if exists sys_dict_data; -create table if not exists sys_dict_data -( - dict_code int8, - tenant_id varchar(20) default '000000'::varchar, - dict_sort int4 default 0, - dict_label varchar(100) default ''::varchar, - dict_value varchar(100) default ''::varchar, - dict_type varchar(100) default ''::varchar, - css_class varchar(100) default null::varchar, - list_class varchar(100) default null::varchar, - is_default char default 'N'::bpchar, - status char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default null::varchar, - constraint sys_dict_data_pk primary key (dict_code) -); - -comment on table sys_dict_data is '字典数据表'; -comment on column sys_dict_data.dict_code is '字典编码'; -comment on column sys_dict_type.tenant_id is '租户编号'; -comment on column sys_dict_data.dict_sort is '字典排序'; -comment on column sys_dict_data.dict_label is '字典标签'; -comment on column sys_dict_data.dict_value is '字典键值'; -comment on column sys_dict_data.dict_type is '字典类型'; -comment on column sys_dict_data.css_class is '样式属性(其他样式扩展)'; -comment on column sys_dict_data.list_class is '表格回显样式'; -comment on column sys_dict_data.is_default is '是否默认(Y是 N否)'; -comment on column sys_dict_data.status is '状态(0正常 1停用)'; -comment on column sys_dict_data.create_dept is '创建部门'; -comment on column sys_dict_data.create_by is '创建者'; -comment on column sys_dict_data.create_time is '创建时间'; -comment on column sys_dict_data.update_by is '更新者'; -comment on column sys_dict_data.update_time is '更新时间'; -comment on column sys_dict_data.remark is '备注'; - -insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 103, 1, now(), null, null, '性别男'); -insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 103, 1, now(), null, null, '性别女'); -insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 103, 1, now(), null, null, '性别未知'); -insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 103, 1, now(), null, null, '显示菜单'); -insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 103, 1, now(), null, null, '隐藏菜单'); -insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 103, 1, now(), null, null, '停用状态'); -insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 103, 1, now(), null, null, '系统默认是'); -insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 103, 1, now(), null, null, '系统默认否'); -insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 103, 1, now(), null, null, '通知'); -insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 103, 1, now(), null, null, '公告'); -insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 103, 1, now(), null, null, '关闭状态'); -insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, now(), null, null, '其他操作'); -insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, now(), null, null, '新增操作'); -insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, now(), null, null, '修改操作'); -insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, now(), null, null, '删除操作'); -insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 103, 1, now(), null, null, '授权操作'); -insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, now(), null, null, '导出操作'); -insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, now(), null, null, '导入操作'); -insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, now(), null, null, '强退操作'); -insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, now(), null, null, '生成操作'); -insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, now(), null, null, '清空操作'); -insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 103, 1, now(), null, null, '正常状态'); -insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 103, 1, now(), null, null, '停用状态'); - - --- ---------------------------- --- 13、参数配置表 --- ---------------------------- -drop table if exists sys_config; -create table if not exists sys_config -( - config_id int8, - tenant_id varchar(20) default '000000'::varchar, - config_name varchar(100) default ''::varchar, - config_key varchar(100) default ''::varchar, - config_value varchar(500) default ''::varchar, - config_type char default 'N'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default null::varchar, - constraint sys_config_pk primary key (config_id) -); - -comment on table sys_config is '参数配置表'; -comment on column sys_config.config_id is '参数主键'; -comment on column sys_config.tenant_id is '租户编号'; -comment on column sys_config.config_name is '参数名称'; -comment on column sys_config.config_key is '参数键名'; -comment on column sys_config.config_value is '参数键值'; -comment on column sys_config.config_type is '系统内置(Y是 N否)'; -comment on column sys_config.create_dept is '创建部门'; -comment on column sys_config.create_by is '创建者'; -comment on column sys_config.create_time is '创建时间'; -comment on column sys_config.update_by is '更新者'; -comment on column sys_config.update_time is '更新时间'; -comment on column sys_config.remark is '备注'; - -insert into sys_config values(1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, now(), null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); -insert into sys_config values(2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, now(), null, null, '初始化密码 123456' ); -insert into sys_config values(3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, now(), null, null, '深色主题theme-dark,浅色主题theme-light' ); -insert into sys_config values(5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, now(), null, null, '是否开启注册用户功能(true开启,false关闭)'); -insert into sys_config values(11, '000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, now(), null, null, 'true:开启, false:关闭'); - - --- ---------------------------- --- 14、系统访问记录 --- ---------------------------- -drop table if exists sys_logininfor; -create table if not exists sys_logininfor -( - info_id int8, - tenant_id varchar(20) default '000000'::varchar, - user_name varchar(50) default ''::varchar, - ipaddr varchar(128) default ''::varchar, - login_location varchar(255) default ''::varchar, - browser varchar(50) default ''::varchar, - os varchar(50) default ''::varchar, - status char default '0'::bpchar, - msg varchar(255) default ''::varchar, - login_time timestamp, - constraint sys_logininfor_pk primary key (info_id) -); - -create index idx_sys_logininfor_s ON sys_logininfor (status); -create index idx_sys_logininfor_lt ON sys_logininfor (login_time); - -comment on table sys_logininfor is '系统访问记录'; -comment on column sys_logininfor.info_id is '访问ID'; -comment on column sys_logininfor.tenant_id is '租户编号'; -comment on column sys_logininfor.user_name is '用户账号'; -comment on column sys_logininfor.ipaddr is '登录IP地址'; -comment on column sys_logininfor.login_location is '登录地点'; -comment on column sys_logininfor.browser is '浏览器类型'; -comment on column sys_logininfor.os is '操作系统'; -comment on column sys_logininfor.status is '登录状态(0成功 1失败)'; -comment on column sys_logininfor.msg is '提示消息'; -comment on column sys_logininfor.login_time is '访问时间'; - --- ---------------------------- --- 17、通知公告表 --- ---------------------------- -drop table if exists sys_notice; -create table if not exists sys_notice -( - notice_id int8, - tenant_id varchar(20) default '000000'::varchar, - notice_title varchar(50) not null, - notice_type char not null, - notice_content text, - status char default '0'::bpchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(255) default null::varchar, - constraint sys_notice_pk primary key (notice_id) -); - -comment on table sys_notice is '通知公告表'; -comment on column sys_notice.notice_id is '公告ID'; -comment on column sys_notice.tenant_id is '租户编号'; -comment on column sys_notice.notice_title is '公告标题'; -comment on column sys_notice.notice_type is '公告类型(1通知 2公告)'; -comment on column sys_notice.notice_content is '公告内容'; -comment on column sys_notice.status is '公告状态(0正常 1关闭)'; -comment on column sys_notice.create_dept is '创建部门'; -comment on column sys_notice.create_by is '创建者'; -comment on column sys_notice.create_time is '创建时间'; -comment on column sys_notice.update_by is '更新者'; -comment on column sys_notice.update_time is '更新时间'; -comment on column sys_notice.remark is '备注'; - --- ---------------------------- --- 初始化-公告信息表数据 --- ---------------------------- -insert into sys_notice values('1', '000000', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, now(), null, null, '管理员'); -insert into sys_notice values('2', '000000', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, now(), null, null, '管理员'); - - --- ---------------------------- --- 18、代码生成业务表 --- ---------------------------- -drop table if exists gen_table; -create table if not exists gen_table -( - table_id int8, - table_name varchar(200) default ''::varchar, - table_comment varchar(500) default ''::varchar, - sub_table_name varchar(64) default ''::varchar, - sub_table_fk_name varchar(64) default ''::varchar, - class_name varchar(100) default ''::varchar, - tpl_category varchar(200) default 'crud'::varchar, - package_name varchar(100) default null::varchar, - module_name varchar(30) default null::varchar, - business_name varchar(30) default null::varchar, - function_name varchar(50) default null::varchar, - function_author varchar(50) default null::varchar, - gen_type char default '0'::bpchar not null, - gen_path varchar(200) default '/'::varchar, - options varchar(1000) default null::varchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default null::varchar, - constraint gen_table_pk primary key (table_id) -); - -comment on table gen_table is '代码生成业务表'; -comment on column gen_table.table_id is '编号'; -comment on column gen_table.table_name is '表名称'; -comment on column gen_table.table_comment is '表描述'; -comment on column gen_table.sub_table_name is '关联子表的表名'; -comment on column gen_table.sub_table_fk_name is '子表关联的外键名'; -comment on column gen_table.class_name is '实体类名称'; -comment on column gen_table.tpl_category is '使用的模板(CRUD单表操作 TREE树表操作)'; -comment on column gen_table.package_name is '生成包路径'; -comment on column gen_table.module_name is '生成模块名'; -comment on column gen_table.business_name is '生成业务名'; -comment on column gen_table.function_name is '生成功能名'; -comment on column gen_table.function_author is '生成功能作者'; -comment on column gen_table.gen_type is '生成代码方式(0zip压缩包 1自定义路径)'; -comment on column gen_table.gen_path is '生成路径(不填默认项目路径)'; -comment on column gen_table.options is '其它生成选项'; -comment on column gen_table.create_dept is '创建部门'; -comment on column gen_table.create_by is '创建者'; -comment on column gen_table.create_time is '创建时间'; -comment on column gen_table.update_by is '更新者'; -comment on column gen_table.update_time is '更新时间'; -comment on column gen_table.remark is '备注'; - --- ---------------------------- --- 19、代码生成业务表字段 --- ---------------------------- -drop table if exists gen_table_column; -create table if not exists gen_table_column -( - column_id int8, - table_id int8, - column_name varchar(200) default null::varchar, - column_comment varchar(500) default null::varchar, - column_type varchar(100) default null::varchar, - java_type varchar(500) default null::varchar, - java_field varchar(200) default null::varchar, - is_pk char default null::bpchar, - is_increment char default null::bpchar, - is_required char default null::bpchar, - is_insert char default null::bpchar, - is_edit char default null::bpchar, - is_list char default null::bpchar, - is_query char default null::bpchar, - query_type varchar(200) default 'EQ'::varchar, - html_type varchar(200) default null::varchar, - dict_type varchar(200) default ''::varchar, - sort int4, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - constraint gen_table_column_pk primary key (column_id) -); - -comment on table gen_table_column is '代码生成业务表字段'; -comment on column gen_table_column.column_id is '编号'; -comment on column gen_table_column.table_id is '归属表编号'; -comment on column gen_table_column.column_name is '列名称'; -comment on column gen_table_column.column_comment is '列描述'; -comment on column gen_table_column.column_type is '列类型'; -comment on column gen_table_column.java_type is 'JAVA类型'; -comment on column gen_table_column.java_field is 'JAVA字段名'; -comment on column gen_table_column.is_pk is '是否主键(1是)'; -comment on column gen_table_column.is_increment is '是否自增(1是)'; -comment on column gen_table_column.is_required is '是否必填(1是)'; -comment on column gen_table_column.is_insert is '是否为插入字段(1是)'; -comment on column gen_table_column.is_edit is '是否编辑字段(1是)'; -comment on column gen_table_column.is_list is '是否列表字段(1是)'; -comment on column gen_table_column.is_query is '是否查询字段(1是)'; -comment on column gen_table_column.query_type is '查询方式(等于、不等于、大于、小于、范围)'; -comment on column gen_table_column.html_type is '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)'; -comment on column gen_table_column.dict_type is '字典类型'; -comment on column gen_table_column.sort is '排序'; -comment on column gen_table_column.create_dept is '创建部门'; -comment on column gen_table_column.create_by is '创建者'; -comment on column gen_table_column.create_time is '创建时间'; -comment on column gen_table_column.update_by is '更新者'; -comment on column gen_table_column.update_time is '更新时间'; - --- ---------------------------- --- OSS对象存储表 --- ---------------------------- -drop table if exists sys_oss; -create table if not exists sys_oss -( - oss_id int8, - tenant_id varchar(20) default '000000'::varchar, - file_name varchar(255) default ''::varchar not null, - original_name varchar(255) default ''::varchar not null, - file_suffix varchar(10) default ''::varchar not null, - url varchar(500) default ''::varchar not null, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - service varchar(20) default 'minio'::varchar, - constraint sys_oss_pk primary key (oss_id) -); - -comment on table sys_oss is 'OSS对象存储表'; -comment on column sys_oss.oss_id is '对象存储主键'; -comment on column sys_oss.tenant_id is '租户编码'; -comment on column sys_oss.file_name is '文件名'; -comment on column sys_oss.original_name is '原名'; -comment on column sys_oss.file_suffix is '文件后缀名'; -comment on column sys_oss.url is 'URL地址'; -comment on column sys_oss.create_by is '上传人'; -comment on column sys_oss.create_dept is '创建部门'; -comment on column sys_oss.create_time is '创建时间'; -comment on column sys_oss.update_by is '更新者'; -comment on column sys_oss.update_time is '更新时间'; -comment on column sys_oss.service is '服务商'; - --- ---------------------------- --- OSS对象存储动态配置表 --- ---------------------------- -drop table if exists sys_oss_config; -create table if not exists sys_oss_config -( - oss_config_id int8, - tenant_id varchar(20) default '000000'::varchar, - config_key varchar(20) default ''::varchar not null, - access_key varchar(255) default ''::varchar, - secret_key varchar(255) default ''::varchar, - bucket_name varchar(255) default ''::varchar, - prefix varchar(255) default ''::varchar, - endpoint varchar(255) default ''::varchar, - domain varchar(255) default ''::varchar, - is_https char default 'N'::bpchar, - region varchar(255) default ''::varchar, - access_policy char(1) default '1'::bpchar not null, - status char default '1'::bpchar, - ext1 varchar(255) default ''::varchar, - create_dept int8, - create_by int8, - create_time timestamp, - update_by int8, - update_time timestamp, - remark varchar(500) default ''::varchar, - constraint sys_oss_config_pk primary key (oss_config_id) -); - -comment on table sys_oss_config is '对象存储配置表'; -comment on column sys_oss_config.oss_config_id is '主建'; -comment on column sys_oss_config.tenant_id is '租户编码'; -comment on column sys_oss_config.config_key is '配置key'; -comment on column sys_oss_config.access_key is 'accessKey'; -comment on column sys_oss_config.secret_key is '秘钥'; -comment on column sys_oss_config.bucket_name is '桶名称'; -comment on column sys_oss_config.prefix is '前缀'; -comment on column sys_oss_config.endpoint is '访问站点'; -comment on column sys_oss_config.domain is '自定义域名'; -comment on column sys_oss_config.is_https is '是否https(Y=是,N=否)'; -comment on column sys_oss_config.region is '域'; -comment on column sys_oss_config.access_policy is '桶权限类型(0=private 1=public 2=custom)'; -comment on column sys_oss_config.status is '是否默认(0=是,1=否)'; -comment on column sys_oss_config.ext1 is '扩展字段'; -comment on column sys_oss_config.create_dept is '创建部门'; -comment on column sys_oss_config.create_by is '创建者'; -comment on column sys_oss_config.create_time is '创建时间'; -comment on column sys_oss_config.update_by is '更新者'; -comment on column sys_oss_config.update_time is '更新时间'; -comment on column sys_oss_config.remark is '备注'; - -insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', 103, 1, now(), 1, now(), null); -insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null); -insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null); -insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 103, 1, now(), 1, now(), null); -insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), NULL); - --- 字符串自动转时间 避免框架时间查询报错问题 -create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$ -select to_timestamp($1, 'yyyy-mm-dd hh24:mi:ss'); -$$ language sql strict ; - -create cast (varchar as timestamptz) with function cast_varchar_to_timestamp as IMPLICIT; diff --git a/script/sql/postgres/postgres_test.sql b/script/sql/postgres/postgres_test.sql deleted file mode 100644 index 179096b3..00000000 --- a/script/sql/postgres/postgres_test.sql +++ /dev/null @@ -1,204 +0,0 @@ -DROP TABLE if EXISTS test_demo; -create table if not exists test_demo -( - id int8, - tenant_id varchar(20) default '000000', - dept_id int8, - user_id int8, - order_num int4 default 0, - test_key varchar(255), - value varchar(255), - version int4 default 0, - create_time timestamp, - create_dept int8, - create_by int8, - update_time timestamp, - update_by int8, - del_flag int4 default 0 -); - -comment on table test_demo is '测试单表'; -comment on column test_demo.id is '主键'; -comment on column test_demo.tenant_id is '租户编号'; -comment on column test_demo.dept_id is '部门id'; -comment on column test_demo.user_id is '用户id'; -comment on column test_demo.order_num is '排序号'; -comment on column test_demo.test_key is 'key键'; -comment on column test_demo.value is '值'; -comment on column test_demo.version is '版本'; -comment on column test_demo.create_dept is '创建部门'; -comment on column test_demo.create_time is '创建时间'; -comment on column test_demo.create_by is '创建人'; -comment on column test_demo.update_time is '更新时间'; -comment on column test_demo.update_by is '更新人'; -comment on column test_demo.del_flag is '删除标志'; - -DROP TABLE if EXISTS test_tree; -create table if not exists test_tree -( - id int8, - tenant_id varchar(20) default '000000', - parent_id int8 default 0, - dept_id int8, - user_id int8, - tree_name varchar(255), - version int4 default 0, - create_time timestamp, - create_dept int8, - create_by int8, - update_time timestamp, - update_by int8, - del_flag integer default 0 -); - -comment on table test_tree is '测试树表'; -comment on column test_tree.id is '主键'; -comment on column test_tree.tenant_id is '租户编号'; -comment on column test_tree.parent_id is '父id'; -comment on column test_tree.dept_id is '部门id'; -comment on column test_tree.user_id is '用户id'; -comment on column test_tree.tree_name is '值'; -comment on column test_tree.version is '版本'; -comment on column test_tree.create_dept is '创建部门'; -comment on column test_tree.create_time is '创建时间'; -comment on column test_tree.create_by is '创建人'; -comment on column test_tree.update_time is '更新时间'; -comment on column test_tree.update_by is '更新人'; -comment on column test_tree.del_flag is '删除标志'; - -INSERT INTO sys_user(user_id, tenant_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (3, '000000', 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', now(), 103, 1, now(), 3, now(), NULL); -INSERT INTO sys_user(user_id, tenant_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (4, '000000', 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', now(), 103, 1, now(), 4, now(), 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 (5, '测试菜单', 0, 5, 'demo', NULL, 1, 0, 'M', '0', '0', NULL, 'star', 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 (1500, '测试单表', 5, 1, 'demo', 'demo/demo/index', 1, 0, 'C', '0', '0', 'demo:demo:list', '#', 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 (1501, '测试单表查询', 1500, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:demo: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 (1502, '测试单表新增', 1500, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:demo: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 (1503, '测试单表修改', 1500, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:demo: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 (1504, '测试单表删除', 1500, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:demo: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 (1505, '测试单表导出', 1500, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:export', '#', 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 (1506, '测试树表', 5, 1, 'tree', 'demo/tree/index', 1, 0, 'C', '0', '0', 'demo:tree:list', '#', 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 (1507, '测试树表查询', 1506, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:tree: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 (1508, '测试树表新增', 1506, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:tree: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 (1509, '测试树表修改', 1506, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:tree: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 (1510, '测试树表删除', 1506, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:tree: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 (1511, '测试树表导出', 1506, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 103, 1, now(), NULL, NULL, ''); - -INSERT INTO sys_role(role_id, tenant_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (3, '000000', '本部门及以下', 'test1', 3, '4', 't', 't', '0', '0', 103, 1, now(), 1, NULL, NULL); -INSERT INTO sys_role(role_id, tenant_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (4, '000000', '仅本人', 'test2', 4, '5', 't', 't', '0', '0', 103, 1, now(), 1, NULL, NULL); - -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 5); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 100); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 101); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 102); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 103); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 104); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 105); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 106); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 107); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 108); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 500); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 501); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1001); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1002); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1003); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1004); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1005); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1006); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1007); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1008); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1009); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1010); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1011); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1012); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1013); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1014); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1015); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1016); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1017); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1018); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1019); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1020); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1021); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1022); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1023); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1024); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1025); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1026); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1027); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1028); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1029); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1030); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1031); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1032); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1033); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1034); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1035); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1036); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1037); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1038); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1039); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1040); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1041); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1042); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1043); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1044); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1045); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1500); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1501); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1502); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1503); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1504); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1505); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1506); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1507); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1508); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1509); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1510); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1511); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 5); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1500); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1501); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1502); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1503); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1504); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1505); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1506); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1507); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1508); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1509); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1510); -INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1511); - -INSERT INTO sys_user_role(user_id, role_id) VALUES (3, 3); -INSERT INTO sys_user_role(user_id, role_id) VALUES (4, 4); - -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (1, '000000', 102, 4, 1, '测试数据权限', '测试', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (2, '000000', 102, 3, 2, '子节点1', '111', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (3, '000000', 102, 3, 3, '子节点2', '222', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (4, '000000', 108, 4, 4, '测试数据', 'demo', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (5, '000000', 108, 3, 13, '子节点11', '1111', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (6, '000000', 108, 3, 12, '子节点22', '2222', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (7, '000000', 108, 3, 11, '子节点33', '3333', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (8, '000000', 108, 3, 10, '子节点44', '4444', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (9, '000000', 108, 3, 9, '子节点55', '5555', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (10, '000000', 108, 3, 8, '子节点66', '6666', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (11, '000000', 108, 3, 7, '子节点77', '7777', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (12, '000000', 108, 3, 6, '子节点88', '8888', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_demo(id, tenant_id, dept_id, user_id, order_num, test_key, value, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (13, '000000', 108, 3, 5, '子节点99', '9999', 0, 103, now(), 1, NULL, NULL, 0); - -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (1, '000000', 0, 102, 4, '测试数据权限', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (2, '000000', 1, 102, 3, '子节点1', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (3, '000000', 2, 102, 3, '子节点2', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (4, '000000', 0, 108, 4, '测试树1', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (5, '000000', 4, 108, 3, '子节点11', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (6, '000000', 4, 108, 3, '子节点22', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (7, '000000', 4, 108, 3, '子节点33', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (8, '000000', 5, 108, 3, '子节点44', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (9, '000000', 6, 108, 3, '子节点55', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (10, '000000', 7, 108, 3, '子节点66', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (11, '000000', 7, 108, 3, '子节点77', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (12, '000000', 10, 108, 3, '子节点88', 0, 103, now(), 1, NULL, NULL, 0); -INSERT INTO test_tree(id, tenant_id, parent_id, dept_id, user_id, tree_name, version, create_dept, create_time, create_by, update_time, update_by, del_flag) VALUES (13, '000000', 10, 108, 3, '子节点99', 0, 103, now(), 1, NULL, NULL, 0); diff --git a/script/sql/ruoyi-ai.sql b/script/sql/ruoyi-ai.sql index 645be400..cd771381 100644 --- a/script/sql/ruoyi-ai.sql +++ b/script/sql/ruoyi-ai.sql @@ -36,7 +36,7 @@ CREATE TABLE `chat_audio_role` ( `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `voice_id`(`create_by`, `voice_id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '配音角色' ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '应用市场' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of chat_audio_role @@ -123,44 +123,38 @@ INSERT INTO `chat_config` VALUES (1818270017966837761, 'stripe', 'enabled', 'fal -- ---------------------------- 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 '创建者', + `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-GmEINlwwR', 'Language Teacher', 'https://gpt-logo.gptshunt.com/MzMzMzUyMzMyMjE4MmE1OTJm.png', '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', 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 (1811668058426515458, 'gpt-4-gizmo-g-pmuQfob8d', 'image generator', 'https://gpt-logo.gptshunt.com/MTEwYzE0MzAwNzBlMDM1OTA1.png', 'Image Generator is a cutting-edge AI bot that leverages the power of GPT technology to generate captivating images from text descriptions. This versatile tool empowers users to create, refine, and personalize visual content ', NULL, NULL, 0, 0, NULL, 103, '2024-07-12 15:44:59', '1', '1', '2024-07-12 15:44:59', '', NULL, '0', NULL, 0); -INSERT INTO `chat_gpts` VALUES (1811668415990931458, 'gpt-4-gizmo-g-B3hgivKK9', 'Write For Me', 'https://gpt-logo.gptshunt.com/MjM1MjA5MDYwODE3MmEyYTU4.png', 'Write For Me is an innovative AI-powered bot that harnesses the capabilities of GPT technology to generate tailored, engaging content with a focus on quality, relevance, and precise word count.', 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-bo0FiWLY7', 'Consensus ', 'https://gpt-logo.gptshunt.com/MDMwZTUxMjcwODM2MmQzODU2.png', 'an AI-powered research assistant, revolutionizes the way you access and utilize academic knowledge. By leveraging advanced GPT technology, this bot allows users to search through a vast database of over 200 million academic papers', 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-kZ0eYXlJe', 'Scholar GPT', 'https://gpt-logo.gptshunt.com/MGEzYjUxMDQzODM5MGQyYjA0.png', 'is an innovative AI-powered bot that revolutionizes the way researchers access and analyze academic resources. provides seamless access to over 200 million resources from renowned databases such as Google Scholar, PubMed, JSTOR, and Arxiv.', 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 (1811817323840872450, 'gpt-4-gizmo-g-alKfVrz9K', 'Canva', 'https://gpt-logo.gptshunt.com/MDAwZDJhMDczNzEzMWI1ODJh.png', 'graphic design bot, revolutionizes the way you create stunning visuals., Canva empowers users to effortlessly design a wide range of materials, from captivating social media posts and eye-catching logos to professional presentations and more.', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 01:38:07', '1', '1', '2024-07-13 01:38:07', NULL, NULL, '0', NULL, 0); -INSERT INTO `chat_gpts` VALUES (1811817605668741121, 'gpt-4-gizmo-g-2DQzU5UZl', 'Code Copilot', 'https://gpt-logo.gptshunt.com/NTMyNTMwMWIzNDU0MzQzYjBk.png', 'is a cutting-edge AI-powered bot that revolutionizes the way developers write code. By leveraging advanced GPT technology, this intelligent assistant acts as a virtual 10x programmer, providing real-time suggestions, code completion, and error detection.', 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 (1811818375105421313, 'gpt-4-gizmo-g-gFt1ghYJl', 'Logo Creator', 'https://gpt-logo.gptshunt.com/MDYyNzE1NTAwNjA5MzgyYjBk.png', 'is an AI-powered bot that leverages advanced GPT technology to generate professional logo designs and app icons tailored to your specific needs.', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 01:42:17', '1', '1', '2024-07-13 01:42:17', NULL, NULL, '0', NULL, 0); -INSERT INTO `chat_gpts` VALUES (1811819494154117121, 'gpt-4-gizmo-g-k3IqoCe1l', 'Code Generator', 'https://gpt-logo.gptshunt.com/MGE1MjI4MTAwZTIyMDQ1MDBk.png', 'is an advanced AI-powered bot that leverages cutting-edge GPT technology to revolutionize the way developers work with code. This intelligent assistant offers a comprehensive suite of features designed to streamline', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 01:46:44', '1', '1', '2024-07-13 01:46:44', NULL, NULL, '0', NULL, 0); -INSERT INTO `chat_gpts` VALUES (1811822597507063810, 'gpt-4-gizmo-g-a9JivI0y2', 'Consistent Character GPT', 'https://gpt-logo.gptshunt.com/MDA1ODJiMDgxNzI4NTExODUz.png', 'Consistent Character GPT is a cutting-edge AI bot that leverages the power of GPT technology to generate high-quality character designs with unparalleled speed and consistency.', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 01:59:04', '1', '1', '2024-07-13 01:59:04', NULL, NULL, '0', NULL, 0); -INSERT INTO `chat_gpts` VALUES (1811822865149796353, 'gpt-4-gizmo-g-ZctQCI6MG', 'Photo Multiverse', 'https://gpt-logo.gptshunt.com/M2IwMjE1MzAyMjI4NTcyYzI2.png', 'is a cutting-edge AI bot that leverages advanced GPT technology to transform your photos into captivating AI personas.', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 02:00:08', '1', '1', '2024-07-13 02:00:08', NULL, NULL, '0', NULL, 0); -INSERT INTO `chat_gpts` VALUES (1811823552902406145, 'gpt-4-gizmo-g-pCq5xaCri', 'LOGO', 'https://gpt-logo.gptshunt.com/MTEyMjEwNTQxOTAwMjIxMzA4.jpg', 'is an AI-powered bot, is a seasoned expert in brand logo design, boasting an impressive 20 years of experience in the field. Leveraging the power of GPT technology, LOGO has been trained on a vast array of designer materials to deliver top-notch results.', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 02:02:52', '1', '1', '2024-07-13 02:02:52', NULL, NULL, '0', NULL, 0); -INSERT INTO `chat_gpts` VALUES (1811823857308213249, 'gpt-4-gizmo-g-I9f8LxD5P', 'Video Maker', 'https://gpt-logo.gptshunt.com/Mjg1ODA3NTkyZDE5MjU1NDMx.png', 'is a cutting-edge AI-powered bot that leverages advanced GPT technology to create captivating animated videos with ease.', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 02:04:04', '1', '1', '2024-07-13 02:04:04', NULL, NULL, '0', NULL, 0); +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 diff --git a/script/sql/ry-vue.sql b/script/sql/ry-vue.sql deleted file mode 100644 index 3d2f8f2d..00000000 --- a/script/sql/ry-vue.sql +++ /dev/null @@ -1,1716 +0,0 @@ -/* - Navicat MySQL Data Transfer - - Source Server : 本地 - Source Server Type : MySQL - Source Server Version : 80034 - Source Host : localhost:3306 - Source Schema : ry-vue - - Target Server Type : MySQL - Target Server Version : 80034 - File Encoding : 65001 - - Date: 26/03/2024 18:15:47 -*/ - -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- Table structure for access_token --- ---------------------------- -DROP TABLE IF EXISTS `access_token`; -CREATE TABLE `access_token` ( - `id` int NOT NULL AUTO_INCREMENT, - `app` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '应用', - `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'token值', - `expired_time` datetime 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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '第三方接口访问token' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of access_token --- ---------------------------- - --- ---------------------------- --- Table structure for agent_field --- ---------------------------- -DROP TABLE IF EXISTS `agent_field`; -CREATE TABLE `agent_field` ( - `id` int NOT NULL AUTO_INCREMENT, - `fid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '领域ID', - `field_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '领域名称', - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '领域描述', - `status` bit(1) NULL DEFAULT b'0' COMMENT '是否生效:0无效1有效', - `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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理领域' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of agent_field --- ---------------------------- - --- ---------------------------- --- Table structure for chat_message --- ---------------------------- -DROP TABLE IF EXISTS `chat_message`; -CREATE TABLE `chat_message` ( - `id` bigint NOT NULL COMMENT '主键', - `user_id` bigint NOT NULL COMMENT '用户id', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '消息内容', - `deduct_cost` double(20, 10) NULL DEFAULT 0.0000000000 COMMENT '扣除金额\r\n\r\n', - `total_tokens` int NULL DEFAULT NULL COMMENT '累计 Tokens', - `model_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型名称', - `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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_request_log --- ---------------------------- -DROP TABLE IF EXISTS `chat_request_log`; -CREATE TABLE `chat_request_log` ( - `id` int NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL COMMENT '用户ID', - `kid` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '知识库ID', - `request_time` datetime NOT NULL COMMENT '请求时间', - `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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 -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '对话请求日志' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of chat_request_log --- ---------------------------- - --- ---------------------------- --- Table structure for chat_token --- ---------------------------- -DROP TABLE IF EXISTS `chat_token`; -CREATE TABLE `chat_token` ( - `id` bigint NOT NULL COMMENT '主键', - `user_id` bigint NOT NULL COMMENT '用户', - `token` int NULL DEFAULT NULL COMMENT '待结算token', - `model_name` varchar(64) 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 = 'token信息' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of chat_token --- ---------------------------- - --- ---------------------------- --- Table structure for demand --- ---------------------------- -DROP TABLE IF EXISTS `demand`; -CREATE TABLE `demand` ( - `id` int NOT NULL AUTO_INCREMENT, - `did` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '需求ID', - `fid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所属领域ID', - `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '需求内容', - `user_id` int NULL DEFAULT NULL COMMENT '用户ID', - `unambiguous` bit(1) NULL DEFAULT b'0' 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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '需求' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of demand --- ---------------------------- - --- ---------------------------- --- Table structure for demand_step --- ---------------------------- -DROP TABLE IF EXISTS `demand_step`; -CREATE TABLE `demand_step` ( - `id` int NOT NULL AUTO_INCREMENT, - `did` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '需求ID', - `fid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所属领域ID', - `step_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '步骤名称', - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '步骤描述', - `role` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '负责人角色', - `user_id` int NULL DEFAULT NULL COMMENT '用户ID', - `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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '需求步骤' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of demand_step --- ---------------------------- - --- ---------------------------- --- Table structure for gen_table --- ---------------------------- -DROP TABLE IF EXISTS `gen_table`; -CREATE TABLE `gen_table` ( - `table_id` bigint 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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 (1661288224013996034, 'test_demo', '测试单表', NULL, NULL, 'TestDemo', 'crud', 'org.dromara.system', 'system', 'demo', '测试单', '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 (1661288224185962497, 'test_tree', '测试树表', NULL, NULL, 'TestTree', 'crud', 'org.dromara.system', 'system', 'tree', '测试树', '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', 'com.xmzs.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', 'com.xmzs.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', 'com.xmzs.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', 'com.xmzs.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 (1728684654923988993, 'chat_message', '聊天消息表', NULL, NULL, 'ChatMessage', 'crud', 'com.xmzs.system', 'system', 'message', '聊天消息', 'Lion Li', '0', '/', NULL, 103, 1, '2023-11-26 15:28:10', 1, '2023-11-26 15:28:10', NULL); -INSERT INTO `gen_table` VALUES (1740573614897897473, 'payment_orders', '支付订单表', NULL, NULL, 'PaymentOrders', 'crud', 'com.xmzs.system', 'system', 'orders', '支付订单', 'Lion Li', '0', '/', NULL, 103, 1, '2023-12-27 23:04:45', 1, '2023-12-27 23:04:45', NULL); - --- ---------------------------- --- Table structure for gen_table_column --- ---------------------------- -DROP TABLE IF EXISTS `gen_table_column`; -CREATE TABLE `gen_table_column` ( - `column_id` bigint NOT NULL COMMENT '编号', - `table_id` bigint 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 NULL DEFAULT NULL COMMENT '排序', - `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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 (1661288224043356162, 1661288224013996034, 'id', '主键', 'bigint(20)', 'Long', 'id', '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 (1661288224043356163, 1661288224013996034, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, 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 (1661288224043356164, 1661288224013996034, 'dept_id', '部门id', 'bigint(20)', 'Long', 'deptId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356165, 1661288224013996034, 'user_id', '用户id', 'bigint(20)', 'Long', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356166, 1661288224013996034, 'order_num', '排序号', 'int(11)', 'Long', 'orderNum', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356167, 1661288224013996034, 'test_key', 'key键', 'varchar(255)', 'String', 'testKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356168, 1661288224013996034, 'value', '值', 'varchar(255)', 'String', 'value', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356169, 1661288224013996034, 'version', '版本', 'int(11)', 'Long', 'version', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356170, 1661288224013996034, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 9, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356171, 1661288224013996034, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 10, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356172, 1661288224013996034, 'create_by', '创建人', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 11, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224043356173, 1661288224013996034, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 12, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224118853634, 1661288224013996034, 'update_by', '更新人', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 13, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224123047938, 1661288224013996034, 'del_flag', '删除标志', 'int(11)', 'Long', 'delFlag', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 14, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224206934017, 1661288224185962497, 'id', '主键', 'bigint(20)', 'Long', 'id', '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 (1661288224206934018, 1661288224185962497, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, 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 (1661288224206934019, 1661288224185962497, 'parent_id', '父id', 'bigint(20)', 'Long', 'parentId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224206934020, 1661288224185962497, 'dept_id', '部门id', 'bigint(20)', 'Long', 'deptId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224206934021, 1661288224185962497, 'user_id', '用户id', 'bigint(20)', 'Long', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224223711233, 1661288224185962497, 'tree_name', '值', 'varchar(255)', 'String', 'treeName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 6, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224223711234, 1661288224185962497, 'version', '版本', 'int(11)', 'Long', 'version', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 7, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224223711235, 1661288224185962497, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224223711236, 1661288224185962497, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224223711237, 1661288224185962497, 'create_by', '创建人', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224223711238, 1661288224185962497, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 11, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224223711239, 1661288224185962497, 'update_by', '更新人', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 12, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); -INSERT INTO `gen_table_column` VALUES (1661288224223711240, 1661288224185962497, 'del_flag', '删除标志', 'int(11)', 'Long', 'delFlag', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 13, 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 (1728684655246950402, 1728684654923988993, 'id', '主键', 'bigint(20)', 'Long', 'id', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950403, 1728684654923988993, 'message_id', '消息 id', 'varchar(64)', 'String', 'messageId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950404, 1728684654923988993, 'parent_message_id', '父级消息 id', 'varchar(64)', 'String', 'parentMessageId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950405, 1728684654923988993, 'parent_answer_message_id', '父级回答消息 id', 'varchar(64)', 'String', 'parentAnswerMessageId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950406, 1728684654923988993, 'parent_question_message_id', '父级问题消息 id', 'varchar(64)', 'String', 'parentQuestionMessageId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950407, 1728684654923988993, 'context_count', '上下文数量', 'bigint(20)', 'Long', 'contextCount', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950408, 1728684654923988993, 'question_context_count', '问题上下文数量', 'bigint(20)', 'Long', 'questionContextCount', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950409, 1728684654923988993, 'message_type', '消息类型枚举', 'int(11)', 'Long', 'messageType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 8, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950410, 1728684654923988993, 'chat_room_id', '聊天室 id', 'bigint(20)', 'Long', 'chatRoomId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 9, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950411, 1728684654923988993, 'conversation_id', '对话 id', 'varchar(255)', 'String', 'conversationId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 10, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950412, 1728684654923988993, 'api_type', 'API 类型', 'varchar(20)', 'String', 'apiType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 11, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950413, 1728684654923988993, 'api_key', 'ApiKey', 'varchar(255)', 'String', 'apiKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 12, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950414, 1728684654923988993, 'content', '消息内容', 'varchar(5000)', 'String', 'content', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'editor', '', 13, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950415, 1728684654923988993, 'original_data', '消息的原始请求或响应数据', 'text', 'String', 'originalData', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 14, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950416, 1728684654923988993, 'response_error_data', '错误的响应数据', 'text', 'String', 'responseErrorData', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 15, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950417, 1728684654923988993, 'prompt_tokens', '输入消息的 tokens', 'bigint(20)', 'Long', 'promptTokens', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 16, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950418, 1728684654923988993, 'completion_tokens', '输出消息的 tokens', 'bigint(20)', 'Long', 'completionTokens', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 17, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950419, 1728684654923988993, 'total_tokens', '累计 Tokens', 'bigint(20)', 'Long', 'totalTokens', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 18, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950420, 1728684654923988993, 'model_name', '模型名称', 'varchar(255)', 'String', 'modelName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 19, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950421, 1728684654923988993, 'status', '聊天记录状态', 'int(11)', 'Long', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 20, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950422, 1728684654923988993, 'is_hide', '是否隐藏 0 否 1 是', 'tinyint(4)', 'Integer', 'isHide', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 21, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950423, 1728684654923988993, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 22, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950424, 1728684654923988993, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 23, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950425, 1728684654923988993, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 24, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950426, 1728684654923988993, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 25, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950427, 1728684654923988993, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 26, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -INSERT INTO `gen_table_column` VALUES (1728684655246950428, 1728684654923988993, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 27, 103, 1, '2023-11-26 15:58:34', 1, '2023-11-26 15:58:34'); -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'); - --- ---------------------------- --- Table structure for knowledge --- ---------------------------- -DROP TABLE IF EXISTS `knowledge`; -CREATE TABLE `knowledge` ( - `id` int NOT NULL AUTO_INCREMENT, - `kid` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库ID', - `uid` bigint NOT NULL DEFAULT 0 COMMENT '用户ID', - `kname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库名称', - `description` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 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_kid`(`kid` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识库' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of knowledge --- ---------------------------- - --- ---------------------------- --- Table structure for knowledge_attach --- ---------------------------- -DROP TABLE IF EXISTS `knowledge_attach`; -CREATE TABLE `knowledge_attach` ( - `id` int NOT NULL AUTO_INCREMENT, - `kid` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库ID', - `doc_id` varchar(10) 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(10) 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` ASC, `doc_name` ASC) USING BTREE -) ENGINE = InnoDB 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` int NOT NULL AUTO_INCREMENT, - `kid` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库ID', - `doc_id` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文档ID', - `fid` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识片段ID', - `idx` int 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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识片段' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of knowledge_fragment --- ---------------------------- - --- ---------------------------- --- Table structure for knowledge_share --- ---------------------------- -DROP TABLE IF EXISTS `knowledge_share`; -CREATE TABLE `knowledge_share` ( - `id` int NOT NULL AUTO_INCREMENT, - `kid` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库ID', - `uid` int NOT NULL DEFAULT 0 COMMENT '用户ID', - `kname` varchar(50) 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 knowledge_share --- ---------------------------- - --- ---------------------------- --- Table structure for media_file --- ---------------------------- -DROP TABLE IF EXISTS `media_file`; -CREATE TABLE `media_file` ( - `id` int NOT NULL AUTO_INCREMENT, - `cid` int NOT NULL DEFAULT 0 COMMENT '对话ID', - `mfid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '媒体文件ID', - `media_type` int NOT NULL COMMENT '媒体类型:1视频,2音频,3图片', - `file_suffix` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件后缀', - `file_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件名', - `file_size` bigint NOT NULL COMMENT '文件大小(单位字节)', - `file_time` bigint NULL DEFAULT NULL COMMENT '时长(单位秒)', - `file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件路径', - `http_url` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'http全路径', - `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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '媒体文件' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of media_file --- ---------------------------- - --- ---------------------------- --- Table structure for mj_room --- ---------------------------- -DROP TABLE IF EXISTS `mj_room`; -CREATE TABLE `mj_room` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `user_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户ID', - `mj_guild_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'MJ服务器ID', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', - `expiration_date` datetime NULL DEFAULT NULL COMMENT '截止有效期', - `enabled_local_sensitive_word` int NULL DEFAULT 0 COMMENT '是否启用本地敏感词过滤,0:不启用;1:启用', - `enabled_baidu_aip` int NULL DEFAULT 0 COMMENT '是否启用百度内容审核,0:不启用;1:启用', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'MJ创作会话' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of mj_room --- ---------------------------- - --- ---------------------------- --- Table structure for mj_room_msg --- ---------------------------- -DROP TABLE IF EXISTS `mj_room_msg`; -CREATE TABLE `mj_room_msg` ( - `id` bigint NOT NULL COMMENT '主键', - `mj_room_id` bigint NOT NULL COMMENT '会话 id', - `guild_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '服务器ID', - `user_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户 id', - `type` tinyint NOT NULL COMMENT '消息类型', - `prompt` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户输入', - `final_prompt` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最终的输入', - `response_content` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '响应内容', - `action` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '指令动作', - `compressed_image_name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '压缩图名称', - `original_image_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '原图名称', - `uv_parent_id` bigint NULL DEFAULT NULL COMMENT 'uv 指令的父消息 id', - `u_use_bit` int NULL DEFAULT NULL COMMENT 'u 指令使用比特位', - `uv_index` tinyint(1) NULL DEFAULT NULL COMMENT 'uv 位置', - `status` tinyint NOT NULL COMMENT '状态', - `discord_finish_time` datetime NULL DEFAULT NULL COMMENT 'discord 结束时间', - `discord_start_time` datetime NULL DEFAULT NULL COMMENT 'discord 开始时间', - `discord_message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'discord 消息 id', - `discord_channel_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'discord 频道 id', - `discord_image_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'discord 图片地址', - `template_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模板ID', - `failure_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '失败原因', - `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除 0 否 1 是', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'Midjourney 创作记录表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of mj_room_msg --- ---------------------------- - --- ---------------------------- --- Table structure for mj_server --- ---------------------------- -DROP TABLE IF EXISTS `mj_server`; -CREATE TABLE `mj_server` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `guild_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '服务器ID', - `channel_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '频道ID', - `bot_token` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '机器人token', - `bot_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `user_token` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户token', - `user_agent` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `max_execute_queue_size` int NULL DEFAULT NULL COMMENT '执行队列最大长度', - `max_file_size` int NULL DEFAULT NULL COMMENT '最大文件大小', - `max_wait_queue_size` int NULL DEFAULT NULL COMMENT '等待队列最大长度', - `status` int NULL DEFAULT NULL COMMENT '状态:0:禁用,1:可用', - `discord_api_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Discord Api Url', - `discord_upload_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'discordUploadUrl', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'MJ服务器信息配置表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of mj_server --- ---------------------------- - --- ---------------------------- --- Table structure for payment_orders --- ---------------------------- -DROP TABLE IF EXISTS `payment_orders`; -CREATE TABLE `payment_orders` ( - `id` bigint 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 NULL DEFAULT NULL COMMENT '用户ID', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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 NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1743813012090322946 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付订单表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of payment_orders --- ---------------------------- - --- ---------------------------- --- Table structure for sd_model_param --- ---------------------------- -DROP TABLE IF EXISTS `sd_model_param`; -CREATE TABLE `sd_model_param` ( - `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id', - `prompt` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '描述词', - `negative_prompt` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '负面词', - `model_name` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '模型名称', - `steps` int NULL DEFAULT NULL COMMENT '迭代步数', - `seed` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '种子', - `width` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '图片宽度', - `height` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '图片高度', - `sampler_name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '采样方法', - `create_dept` bigint 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 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 NOT NULL DEFAULT 0 COMMENT '租户Id', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '模型参数信息表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sd_model_param --- ---------------------------- -INSERT INTO `sd_model_param` VALUES (1, '', '(((simple background))),monochrome ,lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, lowres, bad anatomy, bad hands, text, error, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, ugly,pregnant,vore,duplicate,morbid,mut ilated,tran nsexual, hermaphrodite,long neck,mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,bad anatomy,bad proportions,malformed limbs,extra limbs,cloned face,disfigured,gross proportions, (((missing arms))),(((missing legs))), (((extra arms))),(((extra legs))),pubic hair, plump,bad legs,error legs,username,blurry,bad feet', '国风3 GuoFeng3_v3.4.safetensors [a83e25fe5b]', 30, '-1', '768', '1024', 'DPM++ SDE Karras', NULL, NULL, '', '', NULL, NULL, NULL, '0', NULL, 0); - --- ---------------------------- --- Table structure for sensitive_word --- ---------------------------- -DROP TABLE IF EXISTS `sensitive_word`; -CREATE TABLE `sensitive_word` ( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', - `word` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '敏感词内容', - `status` int NOT NULL COMMENT '状态 1 启用 2 停用', - `is_deleted` int NULL DEFAULT 0 COMMENT '是否删除 0 否 NULL 是', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '敏感词表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sensitive_word --- ---------------------------- - --- ---------------------------- --- Table structure for sys_config --- ---------------------------- -DROP TABLE IF EXISTS `sys_config`; -CREATE TABLE `sys_config` ( - `config_id` bigint 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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', NULL, NULL, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow'); -INSERT INTO `sys_config` VALUES (2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, '2023-05-14 15:19:42', NULL, NULL, '初始化密码 123456'); -INSERT INTO `sys_config` VALUES (3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, '2023-05-14 15:19:42', NULL, NULL, '深色主题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:关闭'); -INSERT INTO `sys_config` VALUES (1729685495520854018, '911866', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, '2023-05-14 15:19:42', 1, '2023-05-14 15:19:42', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow'); -INSERT INTO `sys_config` VALUES (1729685495520854019, '911866', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, '2023-05-14 15:19:42', 1, '2023-05-14 15:19:42', '初始化密码 123456'); -INSERT INTO `sys_config` VALUES (1729685495520854020, '911866', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, '2023-05-14 15:19:42', 1, '2023-05-14 15:19:42', '深色主题theme-dark,浅色主题theme-light'); -INSERT INTO `sys_config` VALUES (1729685495583768578, '911866', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, '2023-05-14 15:19:42', 1, '2023-05-14 15:19:42', '是否开启注册用户功能(true开启,false关闭)'); -INSERT INTO `sys_config` VALUES (1729685495583768579, '911866', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, '2023-05-14 15:19:42', 1, '2023-05-14 15:19:42', 'true:开启, false:关闭'); - --- ---------------------------- --- Table structure for sys_dept --- ---------------------------- -DROP TABLE IF EXISTS `sys_dept`; -CREATE TABLE `sys_dept` ( - `dept_id` bigint NOT NULL COMMENT '部门id', - `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', - `parent_id` bigint 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 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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', '0', 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', '0', 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', '0', 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', '0', 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', '0', 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', '0', 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', '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL); -INSERT INTO `sys_dept` VALUES (1729685491964084226, '911866', 0, '0', '5126', 0, 'admin', NULL, NULL, '0', '2', 103, 1, '2023-11-29 10:15:32', 1, '2023-11-29 10:15:32'); - --- ---------------------------- --- Table structure for sys_dict_data --- ---------------------------- -DROP TABLE IF EXISTS `sys_dict_data`; -CREATE TABLE `sys_dict_data` ( - `dict_code` bigint NOT NULL COMMENT '字典编码', - `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', - `dict_sort` int 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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 (1729685494870736897, '911866', 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '性别男'); -INSERT INTO `sys_dict_data` VALUES (1729685494870736898, '911866', 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '性别女'); -INSERT INTO `sys_dict_data` VALUES (1729685494870736899, '911866', 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '性别未知'); -INSERT INTO `sys_dict_data` VALUES (1729685494870736900, '911866', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '显示菜单'); -INSERT INTO `sys_dict_data` VALUES (1729685494870736901, '911866', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '隐藏菜单'); -INSERT INTO `sys_dict_data` VALUES (1729685494870736902, '911866', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '正常状态'); -INSERT INTO `sys_dict_data` VALUES (1729685494870736903, '911866', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '停用状态'); -INSERT INTO `sys_dict_data` VALUES (1729685494870736904, '911866', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '系统默认是'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845761, '911866', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '系统默认否'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845762, '911866', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '通知'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845763, '911866', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '公告'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845764, '911866', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '正常状态'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845765, '911866', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '关闭状态'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845766, '911866', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '新增操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845767, '911866', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '修改操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845768, '911866', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '删除操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845769, '911866', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '授权操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845770, '911866', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '导出操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845771, '911866', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '导入操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845772, '911866', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '强退操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845773, '911866', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '生成操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845774, '911866', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '清空操作'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845775, '911866', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '正常状态'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845776, '911866', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '停用状态'); -INSERT INTO `sys_dict_data` VALUES (1729685494937845777, '911866', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '其他操作'); - --- ---------------------------- --- Table structure for sys_dict_type --- ---------------------------- -DROP TABLE IF EXISTS `sys_dict_type`; -CREATE TABLE `sys_dict_type` ( - `dict_id` bigint 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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` ASC, `dict_type` ASC) 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', '登录状态列表'); - --- ---------------------------- --- Table structure for sys_file_info --- ---------------------------- -DROP TABLE IF EXISTS `sys_file_info`; -CREATE TABLE `sys_file_info` ( - `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '文件id', - `url` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '文件访问地址', - `size` bigint NULL DEFAULT NULL COMMENT '文件大小,单位字节', - `filename` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件名称', - `original_filename` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '原始文件名', - `base_path` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '基础存储路径', - `path` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '存储路径', - `ext` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件扩展名', - `user_id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件所属用户', - `file_type` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件类型', - `attr` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '附加属性', - `create_dept` bigint 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 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 NOT NULL DEFAULT 0 COMMENT '租户Id', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1688133688718106627 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_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 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` ASC) USING BTREE, - INDEX `idx_sys_logininfor_lt`(`login_time` ASC) 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 NOT NULL COMMENT '菜单ID', - `menu_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称', - `parent_id` bigint NULL DEFAULT 0 COMMENT '父菜单ID', - `order_num` int 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 NULL DEFAULT 1 COMMENT '是否为外链(0是 1否)', - `is_cache` int 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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, 1, 'system', NULL, '', 1, 0, 'M', '0', '0', '', 'system', 103, 1, '2023-05-14 15:19:39', NULL, NULL, '系统管理目录'); -INSERT INTO `sys_menu` VALUES (2, '系统监控', 0, 3, 'monitor', NULL, '', 1, 0, 'M', '0', '0', '', 'monitor', 103, 1, '2023-05-14 15:19:39', NULL, NULL, '系统监控目录'); -INSERT INTO `sys_menu` VALUES (6, '租户管理', 0, 2, 'tenant', NULL, '', 1, 0, 'M', '0', '0', '', 'chart', 103, 1, '2023-05-14 15:19:39', NULL, NULL, '租户管理目录'); -INSERT INTO `sys_menu` VALUES (100, '用户管理', 1, 1, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 103, 1, '2023-05-14 15:19:39', NULL, NULL, '用户管理菜单'); -INSERT INTO `sys_menu` VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 103, 1, '2023-05-14 15:19:39', NULL, NULL, '角色管理菜单'); -INSERT INTO `sys_menu` VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 103, 1, '2023-05-14 15:19:39', NULL, NULL, '菜单管理菜单'); -INSERT INTO `sys_menu` VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 103, 1, '2023-05-14 15:19:39', NULL, NULL, '部门管理菜单'); -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', NULL, NULL, '岗位管理菜单'); -INSERT INTO `sys_menu` VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '字典管理菜单'); -INSERT INTO `sys_menu` VALUES (106, '参数设置', 1, 7, 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '参数设置菜单'); -INSERT INTO `sys_menu` VALUES (107, '通知公告', 1, 8, 'notice', 'system/notice/index', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '通知公告菜单'); -INSERT INTO `sys_menu` VALUES (108, '日志管理', 1, 9, 'log', '', '', 1, 0, 'M', '0', '0', '', 'log', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '日志管理菜单'); -INSERT INTO `sys_menu` VALUES (109, '在线用户', 2, 1, 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '在线用户菜单'); -INSERT INTO `sys_menu` VALUES (113, '缓存监控', 2, 5, 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '缓存监控菜单'); -INSERT INTO `sys_menu` VALUES (115, '代码生成', 1, 2, 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, '2023-05-14 15:19:40', 1, '2023-12-29 11:33:01', '代码生成菜单'); -INSERT INTO `sys_menu` VALUES (118, '文件管理', 1, 10, 'oss', 'system/oss/index', '', 1, 0, 'C', '0', '0', 'system:oss:list', 'upload', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '文件管理菜单'); -INSERT INTO `sys_menu` VALUES (121, '租户管理', 6, 1, 'tenant', 'system/tenant/index', '', 1, 0, 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '租户管理菜单'); -INSERT INTO `sys_menu` VALUES (122, '租户套餐管理', 6, 2, 'tenantPackage', 'system/tenantPackage/index', '', 1, 0, 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '租户套餐管理菜单'); -INSERT INTO `sys_menu` VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '操作日志菜单'); -INSERT INTO `sys_menu` VALUES (501, '登录日志', 108, 2, 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 103, 1, '2023-05-14 15:19:40', NULL, NULL, '登录日志菜单'); -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, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -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 (1046, '在线查询', 109, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1047, '批量强退', 109, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1048, '单条强退', 109, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 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 (1055, '生成查询', 115, 1, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1056, '生成修改', 115, 2, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1057, '生成删除', 115, 3, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1058, '导入代码', 115, 2, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1059, '预览代码', 115, 4, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1060, '生成代码', 115, 5, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1600, '文件查询', 118, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1601, '文件上传', 118, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:upload', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1602, '文件下载', 118, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:download', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1603, '文件删除', 118, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1604, '配置添加', 118, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1605, '配置编辑', 118, 6, '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1606, '租户查询', 121, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1607, '租户新增', 121, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1608, '租户修改', 121, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1609, '租户删除', 121, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1610, '租户导出', 121, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1611, '租户套餐查询', 122, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1612, '租户套餐新增', 122, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1613, '租户套餐修改', 122, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1614, '租户套餐删除', 122, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); -INSERT INTO `sys_menu` VALUES (1615, '租户套餐导出', 122, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); - --- ---------------------------- --- Table structure for sys_model --- ---------------------------- -DROP TABLE IF EXISTS `sys_model`; -CREATE TABLE `sys_model` ( - `id` int NOT NULL, - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型名称', - `describe` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述', - `local` bit(1) NULL DEFAULT b'0' COMMENT '是否本地模型', - `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像', - `free` bit(1) NULL DEFAULT b'0' COMMENT '是否免费', - `std_rate` decimal(10, 8) NULL DEFAULT NULL COMMENT '标准token比', - `role_text` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色设定', - `temperature` decimal(10, 2) NULL DEFAULT NULL COMMENT '模型默认温度', - `top_p` int NULL DEFAULT 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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统模型' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_model --- ---------------------------- - --- ---------------------------- --- Table structure for sys_notice --- ---------------------------- -DROP TABLE IF EXISTS `sys_notice`; -CREATE TABLE `sys_notice` ( - `notice_id` bigint 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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 (1, '000000', '温馨提醒:2018-07-01 新版本发布啦', '2', 0xE696B0E78988E69CACE58685E5AEB9, '0', 103, 1, '2023-05-14 15:19:42', NULL, NULL, '管理员'); -INSERT INTO `sys_notice` VALUES (2, '000000', '维护通知:2018-07-01 系统凌晨维护', '1', 0xE7BBB4E68AA4E58685E5AEB9, '0', 103, 1, '2023-05-14 15:19:42', NULL, NULL, '管理员'); - --- ---------------------------- --- Table structure for sys_oper_log --- ---------------------------- -DROP TABLE IF EXISTS `sys_oper_log`; -CREATE TABLE `sys_oper_log` ( - `oper_id` bigint 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 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 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 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 NULL DEFAULT 0 COMMENT '消耗时间', - PRIMARY KEY (`oper_id`) USING BTREE, - INDEX `idx_sys_oper_log_bt`(`business_type` ASC) USING BTREE, - INDEX `idx_sys_oper_log_s`(`status` ASC) USING BTREE, - INDEX `idx_sys_oper_log_ot`(`oper_time` ASC) 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 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '上传人', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `update_by` bigint 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 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '', 'N', '', '1', '1', '', 103, 1, '2023-05-14 15:19:42', 1, '2023-07-13 23:28:18', NULL); -INSERT INTO `sys_oss_config` VALUES (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '', 'N', '', '1', '1', '', 103, 1, '2023-05-14 15:19:42', 1, '2023-05-14 15:19:42', NULL); -INSERT INTO `sys_oss_config` VALUES (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '', 'N', '', '1', '1', '', 103, 1, '2023-05-14 15:19:42', 1, '2023-07-13 23:35:23', NULL); -INSERT INTO `sys_oss_config` VALUES (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', 'image', '127.0.0.1:9000', '', 'N', '', '1', '0', '', 103, 1, '2023-05-14 15:19:42', 1, '2023-11-13 23:58:09', ''); -INSERT INTO `sys_oss_config` VALUES (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '', 'N', '', '1', '1', '', 103, 1, '2023-05-14 15:19:42', 1, '2023-05-14 15:19:42', NULL); - --- ---------------------------- --- Table structure for sys_post --- ---------------------------- -DROP TABLE IF EXISTS `sys_post`; -CREATE TABLE `sys_post` ( - `post_id` bigint 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 NOT NULL COMMENT '显示顺序', - `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态(0正常 1停用)', - `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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 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 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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', NULL, NULL, '普通角色'); -INSERT INTO `sys_role` VALUES (3, '000000', '本部门及以下', 'test1', 3, '4', 1, 1, '0', '0', 103, 1, '2023-05-14 15:20:00', 1, '2023-06-04 10:20:43', 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, '2023-05-25 17:11:13', ''); -INSERT INTO `sys_role` VALUES (1729685491108446210, '911866', '管理员', 'admin', 1, '1', 1, 1, '0', '0', 103, 1, '2023-11-29 10:15:32', 1, '2023-11-29 10:15:32', NULL); - --- ---------------------------- --- Table structure for sys_role_dept --- ---------------------------- -DROP TABLE IF EXISTS `sys_role_dept`; -CREATE TABLE `sys_role_dept` ( - `role_id` bigint NOT NULL COMMENT '角色ID', - `dept_id` bigint 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 NOT NULL COMMENT '角色ID', - `menu_id` bigint 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, 2); -INSERT INTO `sys_role_menu` VALUES (2, 3); -INSERT INTO `sys_role_menu` VALUES (2, 4); -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, 109); -INSERT INTO `sys_role_menu` VALUES (2, 110); -INSERT INTO `sys_role_menu` VALUES (2, 111); -INSERT INTO `sys_role_menu` VALUES (2, 112); -INSERT INTO `sys_role_menu` VALUES (2, 113); -INSERT INTO `sys_role_menu` VALUES (2, 114); -INSERT INTO `sys_role_menu` VALUES (2, 115); -INSERT INTO `sys_role_menu` VALUES (2, 116); -INSERT INTO `sys_role_menu` VALUES (2, 500); -INSERT INTO `sys_role_menu` VALUES (2, 501); -INSERT INTO `sys_role_menu` VALUES (2, 1000); -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, 1046); -INSERT INTO `sys_role_menu` VALUES (2, 1047); -INSERT INTO `sys_role_menu` VALUES (2, 1048); -INSERT INTO `sys_role_menu` VALUES (2, 1050); -INSERT INTO `sys_role_menu` VALUES (2, 1055); -INSERT INTO `sys_role_menu` VALUES (2, 1056); -INSERT INTO `sys_role_menu` VALUES (2, 1057); -INSERT INTO `sys_role_menu` VALUES (2, 1058); -INSERT INTO `sys_role_menu` VALUES (2, 1059); -INSERT INTO `sys_role_menu` VALUES (2, 1060); -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, 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 (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 (1729685491108446210, 1689201668374556674); -INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1689205943360188417); -INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1689243465037561858); -INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1689243466220355585); - --- ---------------------------- --- Table structure for sys_tenant --- ---------------------------- -DROP TABLE IF EXISTS `sys_tenant`; -CREATE TABLE `sys_tenant` ( - `id` bigint 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 NULL DEFAULT NULL COMMENT '租户套餐编号', - `expire_time` datetime NULL DEFAULT NULL COMMENT '过期时间', - `account_count` int 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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); - --- ---------------------------- --- Table structure for sys_tenant_package --- ---------------------------- -DROP TABLE IF EXISTS `sys_tenant_package`; -CREATE TABLE `sys_tenant_package` ( - `package_id` bigint 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 NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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 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 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系统用户)', - `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 '最后登录时间', - `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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, '0', 4.00, '00000', 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', NULL, NULL, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '0:0:0:0:0:0:0:1', '2024-03-19 17:57:07', 103, 1, '2023-05-14 15:19:39', 1, '2024-03-19 17:57:07', '管理员'); - --- ---------------------------- --- Table structure for sys_user_post --- ---------------------------- -DROP TABLE IF EXISTS `sys_user_post`; -CREATE TABLE `sys_user_post` ( - `user_id` bigint NOT NULL COMMENT '用户ID', - `post_id` bigint 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); - --- ---------------------------- --- Table structure for sys_user_role --- ---------------------------- -DROP TABLE IF EXISTS `sys_user_role`; -CREATE TABLE `sys_user_role` ( - `user_id` bigint NOT NULL COMMENT '用户ID', - `role_id` bigint 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); - --- ---------------------------- --- Table structure for test_demo --- ---------------------------- -DROP TABLE IF EXISTS `test_demo`; -CREATE TABLE `test_demo` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', - `dept_id` bigint NULL DEFAULT NULL COMMENT '部门id', - `user_id` bigint NULL DEFAULT NULL COMMENT '用户id', - `order_num` int NULL DEFAULT 0 COMMENT '排序号', - `test_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'key键', - `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '值', - `version` int NULL DEFAULT 0 COMMENT '版本', - `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `update_by` bigint NULL DEFAULT NULL COMMENT '更新人', - `del_flag` int NULL DEFAULT 0 COMMENT '删除标志', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试单表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of test_demo --- ---------------------------- - --- ---------------------------- --- Table structure for test_tree --- ---------------------------- -DROP TABLE IF EXISTS `test_tree`; -CREATE TABLE `test_tree` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', - `parent_id` bigint NULL DEFAULT 0 COMMENT '父id', - `dept_id` bigint NULL DEFAULT NULL COMMENT '部门id', - `user_id` bigint NULL DEFAULT NULL COMMENT '用户id', - `tree_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '值', - `version` int NULL DEFAULT 0 COMMENT '版本', - `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `update_by` bigint NULL DEFAULT NULL COMMENT '更新人', - `del_flag` int NULL DEFAULT 0 COMMENT '删除标志', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试树表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of test_tree --- ---------------------------- - --- ---------------------------- --- Table structure for voice_role --- ---------------------------- -DROP TABLE IF EXISTS `voice_role`; -CREATE TABLE `voice_role` ( - `id` bigint 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 '头像', - `voice_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色id', - `file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '音频地址', - `pre_process` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '音频预处理(实验性)', - `create_dept` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_by` bigint 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 `voiceId`(`voice_id` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '配音角色' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of voice_role --- ---------------------------- - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql deleted file mode 100644 index f72dfffc..00000000 --- a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql +++ /dev/null @@ -1,2814 +0,0 @@ -CREATE TABLE sys_tenant -( - id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, - contact_user_name nvarchar(20) NULL, - contact_phone nvarchar(20) NULL, - company_name nvarchar(50) NULL, - license_number nvarchar(30) NULL, - address nvarchar(200) NULL, - intro nvarchar(200) NULL, - domain nvarchar(200) NULL, - remark nvarchar(200) NULL, - package_id bigint NULL, - expire_time datetime2(7) NULL, - account_count int DEFAULT ((-1)) NULL, - status nchar(1) DEFAULT ('0') NULL, - del_flag nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - CONSTRAINT PK__sys_tenant__B21E8F2427725F8A PRIMARY KEY CLUSTERED (id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'联系人' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'contact_user_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'联系电话' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'contact_phone' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'企业名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'company_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'统一社会信用代码' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'license_number' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'地址' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'address' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'企业简介' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'intro' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'域名' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'domain' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户套餐编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'package_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'过期时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'expire_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户数量(-1不限制)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'account_count' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'删除标志(0代表存在 2代表删除)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'del_flag' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant' -GO - -INSERT sys_tenant VALUES (1, N'000000', N'管理组', N'15888888888', N'XXX有限公司', NULL, NULL, N'多租户通用后台管理管理系统', NULL, NULL, NULL, NULL, -1, N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO - - -CREATE TABLE sys_tenant_package -( - package_id bigint NOT NULL, - package_name nvarchar(20) NOT NULL, - menu_ids nvarchar(20) NULL, - remark nvarchar(200) NULL, - menu_check_strictly tinyint DEFAULT ((1)) NULL, - status nchar(1) DEFAULT ('0') NULL, - del_flag nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - CONSTRAINT PK__sys_tenant_package__B21E8F2427725F8A PRIMARY KEY CLUSTERED (package_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户套餐id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'package_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'套餐名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'package_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'关联菜单id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'menu_ids' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'删除标志(0代表存在 2代表删除)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'del_flag' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户套餐表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_tenant_package' -GO - - -CREATE TABLE gen_table -( - table_id bigint NOT NULL, - table_name nvarchar(200) DEFAULT '' NULL, - table_comment nvarchar(500) DEFAULT '' NULL, - sub_table_name nvarchar(64) NULL, - sub_table_fk_name nvarchar(64) NULL, - class_name nvarchar(100) DEFAULT '' NULL, - tpl_category nvarchar(200) DEFAULT ('crud') NULL, - package_name nvarchar(100) NULL, - module_name nvarchar(30) NULL, - business_name nvarchar(30) NULL, - function_name nvarchar(50) NULL, - function_author nvarchar(50) NULL, - gen_type nchar(1) DEFAULT ('0') NULL, - gen_path nvarchar(200) DEFAULT ('/') NULL, - options nvarchar(1000) NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, - CONSTRAINT PK__gen_tabl__B21E8F2427725F8A PRIMARY KEY CLUSTERED (table_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'table_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'表名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'table_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'表描述' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'table_comment' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'关联子表的表名' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'sub_table_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'子表关联的外键名' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'sub_table_fk_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'实体类名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'class_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'使用的模板(crud单表操作 tree树表操作)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'tpl_category' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'生成包路径' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'package_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'生成模块名' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'module_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'生成业务名' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'business_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'生成功能名' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'function_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'生成功能作者' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'function_author' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'生成代码方式(0zip压缩包 1自定义路径)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'gen_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'生成路径(不填默认项目路径)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'gen_path' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'其它生成选项' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'options' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'代码生成业务表' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table' -GO - -CREATE TABLE gen_table_column -( - column_id bigint NOT NULL, - table_id bigint NULL, - column_name nvarchar(200) NULL, - column_comment nvarchar(500) NULL, - column_type nvarchar(100) NULL, - java_type nvarchar(500) NULL, - java_field nvarchar(200) NULL, - is_pk nchar(1) NULL, - is_increment nchar(1) NULL, - is_required nchar(1) NULL, - is_insert nchar(1) NULL, - is_edit nchar(1) NULL, - is_list nchar(1) NULL, - is_query nchar(1) NULL, - query_type nvarchar(200) DEFAULT ('EQ') NULL, - html_type nvarchar(200) NULL, - dict_type nvarchar(200) DEFAULT '' NULL, - sort int NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - CONSTRAINT PK__gen_tabl__E301851F2E68B4E8 PRIMARY KEY CLUSTERED (column_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'column_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'归属表编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'table_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'列名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'column_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'列描述' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'column_comment' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'列类型' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'column_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'JAVA类型' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'java_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'JAVA字段名' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'java_field' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否主键(1是)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'is_pk' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否自增(1是)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'is_increment' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否必填(1是)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'is_required' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否为插入字段(1是)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'is_insert' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否编辑字段(1是)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'is_edit' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否列表字段(1是)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'is_list' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否查询字段(1是)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'is_query' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'查询方式(等于、不等于、大于、小于、范围)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'query_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'html_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典类型' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'dict_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'排序' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'sort' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'代码生成业务表字段' , - 'SCHEMA', N'dbo', - 'TABLE', N'gen_table_column' -GO - -CREATE TABLE sys_config -( - config_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT '000000' NULL, - config_name nvarchar(100) DEFAULT '' NULL, - config_key nvarchar(100) DEFAULT '' NULL, - config_value nvarchar(500) DEFAULT '' NULL, - config_type nchar(1) DEFAULT ('N') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, - CONSTRAINT PK__sys_conf__4AD1BFF182643682 PRIMARY KEY CLUSTERED (config_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'参数主键' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'config_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'参数名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'config_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'参数键名' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'config_key' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'参数键值' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'config_value' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'系统内置(Y是 N否)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'config_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'参数配置表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_config' -GO - -INSERT sys_config VALUES (1, N'000000', N'主框架页-默认皮肤样式名称', N'sys.index.skinName', N'skin-blue', N'Y', 103, 1, getdate(), NULL, NULL, N'蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow') -GO -INSERT sys_config VALUES (2, N'000000', N'用户管理-账号初始密码', N'sys.user.initPassword', N'123456', N'Y', 103, 1, getdate(), NULL, NULL, N'初始化密码 123456') -GO -INSERT sys_config VALUES (3, N'000000', N'主框架页-侧边栏主题', N'sys.index.sideTheme', N'theme-dark', N'Y', 103, 1, getdate(), NULL, NULL, N'深色主题theme-dark,浅色主题theme-light') -GO -INSERT sys_config VALUES (5, N'000000', N'账号自助-是否开启用户注册功能', N'sys.account.registerUser', N'false', N'Y', 103, 1, getdate(), NULL, NULL, N'是否开启注册用户功能(true开启,false关闭)') -GO -INSERT sys_config VALUES (11, N'000000', N'OSS预览列表资源开关', N'sys.oss.previewListResource', N'true', N'Y', 103, 1, getdate(), NULL, NULL, N'true:开启, false:关闭'); -GO - -CREATE TABLE sys_dept -( - dept_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - parent_id bigint DEFAULT ((0)) NULL, - ancestors nvarchar(500)DEFAULT '' NULL, - dept_name nvarchar(30) DEFAULT '' NULL, - order_num int DEFAULT ((0)) NULL, - leader nvarchar(20) NULL, - phone nvarchar(11) NULL, - email nvarchar(50) NULL, - status nchar(1) DEFAULT ('0') NULL, - del_flag nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - CONSTRAINT PK__sys_dept__DCA659747DE13804 PRIMARY KEY CLUSTERED (dept_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'部门id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'dept_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'父部门id' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'parent_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'祖级列表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'ancestors' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'部门名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'dept_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'显示顺序' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'order_num' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'负责人' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'leader' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'联系电话' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'phone' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'邮箱' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'email' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'部门状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'删除标志(0代表存在 2代表删除)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'del_flag' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'部门表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dept' -GO - -INSERT sys_dept VALUES (100, N'000000', 0, N'0', N'XXX科技', 0, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (101, N'000000', 100, N'0,100', N'深圳总公司', 1, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (102, N'000000', 100, N'0,100', N'长沙分公司', 2, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (103, N'000000', 101, N'0,100,101', N'研发部门', 1, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (104, N'000000', 101, N'0,100,101', N'市场部门', 2, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (105, N'000000', 101, N'0,100,101', N'测试部门', 3, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (106, N'000000', 101, N'0,100,101', N'财务部门', 4, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (107, N'000000', 101, N'0,100,101', N'运维部门', 5, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (108, N'000000', 102, N'0,100,102', N'市场部门', 1, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO -INSERT sys_dept VALUES (109, N'000000', 102, N'0,100,102', N'财务部门', 2, N'疯狂的狮子Li', N'15888888888', N'xxx@qq.com', N'0', N'0', 103, 1, getdate(), NULL, NULL) -GO - -CREATE TABLE sys_dict_data -( - dict_code bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - dict_sort int DEFAULT ((0)) NULL, - dict_label nvarchar(100) DEFAULT '' NULL, - dict_value nvarchar(100) DEFAULT '' NULL, - dict_type nvarchar(100) DEFAULT '' NULL, - css_class nvarchar(100) NULL, - list_class nvarchar(100) NULL, - is_default nchar(1) DEFAULT ('N') NULL, - status nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, - CONSTRAINT PK__sys_dict__19CBC34B661AF3B3 PRIMARY KEY CLUSTERED (dict_code) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典编码' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'dict_code' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典编码' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典排序' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'dict_sort' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典标签' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'dict_label' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典键值' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'dict_value' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典类型' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'dict_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'样式属性(其他样式扩展)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'css_class' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'表格回显样式' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'list_class' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否默认(Y是 N否)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'is_default' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典数据表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_data' -GO - -INSERT sys_dict_data VALUES (1, N'000000', 1, N'男', N'0', N'sys_user_sex', N'', N'', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'性别男') -GO -INSERT sys_dict_data VALUES (2, N'000000', 2, N'女', N'1', N'sys_user_sex', N'', N'', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'性别女') -GO -INSERT sys_dict_data VALUES (3, N'000000', 3, N'未知', N'2', N'sys_user_sex', N'', N'', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'性别未知') -GO -INSERT sys_dict_data VALUES (4, N'000000', 1, N'显示', N'0', N'sys_show_hide', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'显示菜单') -GO -INSERT sys_dict_data VALUES (5, N'000000', 2, N'隐藏', N'1', N'sys_show_hide', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'隐藏菜单') -GO -INSERT sys_dict_data VALUES (6, N'000000', 1, N'正常', N'0', N'sys_normal_disable', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'正常状态') -GO -INSERT sys_dict_data VALUES (7, N'000000', 2, N'停用', N'1', N'sys_normal_disable', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'停用状态') -GO -INSERT sys_dict_data VALUES (8, N'000000', 1, N'正常', N'0', N'sys_job_status', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'正常状态') -GO -INSERT sys_dict_data VALUES (9, N'000000', 2, N'暂停', N'1', N'sys_job_status', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'停用状态') -GO -INSERT sys_dict_data VALUES (10, N'000000', 1, N'默认', N'DEFAULT', N'sys_job_group', N'', N'', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'默认分组') -GO -INSERT sys_dict_data VALUES (11, N'000000', 2, N'系统', N'SYSTEM', N'sys_job_group', N'', N'', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'系统分组') -GO -INSERT sys_dict_data VALUES (12, N'000000', 1, N'是', N'Y', N'sys_yes_no', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'系统默认是') -GO -INSERT sys_dict_data VALUES (13, N'000000', 2, N'否', N'N', N'sys_yes_no', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'系统默认否') -GO -INSERT sys_dict_data VALUES (14, N'000000', 1, N'通知', N'1', N'sys_notice_type', N'', N'warning', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'通知') -GO -INSERT sys_dict_data VALUES (15, N'000000', 2, N'公告', N'2', N'sys_notice_type', N'', N'success', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'公告') -GO -INSERT sys_dict_data VALUES (16, N'000000', 1, N'正常', N'0', N'sys_notice_status', N'', N'primary', N'Y', N'0', 103, 1, getdate(), NULL, NULL, N'正常状态') -GO -INSERT sys_dict_data VALUES (17, N'000000', 2, N'关闭', N'1', N'sys_notice_status', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'关闭状态') -GO -INSERT sys_dict_data VALUES (29, N'000000', 99, N'其他', N'0', N'sys_oper_type', N'', N'info', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'其他操作'); -GO -INSERT sys_dict_data VALUES (18, N'000000', 1, N'新增', N'1', N'sys_oper_type', N'', N'info', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'新增操作') -GO -INSERT sys_dict_data VALUES (19, N'000000', 2, N'修改', N'2', N'sys_oper_type', N'', N'info', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'修改操作') -GO -INSERT sys_dict_data VALUES (20, N'000000', 3, N'删除', N'3', N'sys_oper_type', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'删除操作') -GO -INSERT sys_dict_data VALUES (21, N'000000', 4, N'授权', N'4', N'sys_oper_type', N'', N'primary', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'授权操作') -GO -INSERT sys_dict_data VALUES (22, N'000000', 5, N'导出', N'5', N'sys_oper_type', N'', N'warning', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'导出操作') -GO -INSERT sys_dict_data VALUES (23, N'000000', 6, N'导入', N'6', N'sys_oper_type', N'', N'warning', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'导入操作') -GO -INSERT sys_dict_data VALUES (24, N'000000', 7, N'强退', N'7', N'sys_oper_type', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'强退操作') -GO -INSERT sys_dict_data VALUES (25, N'000000', 8, N'生成代码', N'8', N'sys_oper_type', N'', N'warning', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'生成操作') -GO -INSERT sys_dict_data VALUES (26, N'000000', 9, N'清空数据', N'9', N'sys_oper_type', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'清空操作') -GO -INSERT sys_dict_data VALUES (27, N'000000', 1, N'成功', N'0', N'sys_common_status', N'', N'primary', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'正常状态') -GO -INSERT sys_dict_data VALUES (28, N'000000', 2, N'失败', N'1', N'sys_common_status', N'', N'danger', N'N', N'0', 103, 1, getdate(), NULL, NULL, N'停用状态') -GO - -CREATE TABLE sys_dict_type -( - dict_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - dict_name nvarchar(100) DEFAULT '' NULL, - dict_type nvarchar(100) DEFAULT '' NULL, - status nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, - CONSTRAINT PK__sys_dict__3BD4186C409C5391 PRIMARY KEY CLUSTERED (dict_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -CREATE NONCLUSTERED INDEX sys_dict_type_index1 ON sys_dict_type (tenant_id, dict_type) -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典主键' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'dict_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典主键' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'dict_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典类型' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'dict_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'字典类型表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_dict_type' -GO - -INSERT sys_dict_type VALUES (1, N'000000', N'用户性别', N'sys_user_sex', N'0', 103, 1, getdate(), NULL, NULL, N'用户性别列表') -GO -INSERT sys_dict_type VALUES (2, N'000000', N'菜单状态', N'sys_show_hide', N'0', 103, 1, getdate(), NULL, NULL, N'菜单状态列表') -GO -INSERT sys_dict_type VALUES (3, N'000000', N'系统开关', N'sys_normal_disable', N'0', 103, 1, getdate(), NULL, NULL, N'系统开关列表') -GO -INSERT sys_dict_type VALUES (4, N'000000', N'任务状态', N'sys_job_status', N'0', 103, 1, getdate(), NULL, NULL, N'任务状态列表') -GO -INSERT sys_dict_type VALUES (5, N'000000', N'任务分组', N'sys_job_group', N'0', 103, 1, getdate(), NULL, NULL, N'任务分组列表') -GO -INSERT sys_dict_type VALUES (6, N'000000', N'系统是否', N'sys_yes_no', N'0', 103, 1, getdate(), NULL, NULL, N'系统是否列表') -GO -INSERT sys_dict_type VALUES (7, N'000000', N'通知类型', N'sys_notice_type', N'0', 103, 1, getdate(), NULL, NULL, N'通知类型列表') -GO -INSERT sys_dict_type VALUES (8, N'000000', N'通知状态', N'sys_notice_status', N'0', 103, 1, getdate(), NULL, NULL, N'通知状态列表') -GO -INSERT sys_dict_type VALUES (9, N'000000', N'操作类型', N'sys_oper_type', N'0', 103, 1, getdate(), NULL, NULL, N'操作类型列表') -GO -INSERT sys_dict_type VALUES (10, N'000000', N'系统状态', N'sys_common_status', N'0', 103, 1, getdate(), NULL, NULL, N'登录状态列表') -GO - -CREATE TABLE sys_logininfor -( - info_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - user_name nvarchar(50) DEFAULT '' NULL, - ipaddr nvarchar(128) DEFAULT '' NULL, - login_location nvarchar(255) DEFAULT '' NULL, - browser nvarchar(50) DEFAULT '' NULL, - os nvarchar(50) DEFAULT '' NULL, - status nchar(1) DEFAULT ('0') NULL, - msg nvarchar(255) DEFAULT '' NULL, - login_time datetime2(7) NULL, - CONSTRAINT PK__sys_logi__3D8A9C1A1854AE10 PRIMARY KEY CLUSTERED (info_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -CREATE NONCLUSTERED INDEX idx_sys_logininfor_s ON sys_logininfor (status) -GO -CREATE NONCLUSTERED INDEX idx_sys_logininfor_lt ON sys_logininfor (login_time) -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'访问ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'info_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户账号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'user_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'登录IP地址' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'ipaddr' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'登录地点' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'login_location' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'浏览器类型' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'browser' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'操作系统' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'os' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'登录状态(0成功 1失败)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'提示消息' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'msg' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'访问时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor', - 'COLUMN', N'login_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'系统访问记录' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_logininfor' -GO - -CREATE TABLE sys_menu -( - menu_id bigint NOT NULL, - menu_name nvarchar(50) NOT NULL, - parent_id bigint DEFAULT ((0)) NULL, - order_num int DEFAULT ((0)) NULL, - path nvarchar(200) DEFAULT '' NULL, - component nvarchar(255) NULL, - query_param nvarchar(255) NULL, - is_frame int DEFAULT ((1)) NULL, - is_cache int DEFAULT ((0)) NULL, - menu_type nchar(1) DEFAULT '' NULL, - visible nchar(1) DEFAULT ((0)) NULL, - status nchar(1) DEFAULT ((0)) NULL, - perms nvarchar(100) NULL, - icon nvarchar(100) DEFAULT ('#') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) DEFAULT '' NULL, - CONSTRAINT PK__sys_menu__4CA0FADCF8545C58 PRIMARY KEY CLUSTERED (menu_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'菜单ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'menu_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'菜单名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'menu_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'父菜单ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'parent_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'显示顺序' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'order_num' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'路由地址' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'path' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'组件路径' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'component' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'路由参数' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'query_param' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否为外链(0是 1否)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'is_frame' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'是否缓存(0缓存 1不缓存)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'is_cache' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'菜单类型(M目录 C菜单 F按钮)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'menu_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'显示状态(0显示 1隐藏)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'visible' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'菜单状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'权限标识' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'perms' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'菜单图标' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'icon' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'菜单权限表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_menu' -GO - -INSERT sys_menu VALUES (1, N'系统管理', 0, 1, N'system', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'system', 103, 1, getdate(), NULL, NULL, N'系统管理目录') -GO -INSERT sys_menu VALUES (6, N'租户管理', 0, 2, N'tenant', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'chart', 103, 1, getdate(), NULL, NULL, N'租户管理目录') -GO -INSERT sys_menu VALUES (2, N'系统监控', 0, 3, N'monitor', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'monitor', 103, 1, getdate(), NULL, NULL, N'系统监控目录') -GO -INSERT sys_menu VALUES (3, N'系统工具', 0, 4, N'tool', NULL, N'', 1, 0, N'M', N'0', N'0', N'', N'tool', 103, 1, getdate(), NULL, NULL, N'系统工具目录') -GO -INSERT sys_menu VALUES (4, N'PLUS官网', 0, 5, N'https://gitee.com/dromara/RuoYi-Vue-Plus', null, N'', 0, 0, N'M', N'0', N'0', N'', N'guide', 103, 1, getdate(), null, null, N'RuoYi-Vue-Plus官网地址'); -GO -INSERT sys_menu VALUES (100, N'用户管理', 1, 1, N'user', N'system/user/index', N'', 1, 0, N'C', N'0', N'0', N'system:user:list', N'user', 103, 1, getdate(), NULL, NULL, N'用户管理菜单') -GO -INSERT sys_menu VALUES (101, N'角色管理', 1, 2, N'role', N'system/role/index', N'', 1, 0, N'C', N'0', N'0', N'system:role:list', N'peoples', 103, 1, getdate(), NULL, NULL, N'角色管理菜单') -GO -INSERT sys_menu VALUES (102, N'菜单管理', 1, 3, N'menu', N'system/menu/index', N'', 1, 0, N'C', N'0', N'0', N'system:menu:list', N'tree-table', 103, 1, getdate(), NULL, NULL, N'菜单管理菜单') -GO -INSERT sys_menu VALUES (103, N'部门管理', 1, 4, N'dept', N'system/dept/index', N'', 1, 0, N'C', N'0', N'0', N'system:dept:list', N'tree', 103, 1, getdate(), NULL, NULL, N'部门管理菜单') -GO -INSERT sys_menu VALUES (104, N'岗位管理', 1, 5, N'post', N'system/post/index', N'', 1, 0, N'C', N'0', N'0', N'system:post:list', N'post', 103, 1, getdate(), NULL, NULL, N'岗位管理菜单') -GO -INSERT sys_menu VALUES (105, N'字典管理', 1, 6, N'dict', N'system/dict/index', N'', 1, 0, N'C', N'0', N'0', N'system:dict:list', N'dict', 103, 1, getdate(), NULL, NULL, N'字典管理菜单') -GO -INSERT sys_menu VALUES (106, N'参数设置', 1, 7, N'config', N'system/config/index', N'', 1, 0, N'C', N'0', N'0', N'system:config:list', N'edit', 103, 1, getdate(), NULL, NULL, N'参数设置菜单') -GO -INSERT sys_menu VALUES (107, N'通知公告', 1, 8, N'notice', N'system/notice/index', N'', 1, 0, N'C', N'0', N'0', N'system:notice:list', N'message', 103, 1, getdate(), NULL, NULL, N'通知公告菜单') -GO -INSERT sys_menu VALUES (108, N'日志管理', 1, 9, N'log', N'', N'', 1, 0, N'M', N'0', N'0', N'', N'log', 103, 1, getdate(), NULL, NULL, N'日志管理菜单') -GO -INSERT sys_menu VALUES (109, N'在线用户', 2, 1, N'online', N'monitor/online/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:online:list', N'online', 103, 1, getdate(), NULL, NULL, N'在线用户菜单') -GO -INSERT sys_menu VALUES (113, N'缓存监控', 2, 5, N'cache', N'monitor/cache/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:cache:list', N'redis', 103, 1, getdate(), NULL, NULL, N'缓存监控菜单') -GO -INSERT sys_menu VALUES (114, N'表单构建', 3, 1, N'build', N'tool/build/index', N'', 1, 0, N'C', N'0', N'0', N'tool:build:list', N'build', 103, 1, getdate(), NULL, NULL, N'表单构建菜单') -GO -INSERT sys_menu VALUES (115, N'代码生成', 3, 2, N'gen', N'tool/gen/index', N'', 1, 0, N'C', N'0', N'0', N'tool:gen:list', N'code', 103, 1, getdate(), NULL, NULL, N'代码生成菜单') -GO -INSERT sys_menu VALUES (121, N'租户管理', 6, 1, N'tenant', N'system/tenant/index', N'', 1, 0, N'C', N'0', N'0', N'system:tenant:list', N'code', 103, 1, getdate(), NULL, NULL, N'租户管理菜单') -GO -INSERT sys_menu VALUES (122, N'租户套餐管理', 6, 2, N'tenantPackage', N'system/tenantPackage/index', N'', 1, 0, N'C', N'0', N'0', N'system:tenantPackage:list', N'code', 103, 1, getdate(), NULL, NULL, N'租户套餐管理菜单') -GO -INSERT sys_menu VALUES (117, N'Admin监控', 2, 5, N'Admin', N'monitor/admin/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:admin:list', N'dashboard', 103, 1, getdate(), NULL, NULL, N'Admin监控菜单'); -GO -INSERT sys_menu VALUES (118, N'文件管理', 1, 10, N'oss', N'system/oss/index', N'', 1, 0, N'C', '0', N'0', N'system:oss:list', N'upload', 103, 1, getdate(), NULL, NULL, N'文件管理菜单'); -GO -INSERT sys_menu VALUES (120, N'任务调度中心', 2, 5, N'XxlJob', N'monitor/xxljob/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:xxljob:list', N'job', 103, 1, getdate(), NULL, NULL, N'Xxl-Job控制台菜单'); -GO -INSERT sys_menu VALUES (500, N'操作日志', 108, 1, N'operlog', N'monitor/operlog/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:operlog:list', N'form', 103, 1, getdate(), NULL, NULL, N'操作日志菜单') -GO -INSERT sys_menu VALUES (501, N'登录日志', 108, 2, N'logininfor', N'monitor/logininfor/index', N'', 1, 0, N'C', N'0', N'0', N'monitor:logininfor:list', N'logininfor', 103, 1, getdate(), NULL, NULL, N'登录日志菜单') -GO -INSERT sys_menu VALUES (1001, N'用户查询', 100, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1002, N'用户新增', 100, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:add', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1003, N'用户修改', 100, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1004, N'用户删除', 100, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1005, N'用户导出', 100, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:export', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1006, N'用户导入', 100, 6, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:import', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1007, N'重置密码', 100, 7, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:user:resetPwd', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1008, N'角色查询', 101, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1009, N'角色新增', 101, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:add', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1010, N'角色修改', 101, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1011, N'角色删除', 101, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1012, N'角色导出', 101, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:role:export', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1013, N'菜单查询', 102, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1014, N'菜单新增', 102, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:add', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1015, N'菜单修改', 102, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1016, N'菜单删除', 102, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:menu:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1017, N'部门查询', 103, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1018, N'部门新增', 103, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:add', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1019, N'部门修改', 103, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1020, N'部门删除', 103, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dept:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1021, N'岗位查询', 104, 1, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1022, N'岗位新增', 104, 2, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:add', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1023, N'岗位修改', 104, 3, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1024, N'岗位删除', 104, 4, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1025, N'岗位导出', 104, 5, N'', N'', N'', 1, 0, N'F', N'0', N'0', N'system:post:export', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1026, N'字典查询', 105, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1027, N'字典新增', 105, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:add', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1028, N'字典修改', 105, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1029, N'字典删除', 105, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1030, N'字典导出', 105, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:dict:export', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1031, N'参数查询', 106, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1032, N'参数新增', 106, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:add', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1033, N'参数修改', 106, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1034, N'参数删除', 106, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1035, N'参数导出', 106, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:config:export', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1036, N'公告查询', 107, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1037, N'公告新增', 107, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:add', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1038, N'公告修改', 107, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1039, N'公告删除', 107, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:notice:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1040, N'操作查询', 500, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1041, N'操作删除', 500, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1042, N'日志导出', 500, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:operlog:export', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1043, N'登录查询', 501, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1044, N'登录删除', 501, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1045, N'日志导出', 501, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:export', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1050, N'账户解锁', 501, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:logininfor:unlock', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1046, N'在线查询', 109, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1047, N'批量强退', 109, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:batchLogout', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1048, N'单条强退', 109, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'monitor:online:forceLogout', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1055, N'生成查询', 115, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:query', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1056, N'生成修改', 115, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:edit', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1057, N'生成删除', 115, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:remove', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1058, N'导入代码', 115, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:import', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1059, N'预览代码', 115, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:preview', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_menu VALUES (1060, N'生成代码', 115, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'tool:gen:code', N'#', 103, 1, getdate(), NULL, NULL, N'') -GO --- oss相关按钮 -INSERT sys_menu VALUES (1600, N'文件查询', 118, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:query', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1601, N'文件上传', 118, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:upload', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1602, N'文件下载', 118, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:download', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1603, N'文件删除', 118, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:remove', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1604, N'配置添加', 118, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:add', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1605, N'配置编辑', 118, 6, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:oss:edit', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO --- 租户管理相关按钮 -INSERT sys_menu VALUES (1606, N'租户查询', 121, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:query', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1607, N'租户新增', 121, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:add', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1608, N'租户修改', 121, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:edit', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1609, N'租户删除', 121, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:remove', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1610, N'租户导出', 121, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenant:export', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO --- 租户套餐管理相关按钮 -INSERT sys_menu VALUES (1611, N'租户套餐查询', 122, 1, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:query', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1612, N'租户套餐新增', 122, 2, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:add', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1613, N'租户套餐修改', 122, 3, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:edit', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1614, N'租户套餐删除', 122, 4, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:remove', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1615, N'租户套餐导出', 122, 5, N'#', N'', N'', 1, 0, N'F', N'0', N'0', N'system:tenantPackage:export', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO - -CREATE TABLE sys_notice -( - notice_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - notice_title nvarchar(50) NOT NULL, - notice_type nchar(1) NOT NULL, - notice_content nvarchar(max) NULL, - status nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(255) NULL, - CONSTRAINT PK__sys_noti__3E82A5DB0EC94801 PRIMARY KEY CLUSTERED (notice_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -TEXTIMAGE_ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'公告ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'notice_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'公告标题' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'notice_title' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'公告类型(1通知 2公告)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'notice_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'公告内容' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'notice_content' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'公告状态(0正常 1关闭)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'通知公告表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_notice' -GO - -INSERT sys_notice VALUES (1, N'000000', N'温馨提醒:2018-07-01 若依新版本发布啦', N'2', N'新版本内容', N'0', 103, 1, getdate(), NULL, NULL, N'管理员') -GO -INSERT sys_notice VALUES (2, N'000000', N'维护通知:2018-07-01 若依系统凌晨维护', N'1', N'维护内容', N'0', 103, 1, getdate(), NULL, NULL, N'管理员') -GO - -CREATE TABLE sys_oper_log -( - oper_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - title nvarchar(50) DEFAULT '' NULL, - business_type int DEFAULT ((0)) NULL, - method nvarchar(100) DEFAULT '' NULL, - request_method nvarchar(10) DEFAULT '' NULL, - operator_type int DEFAULT ((0)) NULL, - oper_name nvarchar(50) DEFAULT '' NULL, - dept_name nvarchar(50) DEFAULT '' NULL, - oper_url nvarchar(255) DEFAULT '' NULL, - oper_ip nvarchar(128) DEFAULT '' NULL, - oper_location nvarchar(255) DEFAULT '' NULL, - oper_param nvarchar(2000) DEFAULT '' NULL, - json_result nvarchar(2000) DEFAULT '' NULL, - status int DEFAULT ((0)) NULL, - error_msg nvarchar(2000) DEFAULT '' NULL, - oper_time datetime2(7) NULL, - cost_time bigint DEFAULT ((0)) NULL, - CONSTRAINT PK__sys_oper__34723BF9BD954573 PRIMARY KEY CLUSTERED (oper_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -CREATE NONCLUSTERED INDEX idx_sys_oper_log_bt ON sys_oper_log (business_type) -GO -CREATE NONCLUSTERED INDEX idx_sys_oper_log_s ON sys_oper_log (status) -GO -CREATE NONCLUSTERED INDEX idx_sys_oper_log_ot ON sys_oper_log (oper_time) -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'日志主键' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'oper_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'模块标题' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'title' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'业务类型(0其它 1新增 2修改 3删除)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'business_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'方法名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'method' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'请求方式' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'request_method' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'操作类别(0其它 1后台用户 2手机端用户)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'operator_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'操作人员' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'oper_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'部门名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'dept_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'请求URL' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'oper_url' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'主机地址' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'oper_ip' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'操作地点' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'oper_location' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'请求参数' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'oper_param' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'返回参数' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'json_result' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'操作状态(0正常 1异常)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'错误消息' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'error_msg' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'操作时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'oper_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'消耗时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log', - 'COLUMN', N'cost_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'操作日志记录' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oper_log' -GO - -CREATE TABLE sys_post -( - post_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - post_code nvarchar(64) NOT NULL, - post_name nvarchar(50) NOT NULL, - post_sort int NOT NULL, - status nchar(1) NOT NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, - CONSTRAINT PK__sys_post__3ED7876668E2D081 PRIMARY KEY CLUSTERED (post_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'岗位ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'post_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'岗位编码' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'post_code' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'岗位名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'post_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'显示顺序' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'post_sort' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'岗位信息表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_post' -GO - -INSERT sys_post VALUES (1, N'000000', N'ceo', N'董事长', 1, N'0', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_post VALUES (2, N'000000', N'se', N'项目经理', 2, N'0', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_post VALUES (3, N'000000', N'hr', N'人力资源', 3, N'0', 103, 1, getdate(), NULL, NULL, N'') -GO -INSERT sys_post VALUES (4, N'000000', N'user', N'普通员工', 4, N'0', 103, 1, getdate(), NULL, NULL, N'') -GO - -CREATE TABLE sys_role -( - role_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - role_name nvarchar(30) NOT NULL, - role_key nvarchar(100) NOT NULL, - role_sort int NOT NULL, - data_scope nchar(1) DEFAULT ('1') NULL, - menu_check_strictly tinyint DEFAULT ((1)) NULL, - dept_check_strictly tinyint DEFAULT ((1)) NULL, - status nchar(1) NOT NULL, - del_flag nchar(1) DEFAULT ('0') NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, - CONSTRAINT PK__sys_role__760965CCF9383145 PRIMARY KEY CLUSTERED (role_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'role_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色名称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'role_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色权限字符串' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'role_key' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'显示顺序' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'role_sort' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'data_scope' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'菜单树选择项是否关联显示' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'menu_check_strictly' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'部门树选择项是否关联显示' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'dept_check_strictly' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'删除标志(0代表存在 2代表删除)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'del_flag' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色信息表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role' -GO - -INSERT sys_role VALUES (1, N'000000', N'超级管理员', N'superadmin', 1, N'1', 1, 1, N'0', N'0', 103, 1, getdate(), NULL, NULL, N'超级管理员') -GO -INSERT sys_role VALUES (2, N'000000', N'普通角色', N'common', 2, N'2', 1, 1, N'0', N'0', 103, 1, getdate(), NULL, NULL, N'普通角色') -GO - -CREATE TABLE sys_role_dept -( - role_id bigint NOT NULL, - dept_id bigint NOT NULL, - CONSTRAINT PK__sys_role__2BC3005BABBCA08A PRIMARY KEY CLUSTERED (role_id, dept_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role_dept', - 'COLUMN', N'role_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'部门ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role_dept', - 'COLUMN', N'dept_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色和部门关联表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role_dept' -GO - -INSERT sys_role_dept VALUES (2, 100) -GO -INSERT sys_role_dept VALUES (2, 101) -GO -INSERT sys_role_dept VALUES (2, 105) -GO - -CREATE TABLE sys_role_menu -( - role_id bigint NOT NULL, - menu_id bigint NOT NULL, - CONSTRAINT PK__sys_role__A2C36A6187BA4B17 PRIMARY KEY CLUSTERED (role_id, menu_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role_menu', - 'COLUMN', N'role_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'菜单ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role_menu', - 'COLUMN', N'menu_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色和菜单关联表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_role_menu' -GO - -INSERT sys_role_menu VALUES (2, 1) -GO -INSERT sys_role_menu VALUES (2, 2) -GO -INSERT sys_role_menu VALUES (2, 3) -GO -INSERT sys_role_menu VALUES (2, 100) -GO -INSERT sys_role_menu VALUES (2, 101) -GO -INSERT sys_role_menu VALUES (2, 102) -GO -INSERT sys_role_menu VALUES (2, 103) -GO -INSERT sys_role_menu VALUES (2, 104) -GO -INSERT sys_role_menu VALUES (2, 105) -GO -INSERT sys_role_menu VALUES (2, 106) -GO -INSERT sys_role_menu VALUES (2, 107) -GO -INSERT sys_role_menu VALUES (2, 108) -GO -INSERT sys_role_menu VALUES (2, 109) -GO -INSERT sys_role_menu VALUES (2, 110) -GO -INSERT sys_role_menu VALUES (2, 111) -GO -INSERT sys_role_menu VALUES (2, 112) -GO -INSERT sys_role_menu VALUES (2, 113) -GO -INSERT sys_role_menu VALUES (2, 114) -GO -INSERT sys_role_menu VALUES (2, 115) -GO -INSERT sys_role_menu VALUES (2, 116) -GO -INSERT sys_role_menu VALUES (2, 500) -GO -INSERT sys_role_menu VALUES (2, 501) -GO -INSERT sys_role_menu VALUES (2, 1001) -GO -INSERT sys_role_menu VALUES (2, 1002) -GO -INSERT sys_role_menu VALUES (2, 1003) -GO -INSERT sys_role_menu VALUES (2, 1004) -GO -INSERT sys_role_menu VALUES (2, 1005) -GO -INSERT sys_role_menu VALUES (2, 1006) -GO -INSERT sys_role_menu VALUES (2, 1007) -GO -INSERT sys_role_menu VALUES (2, 1008) -GO -INSERT sys_role_menu VALUES (2, 1009) -GO -INSERT sys_role_menu VALUES (2, 1010) -GO -INSERT sys_role_menu VALUES (2, 1011) -GO -INSERT sys_role_menu VALUES (2, 1012) -GO -INSERT sys_role_menu VALUES (2, 1013) -GO -INSERT sys_role_menu VALUES (2, 1014) -GO -INSERT sys_role_menu VALUES (2, 1015) -GO -INSERT sys_role_menu VALUES (2, 1016) -GO -INSERT sys_role_menu VALUES (2, 1017) -GO -INSERT sys_role_menu VALUES (2, 1018) -GO -INSERT sys_role_menu VALUES (2, 1019) -GO -INSERT sys_role_menu VALUES (2, 1020) -GO -INSERT sys_role_menu VALUES (2, 1021) -GO -INSERT sys_role_menu VALUES (2, 1022) -GO -INSERT sys_role_menu VALUES (2, 1023) -GO -INSERT sys_role_menu VALUES (2, 1024) -GO -INSERT sys_role_menu VALUES (2, 1025) -GO -INSERT sys_role_menu VALUES (2, 1026) -GO -INSERT sys_role_menu VALUES (2, 1027) -GO -INSERT sys_role_menu VALUES (2, 1028) -GO -INSERT sys_role_menu VALUES (2, 1029) -GO -INSERT sys_role_menu VALUES (2, 1030) -GO -INSERT sys_role_menu VALUES (2, 1031) -GO -INSERT sys_role_menu VALUES (2, 1032) -GO -INSERT sys_role_menu VALUES (2, 1033) -GO -INSERT sys_role_menu VALUES (2, 1034) -GO -INSERT sys_role_menu VALUES (2, 1035) -GO -INSERT sys_role_menu VALUES (2, 1036) -GO -INSERT sys_role_menu VALUES (2, 1037) -GO -INSERT sys_role_menu VALUES (2, 1038) -GO -INSERT sys_role_menu VALUES (2, 1039) -GO -INSERT sys_role_menu VALUES (2, 1040) -GO -INSERT sys_role_menu VALUES (2, 1041) -GO -INSERT sys_role_menu VALUES (2, 1042) -GO -INSERT sys_role_menu VALUES (2, 1043) -GO -INSERT sys_role_menu VALUES (2, 1044) -GO -INSERT sys_role_menu VALUES (2, 1045) -GO -INSERT sys_role_menu VALUES (2, 1046) -GO -INSERT sys_role_menu VALUES (2, 1047) -GO -INSERT sys_role_menu VALUES (2, 1048) -GO -INSERT sys_role_menu VALUES (2, 1049) -GO -INSERT sys_role_menu VALUES (2, 1050) -GO -INSERT sys_role_menu VALUES (2, 1051) -GO -INSERT sys_role_menu VALUES (2, 1052) -GO -INSERT sys_role_menu VALUES (2, 1053) -GO -INSERT sys_role_menu VALUES (2, 1054) -GO -INSERT sys_role_menu VALUES (2, 1055) -GO -INSERT sys_role_menu VALUES (2, 1056) -GO -INSERT sys_role_menu VALUES (2, 1057) -GO -INSERT sys_role_menu VALUES (2, 1058) -GO -INSERT sys_role_menu VALUES (2, 1059) -GO -INSERT sys_role_menu VALUES (2, 1060) -GO - -CREATE TABLE sys_user -( - user_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - dept_id bigint NULL, - user_name nvarchar(30) NOT NULL, - nick_name nvarchar(30) NOT NULL, - user_type nvarchar(10) DEFAULT ('sys_user') NULL, - email nvarchar(50) DEFAULT '' NULL, - phonenumber nvarchar(11) DEFAULT '' NULL, - sex nchar(1) DEFAULT ('0') NULL, - avatar bigint NULL, - password nvarchar(100) DEFAULT '' NULL, - status nchar(1) DEFAULT ('0') NULL, - del_flag nchar(1) DEFAULT ('0') NULL, - login_ip nvarchar(128) DEFAULT '' NULL, - login_date datetime2(7) NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, - CONSTRAINT PK__sys_user__B9BE370F79170B6A PRIMARY KEY CLUSTERED (user_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'user_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'tenant_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'部门ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'dept_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户账号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'user_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户昵称' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'nick_name' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户类型(sys_user系统用户)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'user_type' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户邮箱' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'email' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'手机号码' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'phonenumber' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户性别(0男 1女 2未知)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'sex' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'头像地址' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'avatar' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'密码' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'password' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'帐号状态(0正常 1停用)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'status' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'删除标志(0代表存在 2代表删除)' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'del_flag' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'最后登录IP' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'login_ip' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'最后登录时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'login_date' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'create_dept' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'create_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'create_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新者' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'update_by' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'更新时间' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'update_time' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'备注' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user', - 'COLUMN', N'remark' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户信息表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user' -GO - -INSERT sys_user VALUES (1, 103, N'000000', N'admin', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@163.com', N'15888888888', N'1', NULL, N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), NULL, NULL, N'管理员') -GO -INSERT sys_user VALUES (2, 105, N'000000', N'lionli', N'疯狂的狮子Li', N'sys_user', N'crazyLionLi@qq.com', N'15666666666', N'1', NULL, N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), NULL, NULL, N'测试员') -GO - -CREATE TABLE sys_user_post -( - user_id bigint NOT NULL, - post_id bigint NOT NULL, - CONSTRAINT PK__sys_user__CA534F799C04589B PRIMARY KEY CLUSTERED (user_id, post_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user_post', - 'COLUMN', N'user_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'岗位ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user_post', - 'COLUMN', N'post_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户与岗位关联表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user_post' -GO - -INSERT sys_user_post VALUES (1, 1) -GO -INSERT sys_user_post VALUES (2, 2) -GO - -CREATE TABLE sys_user_role -( - user_id bigint NOT NULL, - role_id bigint NOT NULL, - CONSTRAINT PK__sys_user__6EDEA153FB34D8F0 PRIMARY KEY CLUSTERED (user_id, role_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user_role', - 'COLUMN', N'user_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'角色ID' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user_role', - 'COLUMN', N'role_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'用户和角色关联表' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_user_role' -GO - -INSERT sys_user_role VALUES (1, 1) -GO -INSERT sys_user_role VALUES (2, 2) -GO - -CREATE TABLE sys_oss -( - oss_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - file_name nvarchar(255) DEFAULT '' NOT NULL, - original_name nvarchar(255) DEFAULT '' NOT NULL, - file_suffix nvarchar(10) DEFAULT '' NOT NULL, - url nvarchar(500) NOT NULL, - create_dept bigint NULL, - create_time datetime2(7) NULL, - create_by bigint NULL, - update_time datetime2(7) NULL, - update_by bigint NULL, - service nvarchar(20) DEFAULT ('minio') NOT NULL, - CONSTRAINT PK__sys_oss__91241EA442389F0D PRIMARY KEY CLUSTERED (oss_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'对象存储主键', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'oss_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'tenant_id' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'文件名', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'file_name' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'原名', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'original_name' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'文件后缀名', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'file_suffix' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'URL地址', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'url' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'create_dept' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'创建时间', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'create_time' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'上传人', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'create_by' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'更新时间', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'update_time' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'更新人', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'update_by' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'服务商', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss', - 'COLUMN', N'service' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'OSS对象存储表', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss' -GO - -CREATE TABLE sys_oss_config -( - oss_config_id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - config_key nvarchar(20) DEFAULT '' NOT NULL, - access_key nvarchar(255) DEFAULT '' NULL, - secret_key nvarchar(255) DEFAULT '' NULL, - bucket_name nvarchar(255) DEFAULT '' NULL, - prefix nvarchar(255) DEFAULT '' NULL, - endpoint nvarchar(255) DEFAULT '' NULL, - domain nvarchar(255) DEFAULT '' NULL, - is_https nchar(1) DEFAULT ('N') NULL, - region nvarchar(255) DEFAULT '' NULL, - access_policy nchar(1) DEFAULT ('1') NOT NULL, - status nchar(1) DEFAULT ('1') NULL, - ext1 nvarchar(255) DEFAULT '' NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, - CONSTRAINT PK__sys_oss___BFBDE87009ED2882 PRIMARY KEY CLUSTERED (oss_config_id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'主建', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'oss_config_id' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'租户编号' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'tenant_id' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'配置key', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'config_key' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'accessKey', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'access_key' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'秘钥', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'secret_key' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'桶名称', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'bucket_name' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'前缀', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'prefix' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'访问站点', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'endpoint' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'自定义域名', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'domain' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'是否https(Y=是,N=否)', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'is_https' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'域', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'region' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'桶权限类型(0=private 1=public 2=custom)', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'access_policy' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'是否默认(0=是,1=否)', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'status' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'扩展字段', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'ext1' -GO -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'create_dept' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'创建者', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'create_by' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'创建时间', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'create_time' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'更新者', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'update_by' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'更新时间', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'update_time' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'备注', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config', - 'COLUMN', N'remark' -GO -EXEC sp_addextendedproperty - 'MS_Description', N'对象存储配置表', - 'SCHEMA', N'dbo', - 'TABLE', N'sys_oss_config' -GO - -INSERT INTO sys_oss_config VALUES (N'1', N'000000', N'minio', N'ruoyi', N'ruoyi123', N'ruoyi', N'', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'0', N'', 103, 1, getdate(), 1, getdate(), NULL) -GO -INSERT INTO sys_oss_config VALUES (N'2', N'000000', N'qiniu', N'XXXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N's3-cn-north-1.qiniucs.com', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) -GO -INSERT INTO sys_oss_config VALUES (N'3', N'000000', N'aliyun', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N'oss-cn-beijing.aliyuncs.com', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) -GO -INSERT INTO sys_oss_config VALUES (N'4', N'000000', N'qcloud', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi-1250000000', N'', N'cos.ap-beijing.myqcloud.com', N'',N'N', N'ap-beijing', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) -GO -INSERT INTO sys_oss_config VALUES (N'5', N'000000', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', 103, 1, getdate(), 1, getdate(), NULL) -GO diff --git a/script/sql/sqlserver/sqlserver_test.sql b/script/sql/sqlserver/sqlserver_test.sql deleted file mode 100644 index 87628bd6..00000000 --- a/script/sql/sqlserver/sqlserver_test.sql +++ /dev/null @@ -1,510 +0,0 @@ -CREATE TABLE test_demo -( - id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - dept_id bigint NULL, - user_id bigint NULL, - order_num int DEFAULT ((0)) NULL, - test_key nvarchar(255) NULL, - value nvarchar(255) NULL, - version int DEFAULT ((0)) NULL, - create_dept bigint NULL, - create_time datetime2(0) NULL, - create_by bigint NULL, - update_time datetime2(0) NULL, - update_by bigint NULL, - del_flag int DEFAULT ((0)) NULL, - CONSTRAINT PK__test_dem__3213E83F176051C8 PRIMARY KEY CLUSTERED (id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'主键', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'租户id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'tenant_id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'部门id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'dept_id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'用户id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'user_id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'排序号', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'order_num' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'key键', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'test_key' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'值', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'value' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'版本', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'version' -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'create_dept' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'创建时间', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'create_time' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'创建人', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'create_by' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'更新时间', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'update_time' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'更新人', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'update_by' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'删除标志', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo', - 'COLUMN', N'del_flag' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'测试单表', - 'SCHEMA', N'dbo', - 'TABLE', N'test_demo' -GO - -CREATE TABLE test_tree -( - id bigint NOT NULL, - tenant_id nvarchar(20) DEFAULT ('000000') NULL, - parent_id bigint DEFAULT ((0)) NULL, - dept_id bigint NULL, - user_id bigint NULL, - tree_name nvarchar(255) NULL, - version int DEFAULT ((0)) NULL, - create_dept bigint NULL, - create_time datetime2(0) NULL, - create_by bigint NULL, - update_time datetime2(0) NULL, - update_by bigint NULL, - del_flag int DEFAULT ((0)) NULL, - CONSTRAINT PK__test_tre__3213E83FC75A1B63 PRIMARY KEY CLUSTERED (id) - WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) - ON [PRIMARY] -) -ON [PRIMARY] -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'主键', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'租户id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'tenant_id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'父id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'parent_id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'部门id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'dept_id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'用户id', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'user_id' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'值', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'tree_name' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'版本', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'version' -GO - -EXEC sys.sp_addextendedproperty - 'MS_Description', N'创建部门' , - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'create_dept' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'创建时间', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'create_time' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'创建人', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'create_by' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'更新时间', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'update_time' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'更新人', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'update_by' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'删除标志', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree', - 'COLUMN', N'del_flag' -GO - -EXEC sp_addextendedproperty - 'MS_Description', N'测试树表', - 'SCHEMA', N'dbo', - 'TABLE', N'test_tree' -GO - -INSERT sys_user VALUES (3, N'000000', 108, N'test', N'本部门及以下 密码666666', N'sys_user', N'', N'', N'0', NULL, N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), 3, getdate(), NULL); -GO -INSERT sys_user VALUES (4, N'000000', 102, N'test1', N'仅本人 密码666666', N'sys_user', N'', N'', N'0', NULL, N'$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', N'0', N'0', N'127.0.0.1', getdate(), 103, 1, getdate(), 4, getdate(), NULL); -GO - -INSERT sys_menu VALUES (5, N'测试菜单', 0, 5, N'demo', NULL, 1, 0, N'M', N'0', N'0', NULL, N'star', 103, 1, getdate(), NULL, NULL, N''); -GO - -INSERT sys_menu VALUES (1500, N'测试单表', 5, 1, N'demo', N'demo/demo/index', 1, 0, N'C', N'0', N'0', N'demo:demo:list', N'#', 103, 1, getdate(), NULL, NULL, N'测试单表菜单'); -GO -INSERT sys_menu VALUES (1501, N'测试单表查询', 1500, 1, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:query', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1502, N'测试单表新增', 1500, 2, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:add', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1503, N'测试单表修改', 1500, 3, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:edit', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1504, N'测试单表删除', 1500, 4, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:remove', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1505, N'测试单表导出', 1500, 5, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:demo:export', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO - -INSERT sys_menu VALUES (1506, N'测试树表', 5, 1, N'tree', N'demo/tree/index', 1, 0, N'C', N'0', N'0', N'demo:tree:list', N'#', 103, 1, getdate(), NULL, NULL, N'测试树表菜单'); -GO -INSERT sys_menu VALUES (1507, N'测试树表查询', 1506, 1, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:query', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1508, N'测试树表新增', 1506, 2, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:add', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1509, N'测试树表修改', 1506, 3, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:edit', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1510, N'测试树表删除', 1506, 4, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:remove', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO -INSERT sys_menu VALUES (1511, N'测试树表导出', 1506, 5, N'#', N'', 1, 0, N'F', N'0', N'0', N'demo:tree:export', N'#', 103, 1, getdate(), NULL, NULL, N''); -GO - -INSERT sys_role VALUES (3, N'000000', N'本部门及以下', N'test1', 3, N'4', 1, 1, N'0', N'0', 103, 1, getdate(), 1, NULL, NULL); -GO -INSERT sys_role VALUES (4, N'000000', N'仅本人', N'test2', 4, N'5', 1, 1, N'0', N'0', 103, 1, getdate(), 1, NULL, NULL); -GO - -INSERT sys_role_menu VALUES (3, 1); -GO -INSERT sys_role_menu VALUES (3, 5); -GO -INSERT sys_role_menu VALUES (3, 100); -GO -INSERT sys_role_menu VALUES (3, 101); -GO -INSERT sys_role_menu VALUES (3, 102); -GO -INSERT sys_role_menu VALUES (3, 103); -GO -INSERT sys_role_menu VALUES (3, 104); -GO -INSERT sys_role_menu VALUES (3, 105); -GO -INSERT sys_role_menu VALUES (3, 106); -GO -INSERT sys_role_menu VALUES (3, 107); -GO -INSERT sys_role_menu VALUES (3, 108); -GO -INSERT sys_role_menu VALUES (3, 500); -GO -INSERT sys_role_menu VALUES (3, 501); -GO -INSERT sys_role_menu VALUES (3, 1001); -GO -INSERT sys_role_menu VALUES (3, 1002); -GO -INSERT sys_role_menu VALUES (3, 1003); -GO -INSERT sys_role_menu VALUES (3, 1004); -GO -INSERT sys_role_menu VALUES (3, 1005); -GO -INSERT sys_role_menu VALUES (3, 1006); -GO -INSERT sys_role_menu VALUES (3, 1007); -GO -INSERT sys_role_menu VALUES (3, 1008); -GO -INSERT sys_role_menu VALUES (3, 1009); -GO -INSERT sys_role_menu VALUES (3, 1010); -GO -INSERT sys_role_menu VALUES (3, 1011); -GO -INSERT sys_role_menu VALUES (3, 1012); -GO -INSERT sys_role_menu VALUES (3, 1013); -GO -INSERT sys_role_menu VALUES (3, 1014); -GO -INSERT sys_role_menu VALUES (3, 1015); -GO -INSERT sys_role_menu VALUES (3, 1016); -GO -INSERT sys_role_menu VALUES (3, 1017); -GO -INSERT sys_role_menu VALUES (3, 1018); -GO -INSERT sys_role_menu VALUES (3, 1019); -GO -INSERT sys_role_menu VALUES (3, 1020); -GO -INSERT sys_role_menu VALUES (3, 1021); -GO -INSERT sys_role_menu VALUES (3, 1022); -GO -INSERT sys_role_menu VALUES (3, 1023); -GO -INSERT sys_role_menu VALUES (3, 1024); -GO -INSERT sys_role_menu VALUES (3, 1025); -GO -INSERT sys_role_menu VALUES (3, 1026); -GO -INSERT sys_role_menu VALUES (3, 1027); -GO -INSERT sys_role_menu VALUES (3, 1028); -GO -INSERT sys_role_menu VALUES (3, 1029); -GO -INSERT sys_role_menu VALUES (3, 1030); -GO -INSERT sys_role_menu VALUES (3, 1031); -GO -INSERT sys_role_menu VALUES (3, 1032); -GO -INSERT sys_role_menu VALUES (3, 1033); -GO -INSERT sys_role_menu VALUES (3, 1034); -GO -INSERT sys_role_menu VALUES (3, 1035); -GO -INSERT sys_role_menu VALUES (3, 1036); -GO -INSERT sys_role_menu VALUES (3, 1037); -GO -INSERT sys_role_menu VALUES (3, 1038); -GO -INSERT sys_role_menu VALUES (3, 1039); -GO -INSERT sys_role_menu VALUES (3, 1040); -GO -INSERT sys_role_menu VALUES (3, 1041); -GO -INSERT sys_role_menu VALUES (3, 1042); -GO -INSERT sys_role_menu VALUES (3, 1043); -GO -INSERT sys_role_menu VALUES (3, 1044); -GO -INSERT sys_role_menu VALUES (3, 1045); -GO -INSERT sys_role_menu VALUES (3, 1500); -GO -INSERT sys_role_menu VALUES (3, 1501); -GO -INSERT sys_role_menu VALUES (3, 1502); -GO -INSERT sys_role_menu VALUES (3, 1503); -GO -INSERT sys_role_menu VALUES (3, 1504); -GO -INSERT sys_role_menu VALUES (3, 1505); -GO -INSERT sys_role_menu VALUES (3, 1506); -GO -INSERT sys_role_menu VALUES (3, 1507); -GO -INSERT sys_role_menu VALUES (3, 1508); -GO -INSERT sys_role_menu VALUES (3, 1509); -GO -INSERT sys_role_menu VALUES (3, 1510); -GO -INSERT sys_role_menu VALUES (3, 1511); -GO -INSERT sys_role_menu VALUES (4, 5); -GO -INSERT sys_role_menu VALUES (4, 1500); -GO -INSERT sys_role_menu VALUES (4, 1501); -GO -INSERT sys_role_menu VALUES (4, 1502); -GO -INSERT sys_role_menu VALUES (4, 1503); -GO -INSERT sys_role_menu VALUES (4, 1504); -GO -INSERT sys_role_menu VALUES (4, 1505); -GO -INSERT sys_role_menu VALUES (4, 1506); -GO -INSERT sys_role_menu VALUES (4, 1507); -GO -INSERT sys_role_menu VALUES (4, 1508); -GO -INSERT sys_role_menu VALUES (4, 1509); -GO -INSERT sys_role_menu VALUES (4, 1510); -GO -INSERT sys_role_menu VALUES (4, 1511); -GO - -INSERT sys_user_role VALUES (3, 3); -GO -INSERT sys_user_role VALUES (4, 4); -GO - -INSERT test_demo VALUES (1, N'000000', 102, 4, 1, N'测试数据权限', N'测试', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (2, N'000000', 102, 3, 2, N'子节点1', N'111', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (3, N'000000', 102, 3, 3, N'子节点2', N'222', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (4, N'000000', 108, 4, 4, N'测试数据', N'demo', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (5, N'000000', 108, 3, 13, N'子节点11', N'1111', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (6, N'000000', 108, 3, 12, N'子节点22', N'2222', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (7, N'000000', 108, 3, 11, N'子节点33', N'3333', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (8, N'000000', 108, 3, 10, N'子节点44', N'4444', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (9, N'000000', 108, 3, 9, N'子节点55', N'5555', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (10, N'000000', 108, 3, 8, N'子节点66', N'6666', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (11, N'000000', 108, 3, 7, N'子节点77', N'7777', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (12, N'000000', 108, 3, 6, N'子节点88', N'8888', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_demo VALUES (13, N'000000', 108, 3, 5, N'子节点99', N'9999', 0, 103, getdate(), 1, NULL, NULL, 0); -GO - -INSERT test_tree VALUES (1, N'000000', 0, 102, 4, N'测试数据权限', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (2, N'000000', 1, 102, 3, N'子节点1', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (3, N'000000', 2, 102, 3, N'子节点2', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (4, N'000000', 0, 108, 4, N'测试树1', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (5, N'000000', 4, 108, 3, N'子节点11', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (6, N'000000', 4, 108, 3, N'子节点22', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (7, N'000000', 4, 108, 3, N'子节点33', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (8, N'000000', 5, 108, 3, N'子节点44', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (9, N'000000', 6, 108, 3, N'子节点55', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (10, N'000000', 7, 108, 3, N'子节点66', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (11, N'000000', 7, 108, 3, N'子节点77', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (12, N'000000', 10, 108, 3, N'子节点88', 0, 103, getdate(), 1, NULL, NULL, 0); -GO -INSERT test_tree VALUES (13, N'000000', 10, 108, 3, N'子节点99', 0, 103, getdate(), 1, NULL, NULL, 0); -GO diff --git a/script/sql/update/update20241227.sql b/script/sql/update/update20241227.sql deleted file mode 100644 index e69de29b..00000000 diff --git a/script/sql/update/update_20250111.sql b/script/sql/update/update_20250111.sql new file mode 100644 index 00000000..dba02da3 --- /dev/null +++ b/script/sql/update/update_20250111.sql @@ -0,0 +1,49 @@ +/* + Navicat Premium Dump SQL + + Source Server : ruoyi-ai + Source Server Type : MySQL + Source Server Version : 50740 (5.7.40-log) + Source Host : 120.0.0.1:3306 + Source Schema : ruoyi-ai + + Target Server Type : MySQL + Target Server Version : 50740 (5.7.40-log) + File Encoding : 65001 + + Date: 11/02/2025 16:06:27 +*/ + +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); + +SET FOREIGN_KEY_CHECKS = 1;