初始化

This commit is contained in:
fbc
2022-09-22 18:53:40 +08:00
commit cd227d9239
8312 changed files with 1397870 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>accompany-base</artifactId>
<groupId>com.accompany</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>accompany-common</artifactId>
<packaging>jar</packaging>
</project>

View File

@@ -0,0 +1,18 @@
package com.accompany.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 登录校验,标记只注解的接口表示需要登录才能访问
*
* @see {@link com.accompany.web.interceptor.LoginInterceptor#preHandle}
*
* @author Administrator
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Authorization {
}

View File

@@ -0,0 +1,15 @@
package com.accompany.common.annotation;
import java.lang.annotation.*;
/**
* Vo字段中文注释注解
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface FieldComment {
String value() default "";
}

View File

@@ -0,0 +1,18 @@
package com.accompany.common.annotation;
import java.lang.annotation.*;
/**
* @Author yubin
* @Description 冻结用户注解,使用户不能使用金币等操作
* @Date 2019-06-04 09:50
*/
@Documented
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Frozen {
String value() default "";
}

View File

@@ -0,0 +1,14 @@
package com.accompany.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by yuanyi on 2019/2/23.
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface H5Authorization {
}

View File

@@ -0,0 +1,18 @@
package com.accompany.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 添加注解时需保证请求参数中有uid参数
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface MemberAuth {
/**
* 权限码
*/
String authCode();
}

View File

@@ -0,0 +1,20 @@
package com.accompany.common.annotation;
import java.lang.annotation.*;
/**
* @author yubin
* @since 2020-03-31
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ReplaceDomain {
/**
* 0 图片 1音频文件 2跳转地址
* @return
*/
int type() default 0;
}

View File

@@ -0,0 +1,131 @@
package com.accompany.common.aop;
import com.accompany.common.config.SystemConfig;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.MDC;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.UUID;
@Component
@Aspect
@Slf4j
@Order(-1)
public class ApiRequestLogAspect {
@Pointcut("(@annotation(org.springframework.web.bind.annotation.RequestMapping) || @annotation(org.springframework.web.bind.annotation.PostMapping) " +
"|| @annotation(org.springframework.web.bind.annotation.GetMapping) || @annotation(org.springframework.web.bind.annotation.PutMapping) " +
"|| @annotation(org.springframework.web.bind.annotation.DeleteMapping) || @annotation(org.springframework.web.bind.annotation.PatchMapping))")
public void logPointcut() {
}
@Around("logPointcut()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
MDC.put("trace_uuid", UUID.randomUUID().toString());
log.info("====== Api called start ======");
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
long start = System.currentTimeMillis();
String uri = request.getRequestURI();
try {
Object result = joinPoint.proceed();
logRequestInfo(joinPoint, request, uri);
if (result != null) {
if (SystemConfig.ApiLogConfig.notOutputResultUrls.contains(uri)) {
log.info("{} 配置了不打印返回结果日志", uri);
} else {
log.info("{} 返回结果: {}", uri, JSONObject.toJSONString(result));
}
} else {
log.info("{} 无需返回结果数据", uri);
}
return result;
} catch (Throwable e) {
logRequestInfo(joinPoint, request, uri);
log.error(uri + "出现异常", e);
throw e;
} finally {
long end = System.currentTimeMillis();
log.info("执行时间: " + (end - start) + " ms!");
log.info("====== Api called end ======");
}
}
private void logRequestInfo(ProceedingJoinPoint joinPoint, HttpServletRequest request, String uri) {
StringBuilder logMsgSb = new StringBuilder()
.append("请求url:").append(uri)
.append("\n请求方式:").append(request.getMethod())
.append("\n用户IP:").append(request.getRemoteAddr())
.append("\nCLASS_METHOD : ").append(joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().toShortString());
String requestHeader = getHeaderString(request);
if (StringUtils.isNotBlank(requestHeader)) {
logMsgSb.append("\n请求头").append(requestHeader);
}
String requestBodyContent = getRequestBodyContent(request);
if (StringUtils.isNotBlank(requestBodyContent)) {
logMsgSb.append("\n请求body").append(requestBodyContent);
}
String requestForm = getRequestFormString(request);
if (StringUtils.isNotBlank(requestForm)) {
logMsgSb.append("\n请求参数").append(requestForm);
}
log.info(logMsgSb.toString());
}
private String getRequestBodyContent(HttpServletRequest request) {
String requestBodyContent = StringUtils.EMPTY;
try {
requestBodyContent = IOUtils.toString(request.getInputStream());
} catch (IOException ex) {
log.error("获取requestBodyContent异常" + ex.getMessage());
}
return requestBodyContent;
}
private String getRequestFormString(HttpServletRequest request) {
String requestFormContent = StringUtils.EMPTY;
try {
requestFormContent =
request.getParameterMap().entrySet().stream()
.map(x -> x.getKey() + "=" + Arrays.toString(x.getValue()) + "&")
.reduce(String::concat)
.orElse(StringUtils.EMPTY);
} catch (Exception ex) {
log.error("获取requestFormContent异常", ex);
}
return requestFormContent;
}
private String getHeaderString(HttpServletRequest request) {
StringBuilder requestHeaderContent = new StringBuilder(StringUtils.EMPTY);
try {
Enumeration<String> headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
String headerName = headerNames.nextElement();
String headerValue = request.getHeader(headerName);
requestHeaderContent.append(headerName).append("=").append(headerValue).append("&");
}
} catch (Exception ex) {
log.error("获取请求头异常", ex);
}
return requestHeaderContent.toString();
}
}

View File

@@ -0,0 +1,31 @@
package com.accompany.common.aop;
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.annotation.Pointcut;
import org.slf4j.MDC;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.util.UUID;
@Component
@Aspect
@Slf4j
@Order(-2)
public class LogTraceAspect {
@Pointcut("@annotation(org.springframework.jms.annotation.JmsListeners) || @annotation(org.springframework.jms.annotation.JmsListener)")
public void jmsListenerPointcut() {
}
@Before("jmsListenerPointcut()")
public void doJmsListenerBefor(JoinPoint joinPoint) {
String traceId = UUID.randomUUID().toString();
log.info("为 {}.{} 设置日志跟踪id: {}", joinPoint.getSignature().getDeclaringTypeName(),joinPoint.getSignature().getName(), traceId);
MDC.put("trace_uuid", traceId);
}
}

View File

@@ -0,0 +1,43 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Lazy(value = false)
@Order(-1)
@Component
@ConfigurationProperties(prefix = "aliyun")
public class AliyunConfig {
public static String appSecret;
public static String appKey;
public static String endPoint;
public static String roleArn;
public static String regionId;
public static String product;
public void setAppSecret(String appSecret) {
AliyunConfig.appSecret = appSecret;
}
public void setAppKey(String appKey) {
AliyunConfig.appKey = appKey;
}
public void setEndPoint(String endPoint) {
AliyunConfig.endPoint = endPoint;
}
public void setRoleArn(String roleArn) {
AliyunConfig.roleArn = roleArn;
}
public void setRegionId(String regionId) {
AliyunConfig.regionId = regionId;
}
public void setProduct(String product) {
AliyunConfig.product = product;
}
}

View File

@@ -0,0 +1,35 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author yangziwen
* @description 阿里云实人认证配置类
* @date 2019-01-24
*/
@Component
@ConfigurationProperties(prefix = "aliyun.certification")
public class AliyunRPCertifyConfig {
public static String regionId;
public static String accessKeyId;
public static String accessKeySecret;
public static String bizCode;
public void setRegionId(String regionId) {
AliyunRPCertifyConfig.regionId = regionId;
}
public void setAccessKeyId(String accessKeyId) {
AliyunRPCertifyConfig.accessKeyId = accessKeyId;
}
public void setAccessKeySecret(String accessKeySecret) {
AliyunRPCertifyConfig.accessKeySecret = accessKeySecret;
}
public void setBizCode(String bizCode) {
AliyunRPCertifyConfig.bizCode = bizCode;
}
}

View File

@@ -0,0 +1,49 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "audit.media")
public class AuditMediaConfig {
public static String accessKey;
public static String appId;
public static String url;
public static String callBackUrl;
public static String queryUrl;
public static String closeUrl;
public void setAccessKey(String accessKey) {
AuditMediaConfig.accessKey = accessKey;
}
public void setAppId(String appId) {
AuditMediaConfig.appId = appId;
}
public void setUrl(String url) {
AuditMediaConfig.url = url;
}
public void setCallBackUrl(String callBackUrl) {
AuditMediaConfig.callBackUrl = callBackUrl;
}
public void setQueryUrl(String queryUrl) {
AuditMediaConfig.queryUrl = queryUrl;
}
public void setCloseUrl(String closeUrl) {
AuditMediaConfig.closeUrl = closeUrl;
}
}

View File

@@ -0,0 +1,28 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Lazy(value = false)
@Order(-1)
@Component
@ConfigurationProperties(prefix = "minigame")
public class MiniGameConfig {
public static String appId;
public static String appKey;
public static String appSecret;
public void setAppId(String appId) {
MiniGameConfig.appId = appId;
}
public void setAppKey(String appKey) {
MiniGameConfig.appKey = appKey;
}
public void setAppSecret(String appSecret) {
MiniGameConfig.appSecret = appSecret;
}
}

View File

@@ -0,0 +1,29 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "netease")
public class NetEaseConfig {
public static String neteaseAppKey;
public static String neteaseAppSecret;
public static Integer smsTemplateid;
public void setNeteaseAppKey(String neteaseAppKey) {
NetEaseConfig.neteaseAppKey = neteaseAppKey;
}
public void setNeteaseAppSecret(String neteaseAppSecret) {
NetEaseConfig.neteaseAppSecret = neteaseAppSecret;
}
public void setSmsTemplateid(Integer smsTemplateid) {
NetEaseConfig.smsTemplateid = smsTemplateid;
}
}

View File

@@ -0,0 +1,49 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
@Lazy(value = false)
@Order(-1)
@Configuration
@ConfigurationProperties(prefix = "qiniu")
public class QiNiuConfig {
public static String accessUrl;
public static String accessKey;
public static String secretKey;
public static String bucket;
public static Long expireSecond;
public static Integer detectMime;
public static String mimeLimit;
public void setAccessUrl(String accessUrl) {
this.accessUrl = accessUrl;
}
public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
public void setBucket(String bucket) {
this.bucket = bucket;
}
public void setExpireSecond(Long expireSecond) {
this.expireSecond = expireSecond;
}
public void setDetectMime(Integer detectMime) {
this.detectMime = detectMime;
}
public void setMimeLimit(String mimeLimit) {
this.mimeLimit = mimeLimit;
}
}

View File

@@ -0,0 +1,166 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
/**
* @author PaperCut
* @date 2018/2/3 系统参数配置
*/
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "system")
public class SystemConfig {
public static String secretaryUid;
public static String systemMessageUid;
public static String hallMessageUid;
public static String matchMessageUid;
public static List<String> userInfoCompleteInterceptWhiteList;
public static String domain;
/**
* 引流小组生成邀请码关联账号
*/
public static String flowTeamGenInviteCodeUid;
// 线性奖池中,可用的奖品线最小数
public static Long minAvailableLinearlyPoolLineCount = 2L;
public void setFlowTeamGenInviteCodeUid(String flowTeamGenInviteCodeUid) {
SystemConfig.flowTeamGenInviteCodeUid = flowTeamGenInviteCodeUid;
}
public void setDomain(String domain) {
SystemConfig.domain = domain;
}
public void setSecretaryUid(String secretaryUid) {
SystemConfig.secretaryUid = secretaryUid;
}
public void setSystemMessageUid(String systemMessageUid) {
SystemConfig.systemMessageUid = systemMessageUid;
}
public void setHallMessageUid(String hallMessageUid) {
SystemConfig.hallMessageUid = hallMessageUid;
}
public void setMatchMessageUid(String matchMessageUid) {
SystemConfig.matchMessageUid = matchMessageUid;
}
public void setUserInfoCompleteInterceptWhiteList(List<String> userInfoCompleteInterceptWhiteList) {
SystemConfig.userInfoCompleteInterceptWhiteList = userInfoCompleteInterceptWhiteList;
}
public void setMinAvailableLinearlyPoolLineCount(Long minAvailableLinearlyPoolLineCount) {
SystemConfig.minAvailableLinearlyPoolLineCount = minAvailableLinearlyPoolLineCount;
}
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "system.commission")
public static class Commission {
// 用户收礼物抽成
public static Double userPerRate;
// 房主抽成
public static Double roomOwnerPerRate;
// 个播主播收礼物抽成
public static Double singleUserPerRate;
// 个播主播所属公会会长分成比例
public static Double singleRoomOwnerPerRate;
// 非牌照房房主是否有抽成
public static Boolean notPermitRoomCommissionSwitch;
// 个播房普通用户收礼物分成
public static Double singleRoomNormalUserRate;
// 个播房普通用户收礼物时个播会长分成
public static Double singleRoomNormalUserHallOwnerRate;
public void setUserPerRate(Double userPerRate) {
Commission.userPerRate = userPerRate;
}
public void setRoomOwnerPerRate(Double roomOwnerPerRate) {
Commission.roomOwnerPerRate = roomOwnerPerRate;
}
public void setSingleUserPerRate(Double singleUserPerRate) {
Commission.singleUserPerRate = singleUserPerRate;
}
public void setSingleRoomOwnerPerRate(Double singleRoomOwnerPerRate) {
Commission.singleRoomOwnerPerRate = singleRoomOwnerPerRate;
}
public void setNotPermitRoomCommissionSwitch(Boolean notPermitRoomCommissionSwitch) {
Commission.notPermitRoomCommissionSwitch = notPermitRoomCommissionSwitch;
}
public void setSingleRoomNormalUserRate(Double singleRoomNormalUserRate) {
Commission.singleRoomNormalUserRate = singleRoomNormalUserRate;
}
public void setSingleRoomNormalUserHallOwnerRate(Double singleRoomNormalUserHallOwnerRate) {
Commission.singleRoomNormalUserHallOwnerRate = singleRoomNormalUserHallOwnerRate;
}
}
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "system.chargenotify")
public static class ChargeNotify {
public static String allChannelRobotKey;
public static String singlePersonChannelRobotKey;
public static String iapRefundRobotKey;
public static String iapConsumptionRequestRobotKey;
public static String iosPayUserToatlRobotKey;
public void setAllChannelRobotKey(String allChannelRobotKey) {
ChargeNotify.allChannelRobotKey = allChannelRobotKey;
}
public void setSinglePersonChannelRobotKey(String singlePersonChannelRobotKey) {
ChargeNotify.singlePersonChannelRobotKey = singlePersonChannelRobotKey;
}
public void setIapRefundRobotKey(String iapRefundRobotKey) {
ChargeNotify.iapRefundRobotKey = iapRefundRobotKey;
}
public void setIapConsumptionRequestRobotKey(String iapConsumptionRequestRobotKey) {
ChargeNotify.iapConsumptionRequestRobotKey = iapConsumptionRequestRobotKey;
}
public void setIosPayUserToatlRobotKey(String iosPayUserToatlRobotKey) {
ChargeNotify.iosPayUserToatlRobotKey = iosPayUserToatlRobotKey;
}
}
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "system.apilogconfig")
public static class ApiLogConfig {
public static List<String> notOutputResultUrls = Collections.emptyList();
public void setNotOutputResultUrls(List<String> notOutputResultUrls) {
ApiLogConfig.notOutputResultUrls = notOutputResultUrls;
}
}
}

View File

@@ -0,0 +1,28 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Lazy(value = false)
@Order(-1)
@Component
@ConfigurationProperties(prefix = "trtc")
public class TencentTRCTConfig {
public static Long sdkappid;
public static String secretkey;
public static Long expiretime;
public void setSdkappid(Long sdkappid) {
TencentTRCTConfig.sdkappid = sdkappid;
}
public void setSecretkey(String secretkey) {
TencentTRCTConfig.secretkey = secretkey;
}
public void setExpiretime(Long expiretime) {
TencentTRCTConfig.expiretime = expiretime;
}
}

View File

@@ -0,0 +1,50 @@
package com.accompany.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* @author yuanyi
* @date 2019/4/4
*/
@Data
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "web.security")
public class WebSecurityConfig {
public static String jwtWebKey;
public static String rsaWebPublicKey;
public static String rsaWebPrivateKey;
// 用户注册成功回调
private String userRegisterSuccessNotifyUrl;
private String userRegisterSuccessNotifyKey;
// 企业微信推送key
private String enterpriseWechatPushKey;
// 赛事报名通知企业微信推送key
private String gameQuotaEnterpriseWechatPushKey;
// 召唤战斗活动企业微信机器人key
private String actCallBattleEnterpriseWechatPushKey;
// 寻找小精灵企业微信机器人key
private String seekElfinEnterpriseWechatPushKey;
// 线性奖池提醒企业微信机器人key
private String linearylyPoolEnterpriseWechatPushKey;
public void setJwtWebKey(String jwtWebKey) {
WebSecurityConfig.jwtWebKey = jwtWebKey;
}
public void setRsaWebPublicKey(String rsaWebPublicKey) {
WebSecurityConfig.rsaWebPublicKey = rsaWebPublicKey;
}
public void setRsaWebPrivateKey(String rsaWebPrivateKey) {
WebSecurityConfig.rsaWebPrivateKey = rsaWebPrivateKey;
}
}

View File

@@ -0,0 +1,30 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "yiduncheck")
public class YidunCheckConfig {
public static String secretId;
public static String secretKey;
public static String businessId;
public void setSecretId(String secretId) {
YidunCheckConfig.secretId = secretId;
}
public void setSecretKey(String secretKey) {
YidunCheckConfig.secretKey = secretKey;
}
public void setBusinessId(String businessId) {
YidunCheckConfig.businessId = businessId;
}
}

View File

@@ -0,0 +1,65 @@
package com.accompany.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Component
@Lazy(value = false)
@Order(-1)
@ConfigurationProperties(prefix = "yidunimage")
public class YidunImageConfig {
public static String secretId;
public static String secretKey;
public static String businessId;
//相册
public static String albumBusinessId;
//头像
public static String profileBusinessId;
//动态图片
public static String dynamicBusinessId;
public static String roomAuditCallbackUrl;
//头像回调
public static String profileCallbackUrl;
//相册回调
public static String albumCallbackUrl;
public void setSecretId(String secretId) {
YidunImageConfig.secretId = secretId;
}
public void setSecretKey(String secretKey) {
YidunImageConfig.secretKey = secretKey;
}
public void setBusinessId(String businessId) {
YidunImageConfig.businessId = businessId;
}
public void setRoomAuditCallbackUrl(String roomAuditCallbackUrl) {
YidunImageConfig.roomAuditCallbackUrl = roomAuditCallbackUrl;
}
public void setAlbumBusinessId(String albumBusinessId) {
YidunImageConfig.albumBusinessId = albumBusinessId;
}
public void setProfileBusinessId(String profileBusinessId) {
YidunImageConfig.profileBusinessId = profileBusinessId;
}
public void setDynamicBusinessId(String dynamicBusinessId) {
YidunImageConfig.dynamicBusinessId = dynamicBusinessId;
}
public void setProfileCallbackUrl(String profileCallbackUrl) {
YidunImageConfig.profileCallbackUrl = profileCallbackUrl;
}
public void setAlbumCallbackUrl(String albumCallbackUrl) {
YidunImageConfig.albumCallbackUrl = albumCallbackUrl;
}
}

View File

@@ -0,0 +1,47 @@
package com.accompany.common.constant;
/**
* {这里添加描述}
*
* @author fangchengyan
* @date 2019-12-30 7:40 下午
*/
public enum AccountTypeEnum {
ALIPAY(Constant.WithdrawAccountType.ALIPAY, "支付宝"),
BANK(Constant.WithdrawAccountType.BANK, "银行卡"),
;
private byte type;
private String name;
AccountTypeEnum(byte type, String name) {
this.type = type;
this.name = name;
}
public byte getType() {
return type;
}
public String getName() {
return name;
}
public static AccountTypeEnum getByType(byte type) {
for(AccountTypeEnum accountTypeEnum : AccountTypeEnum.values()) {
if(type == accountTypeEnum.getType()) {
return accountTypeEnum;
}
}
return null;
}
public static String getNameByType(byte type) {
AccountTypeEnum accountTypeEnum = getByType(type);
return null == accountTypeEnum ? "" : accountTypeEnum.getName();
}
}

View File

@@ -0,0 +1,53 @@
package com.accompany.common.constant;
import java.util.Arrays;
import java.util.Optional;
/**
* Created By LeeNana on 2019/5/29.
*/
public enum ActRankTypeEnum {
RANK_RICH((byte) 1, "rich", "土豪榜"),
RANK_CHARM ((byte) 2, "charm", "明星榜"),
RANK_ROOM ((byte) 3, "room", "房间榜"),
RANK_MALE ((byte) 4, "male", "男神榜"),
RANK_FEMALE ((byte) 5, "female", "女神榜"),
RANK_TASK_NUM ((byte) 6, "task_num", "年中活动任务达人累计完成榜"),
RANK_SHINING((byte) 7, "shining","闪耀主播热度榜"),
RANK_FANS((byte) 8, "fans","吸粉狂人粉丝榜"),
RANK_LIKE((byte) 9, "like","声音瓶子心动值榜"),
;
private byte value;
private String key;
private String desc;
ActRankTypeEnum(byte value, String key, String desc) {
this.value = value;
this.key = key;
this.desc = desc;
}
public byte getValue() {
return value;
}
public String getKey() {
return key;
}
public String getDesc() {
return desc;
}
public static ActRankTypeEnum getByValue(byte value) {
Optional<ActRankTypeEnum> result = Arrays.stream(ActRankTypeEnum.values()).filter(rankTypeEnum ->
rankTypeEnum.value == value).findAny();
if (result.isPresent()) {
return result.get();
}
throw new RuntimeException("类型不匹配!");
}
}

View File

@@ -0,0 +1,50 @@
package com.accompany.common.constant;
import java.util.Arrays;
import java.util.Optional;
/**
* Created By LeeNana on 2019/6/28.
*/
public enum ActTypeEnum {
SPRING_FESTIVAL((byte)5, "spring_festival","春节活动"),
VALENTINE((byte)6, "valentine","情人节活动"),
WOMENDAY((byte)7, "womenday","少女节"),
PLANTINGTREES((byte)8, "plantingtrees","植树节"),
MIDYEAR((byte)9, "midyear","年中活动"),
VOICEBOTTLE((byte)10, "voice_bottle","声音瓶子活动"),
ANNUAL_CEREMONY((byte)11, "annual_ceremony", "2019年年度盛典"),
;
private byte value;
private String key;
private String desc;
ActTypeEnum(byte value, String key, String desc) {
this.value = value;
this.key = key;
this.desc = desc;
}
public byte getValue() {
return value;
}
public String getKey() {
return key;
}
public String getDesc() {
return desc;
}
public static ActTypeEnum getByValue(byte value) {
Optional<ActTypeEnum> result = Arrays.stream(ActTypeEnum.values()).filter(actTypeEnum ->
actTypeEnum.value == value).findAny();
if (result.isPresent()) {
return result.get();
}
throw new RuntimeException("类型不匹配!");
}
}

View File

@@ -0,0 +1,419 @@
package com.accompany.common.constant;
public class ActivityConf {
public static final String ACT_GIFT_LIST = "act_gift_list";
public static final String ACT_GOLD_RATE = "act_gold_rate";
/**
* 淘汰赛
*/
public static final String TT_RANK_TYPE = "tt_rank_type"; // 排行榜类型
public static final String TT_RANK_COUNT = "tt_rank_count"; // 排行榜人数
public static final String TT_RANK_START = "tt_rank_start"; // 开始时间
public static final String TT_RANK_END = "tt_rank_end"; // 结束时间
/**
* 半决赛
*/
public static final String BJ_RANK_TYPE = "bj_rank_type"; // 排行榜类型
public static final String BJ_RANK_COUNT = "bj_rank_count";
public static final String BJ_RANK_START = "bj_rank_start";
public static final String BJ_RANK_END = "bj_rank_end";
/**
* 总决赛
*/
public static final String ZJ_RANK_TYPE = "zj_rank_type"; // 排行榜类型
public static final String ZJ_RANK_COUNT = "zj_rank_count";
public static final String ZJ_RANK_START = "zj_rank_start";
public static final String ZJ_RANK_END = "zj_rank_end";
/**
* 2018情人节活动
*/
public static final String VD_RANK_START = "vd_rank_start";
public static final String VD_RANK_END = "vd_rank_end";
public static final String VD_RANK_GIFTS = "vd_rank_gifts";
public static final String VD_GIFT_GIFTID = "giftId";
public static final String VD_GIFT_SCORE = "score";
/**
* 2018新年活动
*/
public static final String SP_RANK_START = "sf_rank_start";
public static final String SP_RANK_END = "sf_rank_end";
public static final String SP_RANK_GIFTS = "sf_rank_gifts";
public static final String SP_GIFT_GIFTID = "giftId";
public static final String SP_GIFT_SCORE = "score";
public static final int TYPE_TTS = 1; // 淘汰赛
public static final int TYPE_BJS = 2; // 半决赛
public static final int TYPE_ZJS = 3; // 总决赛
public static final int RANK_RICH = 1; // 土豪榜
public static final int RANK_STAR = 2; // 明星榜
public static final int RANK_ROOM = 3; // 房间榜
/**
* pk网红活动
*/
public static final String PK_ACT_FIRST_START = "pk_act_first_start";
public static final String PK_ACT_FIRST_END = "pk_act_first_end";
public static final String PK_ACT_SECOND_START = "pk_act_second_start";
public static final String PK_ACT_SECOND_END = "pk_act_second_end";
public static class FamilyPkActStatus {
public static final Byte ready = 1; // 未开始
public static final Byte acting = 2; // 进行中
public static final Byte over = 3; // 结束
}
/**
* 当前执行的活动
*/
public static final String CUR_ACT_START = "cur_act_start";
public static final String CUR_ACT_END = "cur_act_end";
public static final String CUR_ACT_RANK_GIFTS = "cur_rank_gifts";
public static final String CUR_ACT_GIFT_GIFTID = "giftId";
public static final String CUR_ACT_GIFT_SCORE = "score";
/**
* vkiss暗号领取奖励活动
*/
public static final String VKISS_PRIZE_START = "vkiss_prize_start";
public static final String VKISS_PRIZE_END = "vkiss_prize_end";
public static final String VKISS_PRIZE_SINGLE_GIFTS = "vkiss_prize_single_gifts";
public static final String VKISS_PRIZE_CP_GIFTS = "vkiss_prize_cp_gifts";
public static class ActivityPackType {
public static final byte common = 1; //普通礼包
public static final byte special = 2; //特殊礼包
}
public static class ActivityPackStatus {
public static final byte valid = 1; //有效
public static final byte invalid = 2; //无效
}
public static class ActivityPackSource {
public static final byte user_buy = 1; //用户购买
public static final byte official = 2; //官方赠送
}
/**
* 圣诞树活动
*/
public static final String CHRISTMAS_TREE_START = "christmas_tree_start";
public static final String CHRISTMAS_TREE_END = "christmas_tree_end";
public static final String CHRISTMAS_TREE_RECEIVE_END = "christmas_tree_receive_end";
public static final String CHRISTMAS_TREE_REWARD_GIFT = "christmas_tree_reward_gift";
public static final String CHRISTMAS_TREE_GIFT_RULE = "christmas_tree_gift_rule";
/**
* 年终盛典榜单
*/
public static final String ANNUAL_WARMUP_BEGIN_TIME = "annual_warmup_begin_time";
public static final String ANNUAL_WARMUP_END_TIME = "annual_warmup_end_time";
public static final String ANNUAL_PROMOTION_BEGIN_TIME = "annual_promotion_begin_time";
public static final String ANNUAL_PROMOTION_END_TIME = "annual_promotion_end_time";
public static final String ANNUAL_FINAL_BEGIN_TIME = "annual_final_begin_time";
public static final String ANNUAL_FIANL_END_TIME = "annual_final_end_time";
public static final String ANNUAL_X_GIFT_ID = "x_gift_id";
public static final String ANNUAL_MALE_GIFT_ID = "male_gift_id";
public static final String ANNUAL_FEMALE_GIFT_ID = "female_gift_id";
public static final String ANNUAL_CP_GIFT_ID = "cp_gift_id";
public static final String ANNUAL_X_GIFT_TIMES = "x_gift_times";
public static class ActivityLikeType {
public static final byte ONLINE_SENSATION = 2; //网红
}
/**
* 活动类型
*/
public static class ActType {
public static Byte KTV_EXPORSURE = 1;// ktv预热
public static Byte WANGHONG = 2;// 网红预热
public static Byte HALLOWMAS = 3;// 万圣节分享礼物活动
public static Byte CHRISTMAS = 4; // 圣诞节活动
public static Byte SPRING_FESTIVAL = 5; // 春节活动
public static Byte VALENTINE = 6; // 情人节活动
public static Byte WOMENDAY = 7; // 少女节
public static Byte PLANTINGTREES = 8; // 植树节
public static Byte MIDYEAR = 9; // 年中活动
}
/**
* 榜单类型
*/
public static class RankType {
public static final Byte RANK_RICH = 1; // 土豪榜
public static final Byte RANK_CHARM = 2; // 明星榜
public static final Byte RANK_ROOM = 3; // 房间榜
public static final Byte RANK_CHARM_MALE = 4; // 男神榜
public static final Byte RANK_CHARM_FEMALE = 5; // 女神榜
}
/**
* 春节活动配置,开始时间,结束时间
*/
public static final String SPRING_FESTIVAL_START = "spring_festival_start";
public static final String SPRING_FESTIVAL_END = "spring_festival_end";
/**
* 情人节配置
*/
// public static final String VALENTINE_START = "valentine_start";
// public static final String VALENTINE_END = "valentine_end";
/**
* 活动进行状态
*/
public static class ActStatus {
public static final Byte NOT_YET_BEGIN = 0; // 未开始
public static final Byte ACT_SIGN_BEGIN = 1; // 报名活动开始
public static final Byte ACT_SIGN_END = 2; // 报名活动结束
public static final Byte ACT_VOTE_BEGIN = 3; // 投票活动开始
public static final Byte ACT_END = 4; // 活动结束
}
/**
* 投票活动
*/
//作品报名开始时间
public static final String ACT_SIGN_BEGIN_TIME = "act_sign_begin_time";
//作品报名结束时间
public static final String ACT_SIGN_END_TIME = "act_sign_end_time";
//作品投票开始时间
public static final String ACT_LIKE_BEGIN_TIME = "act_like_begin_time";
//作品投票结束时间
public static final String ACT_LIKE_END_TIME = "act_like_end_time";
/**
* 少女节配置
*/
public static final String WOMENDAY_START = "womenday_start";
public static final String WOMENDAY_END = "womenday_end";
public static final String WOMENDAY_SINGLE_GIFT = "womenday_single_gift";
public static final String WOMENDAY_SPECIAL_GIFT_RULE = "womenday_special_gift_rule";
public static final String PLANTINGTREES_START = "plantingtrees_start";
public static final String PLANTINGTREES_END = "plantingtrees_end";
public static final String PLANTINGTREES_RULES_1 = "plantingtrees_first_rule";
public static final String PLANTINGTREES_RULES_2 = "plantingtrees_second_rule";
public static final String PLANTINGTREES_RULES_3 = "plantingtrees_third_rule";
public static final String PLANTINGTREES_RULES_4 = "plantingtrees_fourth_rule";
public static class PlantingTreesId {
public static final Byte RULES1 = 1;
public static final Byte RULES2 = 2;
public static final Byte RULES3 = 3;
public static final Byte RULES4 = 4;
}
/**
* 活动奖励领取状态
*/
public static class ActAwardStatus {
public static final Byte NOT_ACCORD = 1; // 未符合条件
public static final Byte ACCORD = 2; // 符合条件
public static final Byte HAS_GIVEN = 3; // 已经领取
}
public static class ActAwardType {
public static final Byte gold = 1;
public static final Byte gift = 2;
public static final Byte car = 3;
public static final Byte headwear = 4;
public static final Byte key = 10;
public static final Byte noble = 11;
}
/**
* 萝卜促销活动活动
*/
public static final String RADISH_DRAW_STAR = "radish_draw_star"; // 活动开始时间
public static final String RADISH_DRAW_END = "radish_draw_end"; //活动结束时间
public static final String RADISH_DRAW_LIMIT_TOTAL = "radish_draw_limit_total"; // 每日萝卜支出预算值
/**
* 永恒之心购买活动
*/
public static final String ETERNAL_HEART_BUY_START = "eternal_heart_buy_start";
public static final String ETERNAL_HEART_BUY_END = "eternal_heart_buy_end";
public static final String ETERNAL_HEART_GIVE_GIFT = "eternal_heart_give_gift";
public static final String ETERNAL_HEART_BUY_GIFT = "eternal_heart_buy_gift";
/**
* 寻恋之旅活动配置
*/
public static class LoverActivityConf {
public static final String LOVER_ACTIVITY_START = "lover_activity_start";
public static final String LOVER_ACTIVITY_END = "lover_activity_end";
//赠送头饰礼物配置
public static final String LOVER_ACTIVITY_GIFTID = "lover_activity_giftID";
public static final String LOVER_ACTIVITY_MENGDONGID = "lover_activity_mengdongID";
public static final String LOVER_ACTIVITY_QDCKID = "lover_activity_qdckID";
public static final String LOVER_ACTIVITY_XXXYID = "lover_activity_xxxyID";
public static final String LOVER_ACTIVITY_ZSBYID = "lover_activity_zsbyID";
//收发礼物配置
public static final String LOVER_ACTIVITY_ROSE = "lover_activity_rose";
public static final String LOVER_ACTIVITY_XIONGZHANG = "lover_activity_xiongzhang";
public static final String LOVER_ACTIVITY_BOBONI = "lover_activity_boboni";
public static final String LOVER_ACTIVITY_BIXIN = "lover_activity_bixin";
public static final String LOVER_ACTIVITY_ETERNALHEART = "lover_activity_eternalHeart";
}
/**
* 夏日大作战活动
*/
public class MidYearActivityConfig {
/**
* 任务达人
*/
public static final String MID_YEAR_TASK_START = "mid_year_task_start";
public static final String MID_YEAR_TASK_END = "mid_year_task_end";
public static final String MID_YEAR_TASK_DRAW_SHOW_NUM = "mid_year_task_draw_show_num"; //任务奖品显示数量
public static final String MID_YEAR_TASK_DRAW = "mid_year_task_draw"; // 任务奖励
public static final String MID_YEAR_TASK_DRAW_DAY = "mid_year_task_draw_day"; //奖励的限定天数
public static final String MID_YEAR_TASK_DRAW_MSG = "mid_year_task_draw_msg"; //奖励发放小秘书提示
/**
* 嗨玩联盟
*/
public static final String MID_YEAR_PLAY_ALLIANCE_START = "mid_year_play_alliance_start";
public static final String MID_YEAR_PLAY_ALLIANCE_END = "mid_year_play_alliance_end";
/**
* 闪耀主播
*/
public static final String MID_YEAR_SHINING_ANCHOR_START = "mid_year_shining_anchor_start";
public static final String MID_YEAR_SHINING_ANCHOR_END = "mid_year_shining_anchor_end";
/**
* 喂粮cp档
*/
public static final String MID_YEAR_FEEDING_CP_START = "mid_year_feeding_cp_start";
public static final String MID_YEAR_FEEDING_CP_END = "mid_year_feeding_cp_end";
/**
* 吸粉狂人
*/
public static final String MID_YEAR_FANS_START = "mid_year_fans_start";
public static final String MID_YEAR_FANS_END = "mid_year_fans_end";
}
/**
* 声音瓶子活动
*/
public class VoiceBottleActConfig{
public static final String VOICE_BOTTLE_START = "voice_bottle_start";
public static final String VOICE_BOTTLE_END = "voice_bottle_end";
public static final String VIOCE_BOTTLE_TASK_RULE = "vioce_bottle_task_rule";
public static final String VIOCE_BOTTLE_DRAW = "vioce_bottle_draw";
public static final String VIOCE_BOTTLE_DAYS = "vioce_bottle_days";
}
public class DrawReceiveActType{
public static final int MID_YEAR = 1;
public static final int VOICE_BOTTLE = 2;
public static final int MID_AUTUMN = 3;
public static final int NATIONAL_DAY_FIREWORK = 4;
public static final int DOUBLE_ELEVEN = 5;
public static final int ANNUAL_CEREMONY = 6;
public static final int VALENTINE_DAY = 7;
public static final int NEW_YEAR = 8;
public static final int WOMEN_DAY = 9;
public static final int COUPLE = 10;
}
public class MidAutumnActConfig{
public static final String MID_AUTUMN_FESTIVAL_START = "mid_autumn_festival_start";
public static final String MID_AUTUMN_FESTIVAL_END = "mid_autumn_festival_end";
public static final String MID_AUTUMN_GOLD_NUM = "mid_autumn_gold_num";
public static final String MID_AUTUMN_SHARE_URL = "mid_autumn_share_url";
public static final String MID_AUTUMN_TASK_CAKE_NUM = "mid_autumn_task_cake_num";
public static final String MID_AUTUMN_TASK_DRAW_DAYS = "mid_autumn_task_draw_days";
public static final String MID_AUTUMN_TASK_DRAW = "mid_autumn_task_draw";
}
public class RegisterActConfig{
public static final String REGISTER_START = "register_start";
public static final String REGISTER_END = "register_end";
public static final String REGISTER_KEY_NUM = "register_key_num";
public static final String REGISTER_RECEIVE_USER_LIMIT = "register_receive_user_limit";
}
public class NationalDayActivity{
public static final String NATIONAL_DAY_START = "national_day_start";
public static final String NATIONAL_DAY_END = "national_day_end";
public static final String NATIONAL_DAY_TASK_PROGRESS = "national_day_task_progress";
public static final String NATIONAL_DAY_FIREWORKS_GOLD = "national_day_fireworks_gold";
public static final String NATIONAL_DAY_PRIZE_ID = "national_day_prize_id";
public static final String NATIONAL_DAY_SHARE_URL = "national_day_share_url";
public static final String NATIONAL_DAY_FIREWORK_LIMIT = "national_day_firework_limit";
public static final String NATIONAL_DAY_FIREWORK_GIFT_LIMIT = "national_day_firework_gift_limit";
}
public class DoubleElevenActivity{
public static final String DOUBLE_ELEVEN_START = "double_eleven_start";
public static final String DOUBLE_ELEVEN_END = "double_eleven_end";
public static final String DOUBLE_ELEVEN_GIFTID = "double_eleven_giftId";
public static final String DOUBLE_ELEVEN_ALL_PRICE = "double_eleven_all_price";
public static final String DOUBLE_ELEVEN_PRICE_DISCOUNT = "double_eleven_price_discount";
}
public class AnnualActtivity{
public static final String ANNUAL_CEREMONY_START = "annual_ceremony_start";
public static final String ANNUAL_CEREMONY_END = "annual_ceremony_end";
public static final String ANNUAL_CEREMONY_MALE_GIFT_IDS = "annual_ceremony_male_gift_ids";
public static final String ANNUAL_CEREMONY_FEMALE_GIFT_IDS = "annual_ceremony_female_gift_ids";
public static final String ANNUAL_CEREMONY_SPECIAL_GIFT = "annual_ceremony_special_gift";
public static final String ANNUAL_CEREMONY_SPECIAL_GIFT_VALUE = "annual_ceremony_special_gift_value";
public static final String ANNUAL_CEREMONY_SPECIAL_GIFT_GOLD = "annual_ceremony_special_gift_gold";
public static final String ANNUAL_CEREMONY_SPECIAL_GIFT_NUM = "annual_ceremony_special_gift_num";
public static final String ANNUAL_CEREMONY_APPOINT_ROOMID = "annual_ceremony_appoint_roomId";
public static final String ANNUAL_CEREMONY_TASK_START = "annual_ceremony_task_start";
public static final String ANNUAL_CEREMONY_TASK_END = "annual_ceremony_task_end";
public static final String ANNUAL_CEREMONY_TASK_PRIZE_ID = "annual_ceremony_task_prize_id";
public static final String ANNUAL_CEREMONY_TASK_PRIZE_DAY = "annual_ceremony_task_prize_day";
public static final String ANNUAL_CEREMONY_TASK_GOLD_GIFT_ID = "annual_ceremony_task_gold_gift_id";
public static final String ANNUAL_CEREMONY_TASK_RADISH_GIFT_ID = "annual_ceremony_task_radish_gift_id";
}
public class NewYearActivities {
public static final String NEW_YEAR_ACTIVITIES_START = "new_year_activities_start";
public static final String NEW_YEAR_ACTIVITIES_END = "new_year_activities_end";
public static final String NEW_YEAR_ACTIVITIES_PACK_ID = "new_year_activities_pack_id";
public static final String NEW_YEAR_ACTIVITIES_NOBLE_ID = "new_year_activities_noble_id";
public static final String NEW_YEAR_ACTIVITIES_NOBLE_PRICE = "new_year_activities_noble_price";
}
public class ValentineDayActivity {
public static final String VALENTINE_START = "valentine_start";
public static final String VALENTINE_END = "valentine_end";
public static final String VALENTINE_SINGLE_GIFT = "valentine_single_gift";
public static final String VALENTINE_SPECIAL_GIFT_RULE = "valentine_special_gift_rule";
}
public class CoupleActivity{
public static final String COUPLE_START = "couple_start";
public static final String COUPLE_END = "couple_end";
public static final String COUPLE_MATCH_END = "couple_match_end";
public static final String COUPLE_MATCH_AGE_LIMIT = "couple_match_age_limit";
public static final String COUPLE_MATCH_LEVEL_LIMIT = "couple_match_level_limit";
public static final String COUPLE_MATCH_SPECIAL_GIFT = "couple_match_special_gift";
public static final String COUPLE_PRIZE_ID = "couple_prize_id";
public static final String COUPLE_PRIZE_DAY= "couple_prize_day";
}
}

View File

@@ -0,0 +1,8 @@
package com.accompany.common.constant;
/**
* 主播粉丝团等级经验配置
*/
public class AnchorFansLevelExperienceArr {
public static Long exper[];
}

View File

@@ -0,0 +1,41 @@
package com.accompany.common.constant;
/**
* @Author: chucheng
* @Date: 2019/7/25 14:41
* @Description:
*/
public enum AppEnum {
tutu("tutu", "66"),
qingxun("qingxun", "66星球"),
PlanetStar("PlanetStar", "66星球"),
PlanetStar66("PlanetStar66", "66星球企业包"),
InterSpace("InterSpace", "66空间"),
planet("planet", "hello处cp"),
ear("ear", "侧耳"),
mj("mj", "马甲包"),
yinyou("yinyou", "大鹅开黑"),
yinyouEnterprise("yinyouEnterprise", "大鹅开黑企业包"),
yinbao("yinbao", "魔力"),
;
private String value;
private String desc;
AppEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

View File

@@ -0,0 +1,49 @@
package com.accompany.common.constant;
import java.util.Arrays;
import java.util.List;
/**
* @author yangziwen
* @description
* @date 2018/6/7 18:48
*/
public class ApplicationConstant {
public static final String EMPTY_JSON_OBJECT = "{}";
public static final String EMPTY_JSON_ARRAY = "[]";
public static final String NULL_JSON_OBJECT = "null";
public static final Integer DEFAULT_LOCK_WAIT_MILLIS = 5000;
public static final String DEFAULT_CHARSET = "UTF-8";
public static class PublicParameters {
public static final String SIGN = "pub_sign";
public static final String PUB_UID = "pub_uid";
public static final String UID = "uid";
public static final String TIMESTAMP = "pub_timestamp";
public static final String TICKET = "ticket";
public static final String PUB_TICKET = "pub_ticket";
public static final String APP_VERSION = "appVersion";
public static final String APP = "app";
public static final String DEVICE_ID = "deviceId";
public static final String MODEL = "model";
public static final String OS_VERSION = "osVersion";
public static final String OS = "os";
public static final String OS_ANDROID = "android";
public static final String OS_IOS = "ios";
public static final String APP_CHANNEL = "channel";
public static final String H5_TOKEN = "h5_token";
public static final String CLIENT = "client";
}
/**
* 公参名
*/
public static final List<String> PUBLIC_PARAMTER_NAMES = Arrays
.asList(new String[]{"pub_sign", "pub_uid", "pub_ticket", "appVersion", "appVersionCode", "channel", "deviceId", "ispType", "model", "netType", "os",
"osVersion", "app", "ticket", "client"});
}

View File

@@ -0,0 +1,44 @@
package com.accompany.common.constant;
/**
* Created by liuguofu on 2017/6/6.
*/
public class Attach {
private int first;
private int second;
private String message;
private Object data;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public int getFirst() {
return first;
}
public void setFirst(int first) {
this.first = first;
}
public int getSecond() {
return second;
}
public void setSecond(int second) {
this.second = second;
}
}

View File

@@ -0,0 +1,102 @@
package com.accompany.common.constant;
/**
* @author yangziwen
* @description 账单类型常量类.
* @date 2018/3/19 14:42
*/
public class BillTypeConstant {
// 充值
public static final Byte IN_RECHARGE = 1;
// 提现
public static final Byte OUT_WITHDRAW = 2;
// 拍卖
public static final Byte OUT_AUCTION = 3;
// 订单收入
public static final Byte IN_ORDER_INCOME = 4;
// 刷礼物支出
public static final Byte OUT_GIFT_PAY = 5;
// 收礼物收入
public static final Byte IN_GIFT_INCOME = 6;
// 发红包支出
public static final Byte OUT_RED_PACKET_PAY = 7;
// 收红包收入
public static final Byte IN_RED_PACKET_INCOME = 8;
// 房主佣金收入
public static final Byte IN_ROOM_OWNER_COMMISSION = 9;
// 注册送金币奖励
public static final Byte IN_REGISTER_REWARD = 10;
// 分享送金币奖励
public static final Byte IN_SHARE_REWARD = 11;
// 官方赠送金币
public static final Byte IN_OFFICAL_DONATE = 12;
// 关注公众号奖励金币
public static final Byte IN_FOLLOW_OFFICAL_ACCOUNT_REWARD = 13;
// 钻石兑换金币支出
public static final Byte OUT_EXCHANGE_DIAMOND_TO_GOLD_PAY = 14;
// 钻石兑换金币收入
public static final Byte IN_EXCHANGE_DIAMOND_TO_GOLD_INCOME = 15;
// 万圣节活动奖励
public static final Byte IN_HALLOWEEN_REWARD = 16;
// 活动奖励
public static final Byte IN_ACTIVITY_REWARD = 17;
// 打款至公司账号充值
public static final Byte IN_RECHARGE_BY_COMPANY_ACCOUNT = 20;
// 兑换码兑换金币
public static final Byte IN_REDEEM_CODE_EXCHANGE = 21;
// 促销活动得金币
public static final Byte IN_LUCKY_DRAW = 23;
// 发送的
public static Byte bonusPerDaySend = 24;
// 钻石回馈账单
public static Byte bonusPerDayRecv = 25;
// 开通贵族
public static final Byte OUT_OPEN_NOBLE = 26;
// 续费贵族
public static Byte OUT_RENEW_NOBLE = 27;
//public static Byte roomNoble = 28;
// 房间内开通贵族分成
public static final Byte IN_ROOM_NOBLE_COMMISSION = 28;
//public static Byte openNobleReturn = 29;
// 开通贵族返还
public static final Byte IN_OPEN_NOBLE_RETURN = 29;
//public static Byte renewNobleReturn = 30;
// 续费贵族
public static final Byte IN_RENEW_NOBLE_RETURN = 30;
//public static Byte purchaseCarGoods = 31;
// 购买座驾
public static final Byte OUT_BUY_CAR_GOODS = 31;
//public static Byte renewCarGoods = 32;
// 续费座驾
public static Byte OUT_RENEW_CAR_GOODS = 32;
}

View File

@@ -0,0 +1,17 @@
package com.accompany.common.constant;
/**
* Created by chucheng on 2019/2/14.
*/
public class ExtendsAttach extends Attach{
private Integer id;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}

View File

@@ -0,0 +1,246 @@
package com.accompany.common.constant;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* @author yangziwen
* @description
* @date 2018/6/29 14:58
*/
public class FamilyConstant {
/**
* 家族审批类型
*/
public static class ApproveStatus {
/**
* 加入家族/群聊待处理
*/
public static final Byte PENDING = 1;
/**
* 同意加入家族/群聊
*/
public static final Byte AGREE = 2;
/**
* 拒绝加入家族/群聊
*/
public static final Byte REJECT = 3;
/**
* 申请过期
*/
public static final Byte EXPIRE = 4;
/**
* 同意家族待加入群聊
*/
public static final Byte GROUP_PENDING = 5;
/**
* 同意加入家族同意加入群聊
*/
public static final Byte GROUP_AGREE = 6;
/**
* 同意加入家族拒绝加入群聊
*/
public static final Byte GROUP_REJECT = 7;
}
/**
* 家族验证类型
*/
public static class ApproveType {
public static final Byte WITHOUT_APPROVE = 0;
public static final Byte WITH_APPROVE = 1;
}
/**
* 家族成员状态
*/
public static class MemberStatus {
public static final Byte LEAVE = 0;
public static final Byte STAY = 1;
}
/**
* 是否被提出标志
*/
public static class KickOut {
public static final Byte NO = 0;
public static final Byte YES = 1;
}
/**
* 家族职位
*/
public static class Position {
public static final Byte ORDINARY_MEMBER = 0;
public static final Byte LEADER = 10;
}
/**
* 家族消息动作类型
*/
public static class ActionType {
/**
* 创建家族
*/
public static final Byte CREATE_FAMILY = 1;
/**
* 加入家族
*/
public static final Byte JOIN_FAMILY = 2;
/**
* 退出家族
*/
public static final Byte QUIT_FAMILY = 3;
/**
* 踢出家族
*/
public static final Byte KICK_OUT_FAMILY = 4;
/**
* 解散家族
*/
public static final Byte DISMISS_FAMILY = 5;
/**
* 加入群聊
*/
public static final Byte JOIN_GROUP = 6;
/**
* 退出群聊
*/
public static final Byte QUIT_GROUP = 7;
/**
* 加入家族并加入群
*/
public static final Byte JOIN_FAMILY_GROUP = 8;
/**
* 系统奖励家族币
*/
public static final Byte SYSTEM_AWARD = 9;
/**
* 系统扣除家族币
*/
public static final Byte SYSTEM_DISCOUNT = 10;
/**
* 交易家族币
*/
public static final Byte TRADE_MONEY = 11;
/**
* 贡献家族币
*/
public static final Byte DONATE_MONEY = 12;
}
/**
* 参数Key
*/
public static class ParamsKey {
public static final String UID = "uid";
public static final String ACTION_TYPE = "actionType";
public static final String FAMILY_ID = "familyId";
public static final String INVITE_ID = "inviteId";
public static final String RECORD_ID = "recordId";
}
/**
* 手续费费率
*/
public static class FeeRate {
public static final BigDecimal RED_PACKET = new BigDecimal(0.05).setScale(2, RoundingMode.HALF_DOWN);
public static final BigDecimal GAME = new BigDecimal(0.01).setScale(2, RoundingMode.HALF_DOWN);
}
/**
* 红包限制
*/
public static class RedPacketLimit {
public static final BigDecimal MIN_AMOUNT = new BigDecimal(0.01);
public static final Integer MAX_NUM = 500;
public static final Integer MIN_NUM = 1;
}
/**
* 红包领取状态
*/
public static class RedPacketClaimStatus {
public static final Byte PROCESSING = 1;
public static final Byte RUN_OUT = 2;
public static final Byte EXPIRE = 3;
}
/**
* 用户领取红包状态
*/
public static class MemberRedPacketClaimStatus {
public static final Byte NOT_CLAIM = 1;
public static final Byte CLAIMED = 2;
public static final Byte EXPIRED = 3;
public static final Byte RUN_OUT = 4;
}
/**
* 家族币交易类型
*/
public static class TradeType {
//群红包收入
public static final Byte RED_PACKET_INCOME = 1;
//创建家族奖励
public static final Byte CREATE_FAMILY_REWARD = 2;
//家族奖励
public static final Byte FAMILY_REWARD = 3;
//贡献
public static final Byte CONTRIBUTE = 4;
//转让
public static final Byte TRANSFER = 5;
//红包支出
public static final Byte RED_PACKET_COST = 6;
//家族游戏
public static final Byte FAMILY_GAME_COST = 7;
//系统扣除
public static final Byte FAMILY_DISCOUNT = 8;
//红包退回
public static final Byte RED_PACKET_RETURN = 9;
}
/**
* 家族排行榜
*/
public static class FamilyRankType {
/**
* 星推荐排行榜
*/
public static final Byte STAR_RANK = 1;
/**
* 魅力值排行榜
*/
public static final Byte CHARM_RANK = 2;
}
/**
* 群组限制
*/
public static class GroupLimit {
//可创建群聊的最大数量
public static final int MAX_CHAT = 50;
//群聊最大人数
public static final int MAX_MEMBER = 200;
}
public static class DefaultAvatar{
//默认家族头像
public static final String FAMILY = "https://img.erbanyy.com/default_family_avatar.png";
//默认群头像
public static final String GROUP = "https://img.erbanyy.com/default_group_avatar.png";
}
public static final String KING_FAMILY_BACKGROUND = "https://img.erbanyy.com/king_family_background.png";
}

View File

@@ -0,0 +1,8 @@
package com.accompany.common.constant;
/**
* Created By LeeNana on 2019/12/25.
*/
public class FirstPageConstant {
public static final Integer HALF_HOUR_RANKS_ROOM_NUM = 1;
}

View File

@@ -0,0 +1,33 @@
package com.accompany.common.constant;
/**
* Created by yuanyi on 2018/10/23.
*/
public class GameConstant {
/**
* 娃娃机处理类型
*/
public static class UserDollOptType {
public static final Byte CATCH = 1;
public static final Byte CLICK = 2;
public static final Byte BECOME_DOLL = 3;
}
public static class UserDollDealType {
public static final Byte GIVE_UP = 1;
public static final Byte LIKE = 2;
}
public static class UserDollLinkType {
public static final Byte SINGLE_LINK = 1;
public static final Byte LOVE_LINK = 2;
}
public static class PlatformType {
public static final Byte APP = 1;
public static final Byte WEIXIN = 2;
}
public static class CatchResult {
public static final Byte GOAL = 1;
public static final Byte MISS = 2;
}
}

View File

@@ -0,0 +1,30 @@
package com.accompany.common.constant;
/**
* @author yangziwen
* @description 礼物相关常量类
* @date 2018/3/21 15:20
*/
public class GiftConstant {
/**
* 礼物类型:普通礼物
*/
public static final Byte GIFT_TYPE_COMMON = 1;
/**
* 礼物类型:魔法表情
*/
public static final Byte GIFT_TYPE_MAGIC = 2;
/**
* 礼物/魔法接收方类型: 用户
*/
public static final Byte RECEIVER_TYPE_USER = 1;
/**
* 礼物/魔法接收方类型: 怪兽
*/
public static final Byte RECEIVER_TYPE_MONSTER = 2;
}

View File

@@ -0,0 +1,37 @@
package com.accompany.common.constant;
/**
* @author yangziwen
* @description
* @date 2018/5/14 18:26
*/
public class HeadwearConstant {
public static class Status {
public static final Byte NORMAL = 1;
public static final Byte EXPIRED = 2;
}
public static class OptType {
public static final Byte PURCHASE = 1; // 购买座驾
public static final Byte RENEW = 2; // 续费座驾
public static final Byte EXPERIENCE = 3; // 座驾赠送体验
}
public static class BuyType {
// 购买
public static final byte PURCHASE = 1;
// 续费
public static final byte RENEW = 2;
}
public static class ComeFrom {
// 购买
public static final Byte BUY = 1;
// 用户赠送
public static final Byte USER_DONATE = 2;
// 官方赠送
public static final Byte OFFICIAL_DONATE = 3;
}
}

View File

@@ -0,0 +1,7 @@
package com.accompany.common.constant;
public class Level {
public static long exper[];
public static long charm[];
}

View File

@@ -0,0 +1,19 @@
package com.accompany.common.constant;
/**
* @author yangziwen
* @description
* @date 2018/3/19 17:45
*/
public class MQConstant {
// 赠送礼物队列
public static final String QUEUE_GIFT = "gift-queue";
// 开通或者续费规则队列
public static final String QUEUE_NOBLE = "noble-queue";
// 魔法表情队列名
public static final String QUEUE_MAGIC_GIFT = "magic-gift-queue";
}

View File

@@ -0,0 +1,136 @@
package com.accompany.common.constant;
/**
* 系统消息模板id
*/
public class MessageConstant {
/**
* 家族
*/
public static final Integer FAMILY = 23;
/**
* 家族消息 不带对话选项
*/
public static final Integer FAMILY_NOMAL = 1;
/**
* 家族消息 带对话选项的
*/
public static final Integer FAMILY_CHOICE = 2;
/**
* 话题消息
*
*/
public static final Integer WORLD = 23;
/**
* 话题消息 不带对话选项
*/
public static final Integer WORLD_NOMAL = 1;
/**
* 话题消息 带对话选项的
*/
public static final Integer WORLD_CHOICE = 2;
/**
* 话题消息
*/
public static final Integer WORLD_NEW = 51;
/**
* 选择状态
*/
public static final Integer CHOICE = 1;
/**
* 同意
*/
public static final Integer AGREE = 2;
/**
* 拒绝
*/
public static final Integer REJECT = 3;
/**
* 到期
*/
public static final Integer EXPIRE = 4;
/**
*
*/
public static final String HAVE_CLICK = "该成员曾经被踢出过家族";
/**
* 族长处理申请链接
*/
public static final String DEAL_APPLY = "/family/approve?recordId=";
public static final String ACCEPT_INVITE = "/family/invitation/accept";
/**
* 世界创建人处理申请链接
*/
public static final String WORLD_HANDLE_APPLY = "/world/approve";
/**
* 消息路由类型搭配routerValue使用
*/
public static class RouterType {
/**
* 房间页 routerValueuid
*/
public static final Byte ROOM = 1;
/**
* H5页面routerValue url
*/
public static final Byte H5 = 2;
/**
* 红包
*/
public static final Byte WALLET = 3;
/**
* 充值页
*/
public static final Byte RED_PACKAGE = 4;
/**
* 个人页routerValue: uid
*/
public static final Byte RECHARGE = 5;
/**
* 个人主页, routerValue: uid
*/
public static final Byte USER_HOME = 6;
/**
* 座驾, routerValue: 0装扮商城 或者 1车库
*/
public static final Byte CAR = 7;
/**
* 头饰routerValue: 0装扮商城 或者 1头饰库
*/
public static final Byte HEADWEAR = 8;
/**
* 家族币routerValue: familyId
*/
public static final Byte FAMILY_MONEY = 9;
/**
* 家族, routerValue: familyId
*/
public static final Byte FAMILY = 10;
/**
* 群组, routerValue: tid
*/
public static final Byte FAMILY_GROUP = 11;
/**
* 话题routerValue: worldId
*/
public static final Byte WORLD = 49;
}
}

View File

@@ -0,0 +1,24 @@
package com.accompany.common.constant;
/**
* Created by yuanyi on 2019/3/6.
* 监测常用类,专门用于己方后台监控及其余第三方常用类
*/
public class ObserveConstant {
public static final String BILI_CALLBACK_URL = "https://cm.bilibili.com/conv/api/conversion/ad/cb/v1";
// 操作系统类型
public static class OsType {
public static final String IOS = "1";
public static final String ANDROID = "2";
}
public static class ObserveType {
public static final Byte BAIDUXXL = 1; // 百度信息流
public static final Byte BILIBILI = 2; // B站
}
public static class ObserveChannel {
public static final String BAIDUXXL = "baiduxxl";
public static final String BILIBILI = "bilibili2";
}
}

View File

@@ -0,0 +1,42 @@
package com.accompany.common.constant;
import java.util.Arrays;
import java.util.Optional;
/**
* Created By LeeNana on 2019/9/21.
* 促销活动钥匙/锤子类型
*/
public enum OpenBoxKeyTypeEnum {
NORMAL(1, "金蛋锤子"),
DIAMOND(2, "至尊蛋锤子"),
;
private Integer value;
private String desc;
OpenBoxKeyTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public String getDesc() {
return desc;
}
public Integer getValue() {
return value;
}
public static OpenBoxKeyTypeEnum getByValue(Integer value) {
Optional<OpenBoxKeyTypeEnum> result = Arrays.stream(OpenBoxKeyTypeEnum.values()).filter(keyTypeEnum ->
keyTypeEnum.value == value).findAny();
if (result.isPresent()) {
return result.get();
}
throw new RuntimeException("类型不匹配!");
}
}

View File

@@ -0,0 +1,65 @@
package com.accompany.common.constant;
import java.math.BigDecimal;
/**
* @author yangziwen
* @description
* @date 2018/4/20 16:43
*/
public class PaymentConstant {
/** 钻石兑换现金利率 */
public static final BigDecimal DIAMOND_EXCHANGE_CASH_RATE = new BigDecimal(0.1);
/** 现金兑换钻石利率*/
public static final BigDecimal CASH_EXCHANGE_DIAMOND_RATE = new BigDecimal(10);
/**金币兑换现金利率*/
public static final BigDecimal GOLD_EXCHANGE_CASH_RATE = new BigDecimal(0.1);
/**购买凭证验证地址*/
public static final String IOS_PAY_CERTIFY_URL = "https://buy.itunes.apple.com/verifyReceipt";
/**测试的购买凭证验证地址*/
public static final String IOS_PAY_CERTIFY_URL_TEST = "https://sandbox.itunes.apple.com/verifyReceipt";
public static class TransferChannel {
//支付宝
public static final String ALIPAY = "alipay";
//微信
public static final String WX = "wx";
//微信公众号
public static final String WX_PUB = "wx_pub";
//微信小程序
public static final String WX_LITE = "wx_lite";
//银联电子代付
public static final String UNIONPAY = "unionpay";
//通联代付
public static final String ALLINPAY = "allinpay";
//京东代付
public static final String JDPAY = "jdpay";
//余额
public static final String BALANCE = "balance";
}
/**
* 付款类型,转账到个人用户为 b2c转账到企业用户为 b2bwx、wx_pub、wx_lite 和 balance 渠道的企业付款,仅支持 b2c
*/
public static class TransferType {
public static final String B2C = "b2c";
public static final String B2B = "b2b";
}
public static class Currency{
public static final String CNY = "cny";
}
public static class ChargeStatus{
public static final Byte PAYING = 1;
public static final Byte PAIED = 2;
public static final Byte EXCEPTION = 3;
public static final Byte TIMEOUT = 4;
}
}

View File

@@ -0,0 +1,15 @@
package com.accompany.common.constant;
public class PrivilegeConstant {
public static class NameplateRecordStatus {
public static final Integer NORMAL = 0;
public static final Integer RECALL = 1;
}
public static class HeadwearRecordStatus {
public static final Integer NORMAL = 0;
public static final Integer RECALL = 1;
}
}

View File

@@ -0,0 +1,45 @@
package com.accompany.common.constant;
/**
* Created by PaperCut on 2018/12/27.
* 房间推荐常量类
*/
public class RecommendConstant {
/**
* 房间推荐记录状态
* 1、已预定
* 2、已使用
* 3、已过期
* 4、已下架
*/
public static class RecordStatus {
public static final Byte ALREADY_BOOK = 1;
public static final Byte ALREADY_USING = 2;
public static final Byte ALREADY_EXPIRED = 3;
public static final Byte ALREADY_OBTAINED = 4;
}
/**
* 房间推荐占用状态
* 1、已占用
* 2、取消占用
*/
public static class OccupyStatus {
public static final Byte ALREADY_OCCUPY = 1;
public static final Byte CANCEL_OCCUPY = 2;
}
/**
* 房间推荐卡状态
* 1、未使用
* 2、使用中
* 3、已使用
* 4、已过期(未使用)
*/
public static class CardStatus {
public static final Byte NOT_USED = 1;
public static final Byte ALREADY_USING = 2;
public static final Byte ALREADY_USED = 3;
public static final Byte ALREADY_EXPIRED = 4;
}
}

View File

@@ -0,0 +1,37 @@
package com.accompany.common.constant;
/**
* 2 * @Author: zhuct
* 3 * @Date: 2019/8/21 16:01
* 4
*/
public enum RoomMonitorTypeEnum {
ALL_ROOM((byte)0, "所有房间"),
GIVEN_ROOM((byte)1, "指定房间");
private byte value;
private String desc;
RoomMonitorTypeEnum(byte value, String desc) {
this.value = value;
this.desc = desc;
}
public byte getValue() {
return value;
}
public void setValue(byte value) {
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

View File

@@ -0,0 +1,25 @@
package com.accompany.common.constant;
/**
*性别常量
*/
public enum SexType {
MAEL(1), //男性
FEMAEL(2); //女性
Integer type;
SexType(Integer type) {
this.type = type;
}
public byte getType() {
return type.byteValue();
}
}

View File

@@ -0,0 +1,48 @@
package com.accompany.common.constant;
/**
* Created by PaperCut on 2018/7/23.
*/
public class SmsConstant {
/**
* 短信过期时间60秒
*/
public static final int SMS_EXPIRE_SECONDS = 60;
/**
* 验证码过期时间120秒
*/
public static final int SMS_CODE_EXPIRE_SECONDS = 60 * 2;
/**
* 短信发送间隔时间1分钟只能发1条
*/
public static final int SMS_SEND_INTERVAL_SECONDS = 60;
/**
* 验证码短信类型
*/
public static class SmsType {
public static final Byte REGISTER = 1;//注册
public static final Byte LOGIN = 2; //登录
public static final Byte RESET_LOGIN_PASSWORD = 3;//忘记登录密码
public static final Byte BINDING_PHONE = 4; //绑定手机
public static final Byte BINDING_ALIPAY = 5; //绑定支付宝
public static final Byte RESET_PAY_PASSWORD = 6; //重置支付密码
public static final Byte UNBINDING_PHONE = 7; //更换绑定手机号码
public static final Byte CERTIFICATION = 8; //实名认证
public static final Byte H5_BINDING_ALIPAY = 9; //h5绑定支付宝
public static final Byte SUPER_ADMIN_LOGIN = 10; //超管登录
public static final Byte BINDING_BANK_CARD = 11; //绑定提现银行卡
public static final Byte H5_BINDING_BANK_CARD = 12; //h5 绑定提现银行卡
}
/**
* 阿里云短信返回码
*/
public static class AliyunSmsResponseCode {
public static final String OK = "OK";
public static final String BUSINESS_LIMIT_CONTROL = "isv.BUSINESS_LIMIT_CONTROL";
}
}

View File

@@ -0,0 +1,39 @@
package com.accompany.common.constant;
import lombok.AllArgsConstructor;
/**
* @author yangming
* @since 2019-12-12
* 短信类型枚举
*/
@AllArgsConstructor
public enum SmsTypeEnum {
REGISTER(1,"注册验证码"),
LOGIN(2,"登录"),
RESET_LOGIN_PASSWORD(3,"忘记密码(客户端重置支付密码有用到)"),
BINDING_PHONE(4,"绑定手机"),
BINDING_ALIPAY(5,"绑定支付宝"),
RESET_PAY_PASSWORD(6,"重置支付密码"),
UNBINDING_PHONE(7,"更换绑定手机号码"),
CERTIFICATION(8,"实名认证"),
H5_BINDING_ALIPAY(9,"h5绑定支付宝"),
SUPER_ADMIN_LOGIN(10,"超管登录"),
BINDING_BANK_CARD(11,"绑定提现银行卡"),
H5_BINDING_BANK_CARD(12,"h5 绑定提现银行卡"),
RESET_PASSWORD_FOR_NO_LOGIN(13,"非登录态重置密码"),
RESET_PASSWORD_FOR_HAS_LOGIN(14,"登录态重置密码"),
;
public final int value;
public final String desc;
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

View File

@@ -0,0 +1,6 @@
package com.accompany.common.constant;
public class UserCpLevelArr {
public static Long secretVal[];
}

View File

@@ -0,0 +1,78 @@
package com.accompany.common.constant;
import java.util.Arrays;
import java.util.Optional;
/**
* 云信聊天室成员身份
*/
public enum UserRoomIdentityEnum {
/**
* CREATOR:聊天室创建者
*/
CREATOR((byte)1, "CREATOR"),
/**
* MANAGER:聊天室管理员
*/
MANAGER((byte)2, "MANAGER"),
/**
* COMMON:普通成员(固定成员)
*/
COMMON((byte)3, "COMMON"),
/**
* TEMPORARY:临时用户(非聊天室固定成员)
*/
TEMPORARY((byte)4, "TEMPORARY"),
/**
* ANONYMOUS:匿名用户(未注册账号)
*/
ANONYMOUS((byte)5, "ANONYMOUS"),
/**
* LIMITED:受限用户(黑名单+禁言)
*/
LIMITED((byte)6, "LIMITED"),
;
private byte type;
private String value;
UserRoomIdentityEnum(byte type, String value) {
this.type = type;
this.value = value;
}
public byte getType() {
return type;
}
public String getValue() {
return value;
}
public static UserRoomIdentityEnum getByType(byte type) {
Optional<UserRoomIdentityEnum> result = Arrays.stream(UserRoomIdentityEnum.values()).filter(userRoomIdentityEnum ->
userRoomIdentityEnum.type == type).findAny();
if (result.isPresent()) {
return result.get();
}
throw new RuntimeException("类型不匹配!");
}
public static UserRoomIdentityEnum getByValue(String value) {
Optional<UserRoomIdentityEnum> result = Arrays.stream(UserRoomIdentityEnum.values()).filter(userRoomIdentityEnum ->
userRoomIdentityEnum.value.equals(value)).findAny();
if (result.isPresent()) {
return result.get();
}
throw new RuntimeException("类型不匹配!");
}
}

View File

@@ -0,0 +1,19 @@
package com.accompany.common.constant;
/**
* 微信开启的支付方式
*
* @author linuxea
* @date 2019/8/8 16:02
*/
public enum WeXinPayTypeEnum {
/**
* app 支付
*/
APP,
/**
* 小程序支付
*/
MINI_APP
}

View File

@@ -0,0 +1,168 @@
package com.accompany.common.device;
/**
* Created by liuguofu on 2017/10/21.
*/
public class DeviceInfo {
private String os;
private String osVersion;
private String app;
private String ispType;
private String netType;
private String model;
private String appVersion;
private String imei;
private String deviceId;
private String channel;
private String linkedmeChannel;
private String idfa;
private String oaid;
private String oaidMd5;
private String androidId;
private String client;
public String getClient() {
return client;
}
public void setClient(String client) {
this.client = client;
}
public String getChannel() {
return channel;
}
public void setChannel(String channel) {
this.channel = channel;
}
public String getOs() {
return os;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public void setOs(String os) {
this.os = os;
}
public String getOsVersion() {
return osVersion;
}
public void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}
public String getApp() {
return app;
}
public void setApp(String app) {
this.app = app;
}
public String getIspType() {
return ispType;
}
public void setIspType(String ispType) {
this.ispType = ispType;
}
public String getNetType() {
return netType;
}
public String getLinkedmeChannel() {
return linkedmeChannel;
}
public void setLinkedmeChannel(String linkedmeChannel) {
this.linkedmeChannel = linkedmeChannel;
}
public void setNetType(String netType) {
this.netType = netType;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getAppVersion() {
return appVersion;
}
public void setAppVersion(String appVersion) {
this.appVersion = appVersion;
}
public String getImei() {
return imei;
}
public void setImei(String imei) {
this.imei = imei;
}
public String getIdfa() {
return idfa;
}
public void setIdfa(String idfa) {
this.idfa = idfa;
}
public String getOaid() {
return oaid;
}
public void setOaid(String oaid) {
this.oaid = oaid;
}
public String getOaidMd5() {
return oaidMd5;
}
public void setOaidMd5(String oaidMd5) {
this.oaidMd5 = oaidMd5;
}
public String getAndroidId() {
return androidId;
}
public void setAndroidId(String androidId) {
this.androidId = androidId;
}
@Override
public String toString() {
return "DeviceInfo{" +
"os='" + os + '\'' +
", osVersion='" + osVersion + '\'' +
", app='" + app + '\'' +
", ispType='" + ispType + '\'' +
", netType='" + netType + '\'' +
", model='" + model + '\'' +
", appVersion='" + appVersion + '\'' +
", imei='" + imei + '\'' +
", deviceId='" + deviceId + '\'' +
", channel='" + channel + '\'' +
", linkedmeChannel='" + linkedmeChannel + '\'' +
'}';
}
}

View File

@@ -0,0 +1,33 @@
package com.accompany.common.exception;
import com.accompany.common.status.BusiStatus;
/**
* Created by PaperCut on 2018/3/27.
*/
public class ApiException extends RuntimeException {
private int responseCode;
public ApiException(BusiStatus status) {
this(status.value(), status.getReasonPhrase());
}
public ApiException(int responseCode, String message) {
super(message);
this.responseCode = responseCode;
}
public ApiException(int responseCode, String message, Throwable cause) {
super(message, cause);
this.responseCode = responseCode;
}
public ApiException(int responseCode, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
this.responseCode = responseCode;
}
public int getResponseCode() {
return responseCode;
}
}

View File

@@ -0,0 +1,25 @@
package com.accompany.common.exception;
/**
* Created by PaperCut on 2018/2/3.
*/
public class BusinessException extends RuntimeException{
public BusinessException() {
}
public BusinessException(String message) {
super(message);
}
public BusinessException(String message, Throwable cause) {
super(message, cause);
}
public BusinessException(Throwable cause) {
super(cause);
}
public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

View File

@@ -0,0 +1,25 @@
package com.accompany.common.exception;
/**
* Created by PaperCut on 2018/3/15.
*/
public class NetEaseException extends RuntimeException {
public NetEaseException() {
}
public NetEaseException(String message) {
super(message);
}
public NetEaseException(String message, Throwable cause) {
super(message, cause);
}
public NetEaseException(Throwable cause) {
super(cause);
}
public NetEaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

View File

@@ -0,0 +1,49 @@
package com.accompany.common.filters;
import com.accompany.common.support.BodyReaderHttpServletRequestWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@Order(-1)
@WebFilter(filterName = "requestWrapperFilter", urlPatterns = "/*")
@Slf4j
public class RequestWrapperFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@SuppressWarnings("unchecked")
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
ServletRequest servletRequest = null;
if (request instanceof HttpServletRequest) {
log.info("wrap httpServletRequest use BodyReaderHttpServletRequestWrapper ");
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
if (request.getContentType() == null || !request.getContentType().contains("multipart/form-data")) {
servletRequest = new BodyReaderHttpServletRequestWrapper(httpServletRequest);
}
}
if (servletRequest != null) {
chain.doFilter(servletRequest, response);
} else {
chain.doFilter(request, response);
}
}
@Override
public void destroy() {
}
}

View File

@@ -0,0 +1,160 @@
package com.accompany.common.model;
/**
* 接口请求公共参数
*
* @author fangchengyan
* @date 2019-08-09 15:00
*/
public class CommonParamReq {
/** app名称 */
private String app;
/** app版本 */
private String appVersion;
/** 请求渠道 */
private String channel;
/** 设备号 */
private String deviceId;
/** 网络服务商 */
private String ispType;
/** 手机类型 */
private String model;
/** 网络类型 */
private String netType;
/** 操作系统 */
private String os;
/** 操作系统版本 */
private String osVersion;
/** 签名 */
private String pub_sign;
/** 请求时间 */
private String pub_timestamp;
/** 请求唯一标识 */
private String uuid;
public String getApp() {
return app;
}
public void setApp(String app) {
this.app = app;
}
public String getAppVersion() {
return appVersion;
}
public void setAppVersion(String appVersion) {
this.appVersion = appVersion;
}
public String getChannel() {
return channel;
}
public void setChannel(String channel) {
this.channel = channel;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getIspType() {
return ispType;
}
public void setIspType(String ispType) {
this.ispType = ispType;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getNetType() {
return netType;
}
public void setNetType(String netType) {
this.netType = netType;
}
public String getOs() {
return os;
}
public void setOs(String os) {
this.os = os;
}
public String getOsVersion() {
return osVersion;
}
public void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}
public String getPub_sign() {
return pub_sign;
}
public void setPub_sign(String pub_sign) {
this.pub_sign = pub_sign;
}
public String getPub_timestamp() {
return pub_timestamp;
}
public void setPub_timestamp(String pub_timestamp) {
this.pub_timestamp = pub_timestamp;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@Override
public String toString() {
return "CommonParamReq{" +
"app='" + app + '\'' +
", appVersion='" + appVersion + '\'' +
", channel='" + channel + '\'' +
", deviceId='" + deviceId + '\'' +
", ispType='" + ispType + '\'' +
", model='" + model + '\'' +
", netType=" + netType +
", os='" + os + '\'' +
", osVersion='" + osVersion + '\'' +
", pub_sign='" + pub_sign + '\'' +
", pub_timestamp='" + pub_timestamp + '\'' +
", uuid='" + uuid + '\'' +
'}';
}
}

View File

@@ -0,0 +1,56 @@
package com.accompany.common.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author yubin
* @Description 玩家信息
* @Date 2019/1/3 下午2:56
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class GamePlayer implements Serializable{
/**
* 用户uid
*/
private Long uid;
/**
* 用户昵称
*/
private String nick;
/**
* 用户性别1 男 2 女
*/
private Byte gender;
/**
* 头像
*/
private String avatar;
/**
* 用户创建的匹配房间
*/
private Long roomId;
/**
* 游戏地址
*/
private String gameUrl;
/**
* 开始匹配的时间
*/
private Long startMatchTime;
}

View File

@@ -0,0 +1,32 @@
package com.accompany.common.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author guojicong
* @Description
* @create 2022-06-16
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageReq {
@ApiModelProperty(value = "当前页从1开始最小1", required = false)
private Integer page = 1;
@ApiModelProperty(value = "每页条数默认10最小1", required = false)
private Integer pageSize = 10;
@ApiModelProperty(hidden = true)
public Integer getStartNum() {
return page <= 1 ? 0 : (page - 1) * pageSize;
}
@ApiModelProperty(hidden = true)
public Integer getEndNum() {
return this.getStartNum() + pageSize - 1;
}
}

View File

@@ -0,0 +1,47 @@
package com.accompany.common.netease;
import com.accompany.common.netease.util.CheckSumBuilder;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
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;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class Test {
public static void main(String[] args) throws Exception{
CloseableHttpClient httpClient = HttpClients.createDefault();
String url = "https://api.netease.im/nimserver/user/create.action";
HttpPost httpPost = new HttpPost(url);
String appKey = "";//NetEaseConstant.appKey;
String appSecret = "";// NetEaseConstant.appSecret;
String nonce = "12345";
String curTime = String.valueOf((new Date()).getTime() / 1000L);
String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce ,curTime);//参考 计算CheckSum的java代码
// 设置请求的header
httpPost.addHeader("AppKey", appKey);
httpPost.addHeader("Nonce", nonce);
httpPost.addHeader("CurTime", curTime);
httpPost.addHeader("CheckSum", checkSum);
httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
// 设置请求的参数
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("accid", "helloworld2"));
httpPost.setEntity(new UrlEncodedFormEntity(nvps, "utf-8"));
// 执行请求
HttpResponse response = httpClient.execute(httpPost);
// 打印执行结果
System.out.println(EntityUtils.toString(response.getEntity(), "utf-8"));
}
}

View File

@@ -0,0 +1,124 @@
package com.accompany.common.netease.neteaseacc;
import com.google.common.collect.Maps;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpGet;
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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by liuguofu on 2017/5/6.
*/
public class HttpBaseClient {
private static final Logger logger = LoggerFactory.getLogger(HttpBaseClient.class);
// protected HttpPost httpPost;
protected HttpGet httpGet;
CloseableHttpClient httpClient = HttpClients.createDefault();
/** tcp连接超时时间 */
private long connectionTimeoutMillis = 5000L;
/** tcp响应超时时间 */
private long readTimeoutMillis = 5000L;
public HttpBaseClient(String url) {
httpGet = new HttpGet(url);
//设置请求和传输超时时间
RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout((int) readTimeoutMillis).setConnectTimeout((int) connectionTimeoutMillis).build();
httpGet.setConfig(requestConfig);
// 设置请求的header
httpGet.addHeader("Host", "ip.taobao.com");
httpGet.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpGet.addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
httpGet.addHeader("Accept-Encoding", "gzip, deflate");
httpGet.addHeader("Accept-Language", "zh-CN,zh;q=0.9");
httpGet.addHeader("Cache-Control", "max-age=0");
httpGet.addHeader("Connection", "keep-alive");
httpGet.addHeader("Cookie",
"miid=5303757971142909086; thw=cn; t=f599fff5e61ee022b6bd2c6f3ddf3e74; cookie2=1bb49537193515edd05eb2c2d605dc2d; v=0; _tb_token_=3d3e47ef53756; cna=pJ6rEqz9gEUCATspo3DIXa65");
httpGet.addHeader("Host", "ip.taobao.com");
httpGet.addHeader("Upgrade-Insecure-Requests", "1");
httpGet.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36");
}
public String executePost() throws Exception {
HttpResponse response = httpClient.execute(httpGet);
InputStream is = response.getEntity().getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line);
}
} catch (IOException e) {
logger.error("executePost error..." + httpGet.getURI());
} finally {
try {
is.close();
} catch (IOException e) {
logger.error("executePost close is error..." + httpGet.getURI());
}
}
return sb.toString();
}
public String executePost2() throws IOException {
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
String respContent = EntityUtils.toString(entity, "GBK").trim();
return respContent;
}
public HttpBaseClient buildhttpGetParam(Map<String, Object> param) throws Exception {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
for (Map.Entry<String, Object> entry : param.entrySet()) {
Object value = entry.getValue();
if (value == null) {
continue;
}
nvps.add(new BasicNameValuePair(entry.getKey(), entry.getValue().toString()));
}
return this;
}
//{"code":200,"info":{"token":"c7f302b637099dc3039761ff3b45a21a","accid":"helloworld2","name":""}}
//{"desc":"already register","code":414}
public static void main(String args[]) throws Exception {
Map map = Maps.newHashMap();
// map.put("ip","125.80.227.221");
String strTest = "http://ip.taobao.com/service/getIpInfo.php?ip=125.80.227.221";
// HttpGet httpGet = new HttpGet(strTest);
// // 设置请求的header
// httpGet.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
// NetEaseBaseClient NetEaseBaseClient=new NetEaseBaseClient(url);
HttpBaseClient httpBaseClient = new HttpBaseClient(strTest);
String str = httpBaseClient.buildhttpGetParam(map).executePost();
Boolean bol = str.contains("中国");
System.out.println(str);
System.out.println(bol);
}
}

View File

@@ -0,0 +1,148 @@
package com.accompany.common.netease.neteaseacc;
import com.accompany.common.netease.neteaseacc.result.TokenRet;
import com.accompany.common.netease.util.CheckSumBuilder;
import com.accompany.common.utils.StringUtils;
import com.google.gson.Gson;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Created by liuguofu on 2017/5/6.
*/
public class NetEaseBaseClient {
private static final Logger logger = LoggerFactory.getLogger(NetEaseBaseClient.class);
protected HttpPost httpPost;
CloseableHttpClient httpClient = HttpClients.createDefault();
/** tcp连接超时时间 */
private long connectionTimeoutMillis = 5000L;
/** tcp响应超时时间 */
private long readTimeoutMillis = 5000L;
// @Deprecated
// public NetEaseBaseClient(String url) {
// httpPost = new HttpPost(url);
// String appKey = "";//NetEaseConstant.appKey;
// String appSecret = "";//NetEaseConstant.appSecret;
// String nonce = "12345";
// String curTime = String.valueOf((new Date()).getTime() / 1000L);
// String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce, curTime);//参考 计算CheckSum的java代码
//
// // 设置请求的header
// httpPost.addHeader("AppKey", appKey);
// httpPost.addHeader("Nonce", nonce);
// httpPost.addHeader("CurTime", curTime);
// httpPost.addHeader("CheckSum", checkSum);
// httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
// }
public NetEaseBaseClient(String appKey, String appSecret, String url) {
httpPost = new HttpPost(url);
String nonce = "12345";
String curTime = String.valueOf((new Date()).getTime() / 1000L);
//参考 计算CheckSum的java代码
String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce, curTime);
//设置请求和传输超时时间
RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout((int) readTimeoutMillis).setConnectTimeout((int) connectionTimeoutMillis).build();
httpPost.setConfig(requestConfig);
httpPost.setHeader(HttpHeaders.CONNECTION, "close");
// 设置请求的header
httpPost.addHeader("AppKey", appKey);
httpPost.addHeader("Nonce", nonce);
httpPost.addHeader("CurTime", curTime);
httpPost.addHeader("CheckSum", checkSum);
httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
}
public String executePost() throws Exception {
return executePost("");
}
public String executePost(String charsetName) throws Exception {
HttpResponse response = httpClient.execute(httpPost);
InputStream is = response.getEntity().getContent();
BufferedReader reader = null;
if (StringUtils.isNotEmpty(charsetName)) {
reader = new BufferedReader(new InputStreamReader(is, charsetName));
} else {
reader = new BufferedReader(new InputStreamReader(is));
}
StringBuilder sb = new StringBuilder();
String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line);
}
} catch (IOException e) {
logger.error("executePost error..." + httpPost.getURI());
} finally {
try {
is.close();
} catch (IOException e) {
logger.error("executePost close is error..." + httpPost.getURI());
}
if (response != null) {
EntityUtils.consumeQuietly(response.getEntity());
}
if(httpPost != null) {
httpPost.releaseConnection();
}
}
return sb.toString();
}
public String executePost2() throws IOException {
HttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
String respContent = EntityUtils.toString(entity, "GBK").trim();
return respContent;
}
public NetEaseBaseClient buildHttpPostParam(Map<String, Object> param) throws Exception {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
for (Map.Entry<String, Object> entry : param.entrySet()) {
Object value = entry.getValue();
if (value == null) {
continue;
}
nvps.add(new BasicNameValuePair(entry.getKey(), entry.getValue().toString()));
}
httpPost.setEntity(new UrlEncodedFormEntity(nvps, "utf-8"));
return this;
}
//{"code":200,"info":{"token":"c7f302b637099dc3039761ff3b45a21a","accid":"helloworld2","name":""}}
//{"desc":"already register","code":414}
public static void main(String args[]) {
String str = "{\"code\":200,\"info\":{\"token\":\"c7f302b637099dc3039761ff3b45a21a\",\"accid\":\"helloworld2\",\"name\":\"\"}}";
Gson gson = new Gson();
TokenRet map = gson.fromJson(str, TokenRet.class);
System.out.println();
}
}

View File

@@ -0,0 +1,87 @@
package com.accompany.common.netease.neteaseacc.constant;
/**
* Created by liuguofu on 2017/4/29.
*/
public enum NetEaseCode {
SUCCESS(200,"success"),//成功
CLIENT_ERROR(201,"客户端版本不对需升级sdk"),
BOLOCK(301,"被封禁"),
USER_PWD_ERROR(302,"用户名或密码错误"),
IP_ERROR(315,"IP限制"),
OAUTHILLEGA_ERROR(403,"非法操作或没有权限"),
OBJ_NOTFOUND(404,"对象不存在"),
TO_LONG_ERROR(405,"参数长度过长"),
READ_ONLY(406,"对象只读"),
REQ_TIMEOUT(408,"客户端请求超时"),
SMS_OAUTH_ERROR(413,"验证失败(短信服务)"),
PARAM_ERROR(414,"参数错误"),
NET_ERROR(415,"客户端网络问题"),
TO_OFTEN(416,"频率控制"),
DUP_HANDEL(417,"重复操作"),
CHANNEL_ERROR(418,"通道不可用(短信服务)"),
OVER_NUM(419,"数量超过上限"),
ACC_BLOCK(422,"账号被禁用"),
DUP_HTTP_REQ(431,"HTTP重复请求"),
SERV_ERROR(500,"服务器内部错误"),
SERV_BUSY(503,"服务器繁忙"),
MSG_TIMEOUT(508,"消息撤回时间超限"),
INVALID_PROT(509,"无效协议"),
SERV_INVALID(514,"服务不可用"),
UNPACK_ERROR(998,"解包错误"),
PACK_ERROR(999,"打包错误"),
//群相关错误码
NUM_LIMIT(801,"群人数达到上限"),
OAUTH_ERROR(802,"没有权限"),
GROUP_NOTEXISTS(803,"群不存在"),
USER_NOTIN_GROUP(804,"用户不在群"),
GROUPTYPE_MISMATCH(805,"群类型不匹配"),
GROUPNUM_LIMIT(806,"创建群数量达到限制"),
GROUPMEM_ERROR(807,"群成员状态错误"),
APP_SUC(808,"申请成功"),
ALREADY_INGROUP(809,"已经在群内"),
INVITE_SUC(810,"邀请成功"),
// 音视频通话/白板相关错误码
CHAN_INVALID(9102,"通道失效"),
RESPONED_ERROR(9103,"已经在他端对这个呼叫响应过了"),
UNREACH_ERROR(11001,"通话不可达,对方离线状态"),
// 聊天室相关错误码
IMCONNECT_ERROR(13001,"IM主连接状态异常"),
IMROOM_ERROR(13002,"聊天室状态异常"),
BLACKLISTACC(13003,"账号在黑名单中,不允许进入聊天室"),
CHATFORBIN(13004,"在禁言列表中,不允许发言"),
// 特定业务相关错误码
EMAIL_ERROR(10431,"输入email不是邮箱"),
PHONE_ERROR(10432,"输入mobile不是手机号码"),
PWD_DUPERROR(10433,"注册输入的两次密码不相同"),
COMPANY_NOTEXISTS(10434,"企业不存在"),
ACCPWD_ERROR(10435,"登陆密码或账号不对"),
APP_NOTEXISTS(10436,"app不存在"),
EMAIL_EXISTS(10437,"email已注册"),
PHONE_EXISTS(10438,"手机号已注册"),
APP_NAME_EXISTS(10441,"app名字已经存在");
private final int value;
private final String msg;
private NetEaseCode(int value, String msg) {
this.value = value;
this.msg = msg;
}
public int value() {
return this.value;
}
public String getMsg() {
return msg;
}
@Override
public String toString() {
return Integer.toString(value);
}
}

View File

@@ -0,0 +1,23 @@
package com.accompany.common.netease.neteaseacc.model;
public class QueueItem {
private String key;
private String val;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getVal() {
return val;
}
public void setVal(String val) {
this.val = val;
}
}

View File

@@ -0,0 +1,8 @@
package com.accompany.common.netease.neteaseacc.result;
/**
* Created by liuguofu on 2017/5/9.
*/
public class AccountRet extends BaseNetEaseRet {
}

View File

@@ -0,0 +1,24 @@
package com.accompany.common.netease.neteaseacc.result;
/**
* Created by liuguofu on 2017/5/9.
*/
public class BaseNetEaseRet{
private String desc;
private int code;
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}

View File

@@ -0,0 +1,30 @@
package com.accompany.common.netease.neteaseacc.result;
/**
* Created by liuguofu on 2017/5/21.
*/
public class CloseRoomRet{
/**
*{
"desc": {
"roomid": 13,
"valid": true,
"announcement": "这是聊天室",
"name": "myChatroom",
"broadcasturl": "http://www.xxxx.com/xxxxxx",
"ext": "",
"creator": "zhangsan"
},
"code": 200
}
*/
private int code;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}

View File

@@ -0,0 +1,25 @@
package com.accompany.common.netease.neteaseacc.result;
/**
* Created by liuguofu on 2017/7/17.
*/
public class FileUploadRet {
private int code;
private String url;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}

View File

@@ -0,0 +1,38 @@
package com.accompany.common.netease.neteaseacc.result;
import java.util.Map;
/**
* Created by liuguofu on 2017/4/29.
*/
public class NetEaseRet {
//{"code":200,"info":{"token":"c7f302b637099dc3039761ff3b45a21a","accid":"helloworld2","name":""}}
// {"desc":"already register","code":414}
private String desc;
private int code;
private Map<String,Object> info;
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public Map<String, Object> getInfo() {
return info;
}
public void setInfo(Map<String, Object> info) {
this.info = info;
}
}

View File

@@ -0,0 +1,27 @@
package com.accompany.common.netease.neteaseacc.result;
import java.util.List;
import java.util.Map;
public class QueueRet {
private int code;
private Map<String, List<Map<String,String>>> desc;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public Map<String, List<Map<String, String>>> getDesc() {
return desc;
}
public void setDesc(Map<String, List<Map<String, String>>> desc) {
this.desc = desc;
}
}

View File

@@ -0,0 +1,8 @@
package com.accompany.common.netease.neteaseacc.result;
/**
* Created by liuguofu on 2017/10/5.
*/
public class RoomOwnerSucRet {
private String desc;
}

View File

@@ -0,0 +1,28 @@
package com.accompany.common.netease.neteaseacc.result;
import java.util.Map;
/**
* Created by liuguofu on 2017/5/21.
*/
public class RoomRet extends BaseNetEaseRet {
/**
* "chatroom": {
"roomid": 66,
"valid": true,
"announcement": null,
"name": "mychatroom",
"broadcasturl": "xxxxxx",
"ext": "",
"creator": "zhangsan"
*/
private Map<String,Object> chatroom;
public Map<String, Object> getChatroom() {
return chatroom;
}
public void setChatroom(Map<String, Object> chatroom) {
this.chatroom = chatroom;
}
}

View File

@@ -0,0 +1,24 @@
package com.accompany.common.netease.neteaseacc.result;
import java.util.List;
import java.util.Map;
public class RoomUserListRet {
/**
* "roomList": [ { "roomid": 9931372, "level": 0, "nick": "111", "accid":
* "900243", "type": "CREATOR", "onlineStat": false, "ext": null, "avator":
* "https://nos.netease.com/nim/NDI3OTA4NQ==/bmltYV82MjE2NDUyMDVfMTQ5OTc2ODIwOTgzMl8wYjE3MWIxOC05YzU2LTQ2YWItOTVhNy03ZDNkNmE4ODI4ODY="
* } ] },
*/
private Map<String, List<Map<String, Object>>> desc;
public Map<String, List<Map<String, Object>>> getDesc() {
return desc;
}
public void setDesc(Map<String, List<Map<String, Object>>> desc) {
this.desc = desc;
}
}

View File

@@ -0,0 +1,21 @@
package com.accompany.common.netease.neteaseacc.result;
/**
* Created by liuguofu on 2017/6/6.
*/
public class RubbishRet {
private int code;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
@Override
public String toString() {
return "RubbishRet{" + "code=" + code + '}';
}
}

View File

@@ -0,0 +1,35 @@
package com.accompany.common.netease.neteaseacc.result;
/**
* Created by liuguofu on 2017/6/21.
*/
public class SmsRet {
private int code;
private String msg;
private String obj;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getObj() {
return obj;
}
public void setObj(String obj) {
this.obj = obj;
}
}

View File

@@ -0,0 +1,19 @@
package com.accompany.common.netease.neteaseacc.result;
import java.util.Map;
/**
* Created by liuguofu on 2017/5/9.
*/
public class TokenRet extends BaseNetEaseRet{
private Map<String,Object> info;
public Map<String, Object> getInfo() {
return info;
}
public void setInfo(Map<String, Object> info) {
this.info = info;
}
}

View File

@@ -0,0 +1,4 @@
package com.accompany.common.netease.neteaseacc.result;
public class UserInfoRet {
}

View File

@@ -0,0 +1,43 @@
package com.accompany.common.netease.util;
import java.security.MessageDigest;
/**
* Created by liuguofu on 2017/4/27.
*/
public class CheckSumBuilder {
// 计算并获取CheckSum
public static String getCheckSum(String appSecret, String nonce, String curTime) {
return encode("sha1", appSecret + nonce + curTime);
}
// 计算并获取md5值
public static String getMD5(String requestBody) {
return encode("md5", requestBody);
}
private static String encode(String algorithm, String value) {
if (value == null) {
return null;
}
try {
MessageDigest messageDigest
= MessageDigest.getInstance(algorithm);
messageDigest.update(value.getBytes());
return getFormattedText(messageDigest.digest());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private static String getFormattedText(byte[] bytes) {
int len = bytes.length;
StringBuilder buf = new StringBuilder(len * 2);
for (int j = 0; j < len; j++) {
buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);
buf.append(HEX_DIGITS[bytes[j] & 0x0f]);
}
return buf.toString();
}
private static final char[] HEX_DIGITS = { '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
}

View File

@@ -0,0 +1,203 @@
package com.accompany.common.netease.util;
//import com.accompany.common.utils.PropertyUtil;
/**
* Created by liuguofu on 2017/4/27.
*/
public class NetEaseConstant {
// public static final String appKey= PropertyUtil.getProperty("netEaseAppKey");
// public static final String appSecret=PropertyUtil.getProperty("netEaseAppSecret");
public static String basicUrl="https://api.netease.im/nimserver";
public static String smsBasicUrl="https://api.netease.im/sms";
public static final int smsCodeLen=5;
public static final int MAX_BATCH_SIZE=100;
// public static final int smsTemplateid=Integer.valueOf(PropertyUtil.getProperty("smsTemplateid"));
// public static final int SMSTEMPLATEID_ALARM=Integer.valueOf(PropertyUtil.getProperty("smsTemplateid"));
//66星球语音网易云短信配置
/**66星球语音appKey**/
// public static final String tutuAppKey = PropertyUtil.getProperty("tutuNetEaseAppKey");
// /**66星球语音appSecret**/
// public static final String tutuAppSecret = PropertyUtil.getProperty("tutuNetEaseAppSecret");
// /**66星球语音templateId**/
// public static final int tutuSmsTemplateid = Integer.valueOf(PropertyUtil.getProperty("tutuSmsTemplateid"));
//
// public static final Integer tutuInviteSmsTemplateid = Integer.valueOf(PropertyUtil.getProperty("tutuInviteSmsTemplateid"));
// public static final int tutuAlertSmsTemplateId = Integer.valueOf(PropertyUtil.getProperty("tutuAlertSmsTemplateId"));
public static class AccUrl{
public static String get="/user/getUinfos.action";
public static String create="/user/create.action";
public static String refreshToken="/user/refreshToken.action";
public static String block="/user/block.action";
public static String unblock="/user/unblock.action";
}
public static class UserUrl{
public static String get="/user/getUinfos.action";
public static String update="/user/update.action";
public static String updateUinfo="/user/updateUinfo.action";
public static String blackList="/user/listBlackAndMuteList.action";
public static String setSpecialRelation="/user/setSpecialRelation.action";
}
public static class FriendsUrl{
public static String friendAdd="/friend/add.action";
public static String friendDelete="/friend/delete.action";
}
public static class RoomUrl{
public static String create="/chatroom/create.action";
public static String get="/chatroom/get.action";
public static String update="/chatroom/update.action";
public static String sendMsg="/chatroom/sendMsg.action";
public static String toggleCloseStat="/chatroom/toggleCloseStat.action";
public static String setMemberRole="/chatroom/setMemberRole.action";
public static String addRobot="/chatroom/addRobot.action";
public static String removeRobot="/chatroom/removeRobot.action";
public static String temporaryMute="/chatroom/temporaryMute.action";
public static String membersByPage="/chatroom/membersByPage.action";
public static String membersList="/chatroom/queryMembers.action";
public static String queueDrop="/chatroom/queueDrop.action";
public static String queueList="/chatroom/queueList.action"; // 列出队列中的所有元素
public static String queueOffer="/chatroom/queueOffer.action"; // 往聊天室有序队列中新加或更新元素
public static String queuePoll="/chatroom/queuePoll.action";
public static String getMembersInfo = "/chatroom/queryMembers.action";//获取一个或多个成员信息
public static String queueBatchUpdate = "/chatroom/queueBatchUpdateElements.action";//批量更新坑位信息
}
public static class SmsUrl{
public static String sendSms="/sendcode.action"; // 发送验证码短信
public static String smsVerify="/verifycode.action"; // 校验验证码
public static String sendTemplate="/sendtemplate.action"; // 发送通知类短信
}
public static class MsgUrl{
public static String sendMsg="/msg/sendMsg.action";
public static String sendBatchMsg="/msg/sendBatchMsg.action";
public static String broadcastMsg="/msg/broadcastMsg.action";
public static String sendAttachMsg="/msg/sendAttachMsg.action";
public static String sendBatchAttachMsg="/msg/sendBatchAttachMsg.action";
public static String uploadImg="/msg/upload.action";
}
public static class Room {
// 队列管理权限.默认0
public static final int queuelevel_all = 0; //所有人都有权限变更队列
public static final int queuelevel_admin = 1; //只有主播管理员才能操作变更
}
public static class RoomMemberType {
public static final int FIXED_MEMBER = 0; //固定成员
public static final int NO_FIXED_MEMBER = 1; //非固定成员
public static final int ONLINE_MEMBER = 2; //在线的固定成员
}
// 群聊云信API
public static class GroupChatUrl {
public static String createChat = "/team/create.action"; // 创建群
public static String removeChat = "/team/remove.action"; // 移除群
public static String updateChat = "/team/update.action"; // 更新群资料
public static String queryDetail = "/team/queryDetail.action"; // 获取群聊详细资料
public static String addMember = "/team/add.action"; //拉人入群
public static String leave = "/team/leave.action"; //主动退群
public static String kickMember = "/team/kick.action"; // 踢人出群
public static String addManager = "/team/addManager.action"; //新增管理员
public static String removeManager = "/team/removeManager.action"; // 移除管理员
public static String muteTeam = "/team/muteTeam.action"; // 修改消息提醒开关
public static String muteTlist = "/team/muteTlist.action"; // 禁言群成员
public static String query = "/team/query.action"; //查询群聊详细信息(可包含成员列表)
public static String changeOwner = "/team/changeOwner.action"; // 移交群主
}
/**
* 历史消息记录
*/
public static class HistoryMsgUrl {
/** 单聊云端历史消息查询 */
public static String sessionMsg = "/history/querySessionMsg.action";
/** 群聊云端历史消息查询 */
public static String teamMsg = "/history/queryTeamMsg.action";
/** 聊天室云端历史消息查询 */
public static String chatroomMsg = "/history/queryChatroomMsg.action";
}
/**
* 云信im聊天消息类型
*/
public static class CHAT_MSG_TYPE {
// 文本
public static String text = "TEXT";
// 图片
public static String picture = "PICTURE";
}
/**
* 易盾反垃圾校验结果
*/
public static class YIDUN_ANTI_BUS_TYPE {
/**
* 文本反垃圾
*/
public static Integer TEXT = 0;
/**
* 图片反垃圾
*/
public static Integer PIC = 1;
}
/**
* 易盾反垃圾校验结果
*/
public static class YIDUN_ANTI_ACTION {
/**
* 通过
*/
public static Integer PASS = 0;
/**
* 嫌疑
*/
public static Integer SUSPICION = 1;
/**
* 不通过
*/
public static Integer BLOCK = 2;
}
public static class YIDUN_ANTI_LABEL {
// 广告
public static Integer AD = 200;
// 谩骂
public static Integer HURL_INVECTIVES = 600;
// 其他
public static Integer OTHERS = 900;
// 色情
public static Integer SALACITY = 100;
// 涉政
public static Integer POLITICS = 500;
// 违禁
public static Integer VIOLATE = 400;
}
public static class YIDUN_ANTI_SUBLABEL {
// 广告-竞品
public static Integer AD_COMPETITOR = 200141;
// 其他-财产
public static Integer OTHERS_PROPERTY = 900142;
}
}

View File

@@ -0,0 +1,11 @@
package com.accompany.common.netease.util;
/**
* Created by liuguofu on 2017/4/28.
*/
public class NetEaseHttpUtil {
public static void getHttpClient(){
}
}

View File

@@ -0,0 +1,26 @@
package com.accompany.common.push;
import com.accompany.common.utils.HttpUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class EnterpriseWechatPush {
private static String URL_PREFIX = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=";
// 根据key 推送到相关的企业微信群
public void pushMessageByKey(String key,MarkdownMessage message) {
String url = URL_PREFIX + key;
log.info("EnterpriseWeChatPushService url: {}", url);
String content = message.toJsonString();
log.info("EnterpriseWeChatPushService content: {}", content);
try {
String response = HttpUtils.doPostForJson(url, content);
log.info("EnterpriseWeChatPushService response: {}", response);
} catch (Exception e) {
log.error("EnterpriseWeChatPushService error, {}", e.toString());
}
}
}

View File

@@ -0,0 +1,98 @@
package com.accompany.common.push;
import com.alibaba.fastjson.JSON;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 企业微信机器人markdown消息
*
* @author yangming
*/
public class MarkdownMessage {
private List<String> items = new ArrayList<String>();
public void add(String text) {
items.add(text);
}
public static String getBoldText(String text) {
return "**" + text + "**";
}
public static String getItalicText(String text) {
return "*" + text + "*";
}
public static String getLinkText(String text, String href) {
return "[" + text + "](" + href + ")";
}
public static String getImageText(String imageUrl) {
return "![image](" + imageUrl + ")";
}
public static String getHeaderText(int headerType, String text) {
if (headerType < 1 || headerType > 6) {
throw new IllegalArgumentException("headerType should be in [1, 6]");
}
StringBuffer numbers = new StringBuffer();
for (int i = 0; i < headerType; i++) {
numbers.append("#");
}
return numbers + " " + text;
}
public static String getReferenceText(String text) {
return "> " + text;
}
public static String getOrderListText(List<String> orderItem) {
if (orderItem.isEmpty()) {
return "";
}
StringBuffer sb = new StringBuffer();
for (int i = 1; i <= orderItem.size() - 1; i++) {
sb.append(String.valueOf(i) + ". " + orderItem.get(i - 1) + "\n");
}
sb.append(String.valueOf(orderItem.size()) + ". " + orderItem.get(orderItem.size() - 1));
return sb.toString();
}
public static String getUnorderListText(List<String> unorderItem) {
if (unorderItem.isEmpty()) {
return "";
}
StringBuffer sb = new StringBuffer();
for (int i = 0; i < unorderItem.size() - 1; i++) {
sb.append("- " + unorderItem.get(i) + "\n");
}
sb.append("- " + unorderItem.get(unorderItem.size() - 1));
return sb.toString();
}
public String toJsonString() {
Map<String, Object> result = new HashMap<String, Object>();
result.put("msgtype", "markdown");
Map<String, Object> markdown = new HashMap<String, Object>();
StringBuffer markdownText = new StringBuffer();
for (String item : items) {
markdownText.append(item + "\n");
}
markdown.put("content", markdownText.toString());
result.put("markdown", markdown);
return JSON.toJSONString(result);
}
}

View File

@@ -0,0 +1,49 @@
package com.accompany.common.redis;
import lombok.extern.slf4j.Slf4j;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.exceptions.JedisConnectionException;
import java.util.List;
/**
* @author liuguofu
*/
@Slf4j
public class JedisPoolManager {
private static final ThreadLocal<JedisPool> CURRENT_JEDIS_POOL = new ThreadLocal<JedisPool>();
private List<JedisPool> jedisPools;
public Jedis getJedis() {
for (int i = 0, size = jedisPools.size(); i < size; i++) {
JedisPool jedisPool = jedisPools.get(i);
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
if (jedis.isConnected()) {
CURRENT_JEDIS_POOL.set(jedisPool);
return jedis;
} else {
jedis.close();
log.error("Get jedis connection from pool but not connected.");
}
} catch (JedisConnectionException e) {
log.error("Get jedis connection from pool list index:{}", i, e);
if (jedis != null) {
log.warn("Return broken resource:" + jedis);
log.info("jedis close bef");
jedis.close();
}
}
}
return null;
}
public void setJedisPools(List<JedisPool> jedisPools) {
this.jedisPools = jedisPools;
}
}

View File

@@ -0,0 +1,21 @@
package com.accompany.common.redis;
public class RedisScript {
//params 红包map的key 红包索引的 key 领取者的key uid 红包id 到期时间
//返回状态 -1 已经领取 -2过期
public static final String RECIVE_RED_PACKET = "local uid = ARGV[1] " + "local reId = ARGV[2] "
+ "local indexKey = KEYS[1] " + "local mapKey = KEYS[2] " + "local reciveKey = KEYS[3] "
+ "local expire = ARGV[3] " + " " + "local hasRecive = redis.call('get',reciveKey) "
+ "if hasRecive == false or hasRecive == nil then "
+ " local redIndex = redis.call('rpop',indexKey) " + " "
+ " if redIndex== false or redIndex == nil then " + " return -2 " + " else "
+ " local value = redis.call('hget',mapKey,redIndex) "
+ " if value == false or value == nil then " + " return -2 " + " end "
+ " redis.call('hdel',mapKey,redIndex) " + " redis.call('set',reciveKey,uid) "
+ " redis.call('expireat',reciveKey,expire) " + " return value " + " end "
+ "else " + " return -1 " + "end ";
public static final int RECIVE_RED_PACKET_KEY_COUNT = 3;
}

View File

@@ -0,0 +1,79 @@
package com.accompany.common.result;
import com.accompany.common.status.BusiStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Created by liuguofu on 2017/4/30.
*/
@Data
@ApiModel("基础返回对象")
public class BusiResult<T> {
@ApiModelProperty("响应状态码")
private int code;
@ApiModelProperty("响应消息")
private String message;
@ApiModelProperty("响应数据")
private T data;
public BusiResult(BusiStatus status) {
this(status, status.getReasonPhrase(), null);
}
public BusiResult(BusiStatus status, T data) {
this.code = status.value();
this.message = status.getReasonPhrase();
this.data = data;
}
public BusiResult(BusiStatus status, String message, T data) {
this.code = status.value();
this.message = message;
this.data = data;
}
public BusiResult(Integer code, String message) {
this(code, message, null);
}
public BusiResult(int code, String message, T data) {
this.code = code;
this.message = message;
this.data = data;
}
public BusiResult(T data) {
this(BusiStatus.SUCCESS, data);
}
public void setBusiResult(BusiStatus status) {
this.code = status.value();
this.message = status.getReasonPhrase();
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
public T getData() {
return data;
}
public void setCode(int code) {
this.code = code;
}
public void setMessage(String message) {
this.message = message;
}
public void setData(T data) {
this.data = data;
}
}

View File

@@ -0,0 +1,76 @@
package com.accompany.common.result;
import com.accompany.common.status.BusiStatus;
/**
* Created by liuguofu on 2017/4/30.
*/
public class BusiResult2<T> {
private int code;
private String message;
private T data;
private long timestamp;
public BusiResult2(BusiStatus status) {
this(status, status.getReasonPhrase(), null);
}
public BusiResult2(BusiStatus status, T data) {
this.code = status.value();
this.message = status.getReasonPhrase();
this.data = data;
}
public BusiResult2(BusiStatus status, String message, T data) {
this.code = status.value();
this.message = message;
this.data = data;
}
public BusiResult2(int code, String message, T data) {
this.code = code;
this.message = message;
this.data = data;
}
public BusiResult2(T data) {
this(BusiStatus.SUCCESS, data);
}
public void setBusiResult(BusiStatus status) {
this.code = status.value();
this.message = status.getReasonPhrase();
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
public T getData() {
return data;
}
public void setCode(int code) {
this.code = code;
}
public void setMessage(String message) {
this.message = message;
}
public void setData(T data) {
this.data = data;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
}

View File

@@ -0,0 +1,60 @@
package com.accompany.common.result;
import com.accompany.common.model.PageReq;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author guojicong
* @Description
* @create 2022-06-16
*/
@Data
@ApiModel("分页对象")
public class PageResult<T> {
@ApiModelProperty(value = "当前页从1开始最小1")
private Integer offset = 1;
@ApiModelProperty(value = "每页条数")
private Integer limit = 10;
@ApiModelProperty(value = "总记录数")
private Integer total = 0;
@ApiModelProperty(value = "总页数")
private Integer pages = 0;
@ApiModelProperty(value = "记录对象")
private List<T> rows;
public PageResult() {
}
public PageResult(Page<T> page) {
this.offset = (int) page.getCurrent();
this.limit = (int) page.getSize();
this.total = (int) page.getTotal();
this.pages = (int) page.getPages();
this.rows = page.getRecords();
}
public PageResult(Page<?> page, List<T> records) {
this.offset = (int) page.getCurrent();
this.limit = (int) page.getSize();
this.total = (int) page.getTotal();
this.pages = (int) page.getPages();
this.rows = records;
}
public PageResult(PageReq req, Integer total, List<T> data) {
this.offset = req.getPage();
this.limit = req.getPageSize();
this.total = total;
this.pages = (total + req.getPageSize() - 1) / req.getPageSize();
this.rows = data;
}
}

View File

@@ -0,0 +1,83 @@
package com.accompany.common.result;
import com.accompany.common.status.BusiStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @USER: chenli
* @DATE: 2021/12/20 15:29
* @DESCRIPTION:
*/
@Data
@ApiModel("基础返回对象")
public class YidunBusiResult<T> {
@ApiModelProperty("响应状态码")
private int code;
@ApiModelProperty("响应消息")
private String msg;
@ApiModelProperty("响应数据")
private T data;
public YidunBusiResult(BusiStatus status) {
this(status, status.getReasonPhrase(), null);
}
public YidunBusiResult(BusiStatus status, T data) {
this.code = status.value();
this.msg = status.getReasonPhrase();
this.data = data;
}
public YidunBusiResult(BusiStatus status, String msg, T data) {
this.code = status.value();
this.msg = msg;
this.data = data;
}
public YidunBusiResult(Integer code, String msg) {
this(code, msg, null);
}
public YidunBusiResult(int code, String msg, T data) {
this.code = code;
this.msg = msg;
this.data = data;
}
public YidunBusiResult(T data) {
this(BusiStatus.SUCCESS, data);
}
public void setBusiResult(BusiStatus status) {
this.code = status.value();
this.msg = status.getReasonPhrase();
}
public int getCode() {
return code;
}
public T getData() {
return data;
}
public void setCode(int code) {
this.code = code;
}
public void setData(T data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}

View File

@@ -0,0 +1,825 @@
package com.accompany.common.status;
/**
* Created by liuguofu on 2017/4/28.
*/
public enum BusiStatus {
SUCCESS(200, "success"), //成功
NOTEXISTS(404, "不存在"),
NOAUTHORITY(401, "没有权限"),
FROZEN_USER(402, "账号已被冻结,请联系官方客服"),
ACCOUNT_ERROR(407,"用户账号异常,请联系官方客服"),//账号异常-账号被封
SERVERERROR(500, "大鹅开小差中~请稍后再试"),
SERVERBUSY(503, "大鹅开小差中~请稍后再试"),
SERVER_BUSY(503, "大鹅开小差中~请稍后再试"),
SERVICE_STOP(503, "服务临时中断,请稍安勿躁"),
ROOM_UNCHANGE(505, "请联系官方修改"),
REQUEST_FAST(1000, "请勿频繁请求"),
REQUEST_PARAM_ERROR(1000, "参数有误,请重试"),
ACTIVITYNOTSTART(3100, "活动未开始"),
ACTIVITYNOTEND(3200, "活动已结束"),
INVALID_SERVICE(199, "invalid service"),//服务不可用
SERVEXCEPTION(5000, "service exception"),
UNKNOWN(999, "unknown"),//未知错误
BUSIERROR(4000, "大鹅开小差中~请稍后再试"),
PARAMETERILLEGAL(1444, "参数非法"),
ILLEGAL_OPERATE(408,"非法操作或没有权限"),
ALERT_SUCCESS(1,"上报成功"),
ALERT_PARAMETER_ILLEGAL(-1,"必填参数为空"),
ALERT_FAIL(-2,"服务异常"),
ALERT_SIGN_FAIL(-3,"验证失败"),
PHONE_REGISTERED (1402, "手机号码已注册绑定"),
PHONE_UNREGISTERED (1403, "手机号码不存在,请先注册"),
USERNOTEXISTS(1404, "用户不存在"),
USERINFONOTEXISTS(1405, "补全个人信息之后才能开房哦!"),
NICK_TOO_LONG(1406, "昵称太长"),
NEEDLOGIN(1407, "需要登录"),
SMALL_THAN_EIGHTEEN(1408, "用户年龄小于18岁"),
USER_INCORRECT_PAYMENT_PASS(1409, "支付密码不正确"),
USER_INCORRECT_LOGIN_PASS(1410, "登录密码不正确"),
USER_LOGIN_PASS_NULL(1411,"用户登录密码为空"),
PHONE_HAS_MANY_ACCOUNTS(1412, "该手机号存在多个ID的绑定关系请输入用户ID进行操作"),
ILLEGAL_USER(1412, "非法用户"),
USER_NICK_EXISTED(1413, "用户昵称已存在"),
USER_NOT_COMPLETE_INFO(1415, "未完善用户信息"),
VIDEONOTEXISTS(1604, "该视频不存在"),
COLLECTEXISTS(1605, "collect exists"),
NOTLIKEONESELF(1500, "不能喜欢自己"),
WEEKNOTWITHCASHTOWNUMS(1600, "对不起,每周最多只能提现%s次"),
ALIAPYACCOUNTNOTEXISTS(16001, "请先填写支付宝账号"),
PRIVATEPHOTOSUPMAX(1700, "more than 8 albums"),
ROOMRUNNING(1500, "房间在运行中"),
ROOMRCLOSED(1501, "房间已经关闭"),
ROOMNOTEXIST(1502, "房间不存在"),
NOTHAVINGLIST(1600, "没有数据"),
OPENROOMFALSE(1503, "创建房间失败, 请稍后重试"),
AUCTCURDOING(2100, "已经在拍卖中了"),
AUCTCURLESSTHANMAXMONEY(2101, "出价低于当前最高价格"),
AUCTCURYOURSELFERROR(2102, "you can't auct yourself"),
PURSEMONEYNOTENOUGH(2103, "账户余额不足,请充值"),
DIAMONDNUMNOTENOUGH(2104, "钱包余额不足"),
REDPACKETNUMNOTENOUGH(2105, "红包金额不足"),
RED_PACKET_RATE_NOT_ENOUGH(2106, "分成红包占比不足"),
SENDGOLDNOTENOUGH(2107, "转赠金额超过金币余额"),
USER_IS_EMPTY(2108, "请输入手机号/大鹅开黑号"),
ORDERNOTEXISTS(3404, "密聊不存在"),
ORDERFINISHED(3100, "密聊已经结束"),
SMS_SEND_ERROR(4001, "短信发送失败"),
SMS_SEND_SUCCESS(200, "短信发送成功"),
PHONEINVALID(4002, "请输入正确的手机号码"),
SMSCODEERROR(4003, "短信验证码错误,请重新输入!"),
ILLEGAL_PHONE(4004, "非法手机号码"),
ORDER_TIME_OUT(4005, "订单超时,请重新支付"),
MICRONOTININVIATEDLIST(6000, "you are not in invited list"),
MICRONUMLIMIT(60001, "micro number limit"),
GOLODEXCHANGEDIAMONDNOTENOUGH(70001, "钻石余额不足"),
EXCHANGEINPUTERROR(70002, "输入错误请输入10的整数倍数"),
GIFTDOWNORNOTEXISTS(8000, "该礼物已下架,敬请期待更多礼物哦~"),
GIFT_IS_NOT_ALLOWED_TO_BE_SENT(8000, "该礼物不能送出~"), //客户端写死了8000否则无法提示
GIFTISEMPTY(8001, "礼物数量不够了哦~"),
GIFT_AMOUNT_NOT_ENOUGH(8002, "礼物价值不足"),
GIFTNOAUTHORITY(8401, "贵族等级不够哦~"),
GIFT_IS_NOT_EXIST(8404,"礼物不存在"),
GIFT_IS_EXIST(8405,"礼物已存在"),
TYPE_IS_EXIST(8406,"分类已存在"),
NOBLENORECOMCOUNT(3401, "该贵族没有推荐的机会"),
NOBLENOAUTH(3402, "该贵族该特权"),
NOBLENOTEXISTS(3404, "贵族不存在"),
NOBLEUSEREXIST(3301, "该等级贵族已经开通"),
NOBLEOPENERROR(3500, "开通贵族失败"),
NOBLEEXPIRE(3501, "贵族等级已过期"),
SMSIPTOOFTEN(302, "获取短信过于频繁"),
PRETTYNOERROR(1200, "该靓号已存在"),
HASPRETTYNOERROR(1300, "该用户已存在靓号"),
iSPROVING(1400, "正在审核中..."),
PARAMERROR(1900, "参数错误"),
NORIGHT(1401, "您无此特权"),
ISUNBANGSTATUS(1901, "已经是解绑状态"),
NOMORECHANCE(9000, "没有促销活动机会了,充值或分享就有促销活动机会哦!"),
USER_DRAW_TO_MORE(9001, "促销活动过于频繁"),
VERSIONISNULL(80001, "版本为空,请检查版本号"),
VERSIONTOLOW(80002, "本产品已停止服务,感谢支持!"),
VERSIONTOOOLD(80002, "本产品已停止服务,感谢支持!"),
CANOTUSEAPPLEPAY(7500, "暂时无法使用苹果支付,请点击优惠充值"),
CARPORTHADEXPIRE(6405, "座驾已过期"),
CARPORTNOTEXIST(6406, "座驾不存在"),
CARGOODSEXIST(6301, "用户已拥有该座驾"),
CAR_GOODS_NOT_EXISTS(6201, "座驾不存在"),
CAR_GOODS_EXPIRED(6202, "座驾已下架"),
CAR_GOODS_LIMIT(6203, "限定座驾不可购买"),
CAR_NOT_GOLD_SALE(6210, "该座驾不支持金币购买"),
CAR_NOT_RADISH_SALE(6211, "该座驾不支持萝卜购买"),
MONSTER_NOT_APPEAR(6501, "怪兽不在出现时间段"),
MONSTER_DEFEATED(6502, "怪兽已经被打败"),
MONSTER_ESCAPED(6503, "怪兽已经逃跑"),
MONSTER_NOT_EXISTS(6504, "怪兽不存在"),
WEEK_STAR_CONFIG(8200, "该周星榜配置已经存在"),
ILLEGAL_TRANSFER_REQUEST(1700, "非法转账请求"),
TRANSFER_COMPLETED(1701, "交易已完成,无需重复请求"),
DUPLICATE_TRANSFER_REQUEST(1702, "重复转账请求"),
HEADWEAR_NOT_EXISTS(1800, "头饰不存在"),
HEADWEAR_SOLD_OUT(1801, "头饰已下架"),
HEADWEAR_EXPIRED(1802, "头饰已过期"),
HEADWEAR_LIMIT_NOBLE(1803, "贵族限定产品"),
HEADWEAR_LIMIT_ACTIVITY(1804, "活动限定产品"),
HEADWEAR_LIMIT_WEEK_STAR(1805, "周星榜限定产品"),
HEADWEAR_LIMIT_MONSTER(1806, "怪兽奖品限定产品"),
HEADWEAR_NOT_BUY(1807, "用户没有购买该头饰"),
HEADWEAR_NOT_GOLD_SALE(1808, "该头饰不支持金币购买"),
HEADWEAR_NOT_RADISH_SALE(1809, "该头饰不支持萝卜购买"),
FAMILY_NOT_EXISTS(7000, "家族不存在或已被禁用"),
HAVE_JOIN_IN_FAMILY(7001, "需要退出当前家族才可以加入该家族"),
HAVE_JOIN_IN_THIS_FAMILY(7002, "你已经加入了该家族"),
YOU_HAVE_BEEN_REJECT(7003, "你被该家族拒绝"),
FAMILY_HAVE_APPLY(7004, "你已经申请该家族了"),
FAMILY_MESSAGE_EXPIRE(7005, "消息已过期"),
FAMILY_PERMISSION_DENIED(7006, "没有操作权限"),
FAMILY_LEADER_NOT_ALLOW_QUIT(7007, "族长不允许离开家族"),
FAMILY_QUIT_LIMIT_TIME(7008, "加入家族7天后才能退出家族"),
FAMILY_NOT_JOIN(7009, "没有加入家族"),
FAMILY_TARGET_NOT_JOIN(7010, "对方没有加入家族"),
FAMILY_NOT_SAME(7010, "对方和你不是同一个家族"),
FAMILY_MONEY_NOT_ENOUGH(7011, "家族币不够"),
FAMILY_MONEY_TRADE_IN_FAILED(7011, "家族币入账失败,请连续官方小秘书"),
FAMILY_INVITE_FREQUENCY_TO_MUCH(7012, "邀请频次太多"),
FAMILY_INVITE_NOT_EXISTS(7013, "邀请不存在"),
FAMILY_INVITE_EXPIRE(7013, "邀请已过期"),
FAMILY_RED_PACKGE_COUNT_ERROR(7014, "红包个数最小1个红包个数不超过500个"),
FAMILY_RED_PACKGE_AMOUNT_NOT_ENOUGH(7015, "红包总金额不足"),
RED_PACKET_NOT_EXISTS(7017, "红包不存在"),
RED_PACKET_PARAM_ILLEGAL(7016, "红包金额或者个数非法"),
RED_PACKET_NOT_EXSIST(7016, "红包不存在"),
RED_PACKET_NOT_IN_SAME_GROUP(7017, "无法领取该群的红包"),
RED_PACKET_HAS_RECEVICED(7018, "该红包已经领取过"),
RED_PACKET_RECEVICED_OVER(7019, "红包已领完"),
FAMILY_NAME_IS_SENSITIVE(7020, "家族名字中包含敏感字"),
FAMILY_LEADER_CANT_CONTRIBUTE(7021, "族长不能贡献家族币"),
RED_PACKET_EXPIRE(7022, "红包已经过期"),
MODIFY_FAILD(7023, "修改失败"),
FAMILY_APPLY_RECORD_NOT_EXISTS(7024, "家族申请记录不存在"),
FAMILY_APPLY_AGREED(7025, "已经被同意加入家族"),
FAMILY_NAME_REPEAT(7026, "家族名称重复"),
FAMILY_NAME_TOO_LONG(7027, "家族名称不能超过15个字"),
FAMILY_MONEY_NAME_REPEAT(7028, "家族币名称重复"),
FAMILY_MONEY_NAME_TOO_LONG(7029, "家族币名称不能超过三个字"),
ALREADY_IN_FAMILY(7030, "该用户已经加入了其他家族"),
FAMILY_GROUP_REMOVE_FAILED(7031, "解散群聊失败"),
KICK_OUT_GROUP_FAILED(7032, "踢出群聊失败"),
LEAVE_GROUP_FAILED(7033, "离开群聊失败"),
LEAVE_FAMILY_FAILED(7034, "离开家族失败"),
LESS_THAN_MINIMUM_AMOUT(7036, "最小交易金额不得小于0.01元"),
FAMILY_REJECT_TOO_MUCH_TIMES(7037, "你当日被该家族拒绝多次,无法申请加入家族"),
GROUP_REJECT_TOO_MUCH_TIMES(7038, "你当日被该群拒绝多次,无法申请加入群聊"),
MANAGE_COUNT_TOO_MANY(7039, "管理员数量不能超过6个"),
GROUP_NAME_IS_SENSITIVE(7040, "群名称包含敏感词"),
HAS_LEAVED_CHAT(7041, "你已退出群聊"),
HAS_JOINED_FAMILY(7042, "你已加入家族,需要退出当前家族才能申请加入其他家族"),
HAS_CLOSE_FAMILY_MONEY(7043, "家族币功能已被关闭"),
GROUP_MEMBER_LIMIT(7044, "群聊人数已达到上限,无法申请加入群聊"),
HAS_JOINED_OTHER_FAMILY_GROUP(7045, "已经加入其他家族的群聊,不能加入当前群聊"),
USER_DOLL_NOT_EXISTS(6600, "娃娃不存在"),
USER_DOLL_EXISTS(6601, "娃娃已经存在"),
USER_DOLL_SEX_ERROR(6602, "娃娃性别设置错误"),
ACCOUNT_INIT_FAILD(6603, "初始化账户失败"),
WEIXIN_USER_NOT_EXITSTS(6618,"微信用户不存在"),
CATCH_DOLL_NOT_EXIST(6404,"抓取娃娃不存在"),
CUSTOM_DOLL_FAILD(6604, "自定义娃娃失败"),
CATCH_DOLL_FAILD(6605, "抓取娃娃失败"),
CATCH_DOLL_ERORR(6606, "抓取娃娃错误"),
CATCH_DOLL_TIMES_NOT_ENOUGH(6607, "抓取娃娃次数不充足"),
CATCH_DOLL_DEAL_ERROR(6608, "抓取娃娃处理错误"),
CATCH_DOLL_DEAL_TYPE_ERROR(6609, "抓取娃娃处理类型错误"),
CATCH_DOLL_HAS_DEALED(6610, "抓取娃娃已经被处理了"),
SHARD_DOLL_TIMES_ENOUGH(6611, "分享次数已经足够"),
SHARD_DOLL_FAILD(6612, "分享失败"),
QUERY_FAILD(6613, "查询失败"),
BED_NOT_ENOUGH(6614, "床位不够"),
DOLL_NOT_ENOUGH(6615, "娃娃不够"),
ACCOUNT_NOT_EXISTS(6616, "账户不存在"),
NICK_IS_NULL(6617, "昵称为空"),
AVATAR_IS_NULL(6618, "头像为空"),
NICK_ILLEGAL(6621, "昵称不合法"),
LIMIT_MAX_CHAT(7071671, "超出群聊创建限额"),
NOT_FOUND_CHAT(7071672, "未找到该群聊"),
LIMIT_MAX_MEMBER(7071673, "加入群失败群成员上限200人"),
ALREADY_EXISTS_MEMBER(7071674, "该用户已存在于该群聊"),
NO_PERMIT_OPERATOR(7071675, "没有操作权限"),
MEMBER_NOT_IN_CHAT(7071676, "该用户不存在于该群聊中"),
MEMBER_ALREADY_MANAGER(7071677, "该用户已是该群聊的管理员"),
MEMBER_NOT_MANAGER(7071677, "该用户并不是该群聊的管理员"),
MEMBER_ALREADY_DISABLE(7071678, "该用户已被禁言"),
MEMBER_NOT_DISABLE(7071679, "该用户未被禁言"),
PK_ACT_RECORD_EXIST(9100, "该记录已存在"),
PK_ACT_RECORD_TIME_ERROR(9101, "时间区间错误"),
PK_ACT_RANK_KEY_NOT_EXIST(9404, "不存在该排行榜"),
PK_ACT_RECORD_IP_REPEAT(9501, "ip地址重复"),
ACT_GIFT_NOT_EXITST(9102, "该礼物不是活动规定礼物"),
SEARCH_NOT_SUPPORT(9502, "暂时只支持大鹅开黑号搜索"),
OPEN_BOX_POOL_NEED_THANKS_PRODUCT(9999, "尚未配置默认奖品"),
OPEN_BOX_KEY_NOT_ENOUGH(10000, "门票数量不够"),
OPEN_BOX_USER_TO_MORE(10001, "许愿人数过多,请稍后再试"),
WHITE_USER_PRIZE_FAILED(10002, "设置促销活动白名单失效"),
OPEN_BOX_BAD_POOL_CONFIG(10003, "运营把奖品给吞了"),
SMS_NOT_EXPIRED(2001, "已发送了验证码短信.请等一分钟后再试"),
SMS_NOT_EXPIRED3(2001, "已发送了验证码短信.请等3分钟后再试"),
SMS_DEVICE_LIMIT(2002, "当前设备超过短信限额了"),
SMS_PHONE_LIMIT(2003, "手机号码次数超过限制"),
ACT_LIKE_WISH_LIMIT(10004, "只能给每个用户点赞一次"),
ACT_LIKE_WISH_FAILED(10004, "点赞失败"),
ACT_WISH_NOEXIST(10004, "取消点赞失败,不存在点赞关系"),
ACT_WISH_PER_NOEXIST(10004, "点赞人或被点赞人不能为空"),
ACT_WISH_TO_MYSELF(10004, "不能给自己点赞"),
ACT_PRIZE_KEY_LIMIT(10005, "当天已经领取"),
ACT_PRIZE_KEY_LEVEL_LIMIT(10005, "用户的等级未达到要求"),
ACT_PRIZE_KEY_FAILED(10005, "钥匙领取失败,请稍后再试"),
ACT_NATIONAL_HAS_GIVE(10006, "已经赠送,不可重复赠送"),
ACT_NATIONAL_GIVE_FAILED(10006, "已经赠送,不可重复赠送"),
ACT_NATIONAL_TIME_OUT(10007, "不在活动时间内"),
ACT_SIGN_NOT_IN_TIME(10008, "不在报名活动范围内"),
IOS_CHARGE_DEVICE_LIMIT(7062,"当前设备充值次数超过限制,请到微信公众号进行充值"),
IOS_CHARGE_CLIENTIP_LIMIT(7063,"当前IP充值次数超过限制"),
ROOM_TITLE_IS_SENSITIVE(7060,"房间标题中包含敏感字"),
ROOM_TITLE_TOO_LONG(7035,"房间标题不能超过15个字"),
NOT_LOST_USER(8005,"该活动仅回归的老用户可参与哦!"),
HAS_CLAIMED_AWARD(8006,"你已经收下回归礼啦!"),
INVITE_CODE_ERROR(8007,"邀请码错误"),
SAME_IP_DEVICE(8008,"同一设备只可以参与一次哦!"),
NOT_INVITE_OWN(8009,"不能输入自己的邀请码哦"),
LOST_USER_EXIST(8010,"回归用户已存在"),
DRAW_LIMIT_TIME(8012,"不在促销活动活动时间范围内!"),
RADISH_DRAW_STATUS(8013, "今天的促销活动活动已经结束了,明天再参与哦!"),
RADISH_DRAW_PHONE_BIND(8014, "需要绑定手机才可以促销活动哦!"),
MUSIC_NOT_EXISTS(10100, "歌曲不存在"),
ROOM_IS_NOT_KTV(10101, "当前房间不是KTV房~"),
ROOM_IS_KTV(10102, "当前房间已经是KTV房~"),
CHOOSE_MUSIC_STATION_IS_FULL(10103, "当前点歌台已满,先听一会其他麦霸演唱吧~"),
CHOOSE_MUSIC_RECORD_IS_EMPTY(10104, "已点歌曲为空~"),
MUSIC_IS_CHOOSE_BY_USER(10105, "不能选择重复歌曲~"),
MUSIC_IS_SINGING(10106, "当前歌曲正在播放,不允许删除~"),
NO_KTV_PRIV(10107, "宝宝你没有开启KTV模式的权限哦~先去别人的K歌房去玩吧~"),
SEND_KEY_NUM_INCORRENT(10009,"赠送锤子数量不对"),
KEY_RECEIVE_LIMIT(10010, "今日份锤子发完啦!"),
VKISS_PRIZE_ACTIVITY_ERROR(9588,"vkiss暗号领取奖励活动配置异常"),
VKISS_API_ERROR(9688,"vkiss接口异常"),
VKISS_BUSINESS_ERROR(9788,"出错了"),
VKISS_BUSINESS_ALREADY_GET(9888,"你已经领取过啦,不能重复领取哦"),
PACK_NOT_EXIST(8500, "礼包不存在"),
PACK_NOT_OPEN(8501, "礼包还未开放购买"),
PACK_UNDER_STOCK(8502, "礼包已售罄~"),
PACK_REACH_BUY_LIMIT(8503, "今日购买该礼包的数量已达到上限"),
PACK_OVERCROWDED(8504, "抢购人数过多,请稍候再试~"),
IS_IN_MIRCO_QUEUE(1503,"已经在排麦队列中"),
MIRCO_QUEUE_IS_FULL(1504,"排麦队列已满"),
QUEUE_MODEL_CLOSED(1505,"排麦模式已关闭"),
NEED_CERTIFICATION(10108,"为了保护财产安全,请先进行实名认证"),
ID_CARD_BIND_LIMIT(10109,"您的身份证绑定的账号过多"),
USER_HAS_BIND_ID(10110,"该用户已经进行了身份认证"),
WITHDRAW_NEED_CERTIFICATION(10111,"提现金额过大,需要进行身份认证"),
MODIFY_BIND_TIMES_LIMITS(10112,"修改实名信息的次数超过限制"),
CHRISTMAS_TREE_FAMILY_NOT_JOIN(11002,"请先加入家族"),
CHRISTMAS_TREE_ALREADY_RECEIVE(11003,"已经领取过礼物啦"),
CHRISTMAS_TREE_UNMET_RULE(11004,"还未点亮圣诞树"),
PRETTY_NUMBER_NOT_EXIST(80781, "未找到该靓号"),
PRETTY_NUMBER_NOT_VALID(80782, "该靓号已下架"),
PRETTY_NUMBER_ALREADY_USED(80783, "该靓号已被使用"),
PRETTY_NUMBER_NOT_USED(80784, "该靓号暂时未使用"),
PRETTY_NUMBER_ALREADY_BIND(80785, "该用户已绑定了靓号"),
PRETTY_NUMBER_ALREADY_OCCUPY(80786, "该用户已被占用"),
PRETTY_NUMBER_NOT_OCCUPY(80787, "该用户未被占用"),
MASTER_APPRENTICE_ELT_TEN(90011, "%s级以上才可以收徒哦"),
MASTER_APPRENTICE_EGT_THREE(90012, "别贪心,一天只能收%s个徒弟哦"),
MASTER_APPRENTICE_NOT_ENOUGH(90013, "再等等吧,没有%s啦~"),
MASTER_APPRENTICE_WAIT(90014, "未满%s分钟"),
MASTER_APPRENTICE_ALREADY_OTHER_BIND(90015, "啊哦,晚一步,徒弟被别人收走了!"),
MASTER_APPRENTICE_ALREADY_BIND(90016, "已是师徒关系"),
MASTER_APPRENTICE_NOT_EXISTS(90017, "非收徒任务或当前收徒进度错误"),
MASTER_APPRENTICE_NOT_EXPIRE(90018, "不足%s天不可以解除师徒关系哦"),
MASTER_APPRENTICE_MISSION_ALREADY_EXPIRE(90019, "任务已过期"),
MASTER_APPRENTICE_HAS_OTHER_MASTER(90020,"别贪心,一人只能拜一个师傅哦!"),
MASTER_APPRENTICE_ALREADY_ENOUGH(90021,"师傅今日收徒名额满了,明天早点来哦~"),
MASTER_APPRENTICE_MISSION_BUILD(90022,"和对方已存在师徒任务"),
MASTER_APPRENTICE_MENTORING(90023,"正在收徒中"),
MASTER_APPRENTICE_GRAB_SLOW(90024,"手速太慢了哦~"),
PK_USER_NOT_NULL(1506,"当前没有参与PK的人"),
PK_NOT_EXIST(1507,"PK不存在"),
PK_MODEL_CLOSED(1505,"PK模式已关闭"),
PK_HAS_EXIST(1507,"PK已经存在请不要重复开始"),
PK_TEAM_ERROR(1508,"用户所属队伍有误"),
PK_SATUS_ERROR(1509,"PK状态异常"),
HALL_NAME_IS_SENSITIVE(90101, "修改失败,请输入合法字符!"),
HALL_NOT_JOIN(90102, "您没有加入厅"),
ALREADY_IN_HALL(90103, "该用户已经是厅成员啦!"),
ALREADY_IN_OTHER_HALL(90104, "该用户已经加入其他厅啦!"),
HALL_MEMBER_MAX(90105, "厅人数达到上限"),
HALL_NOT_EXIST(90106, "该厅不存在"),
HAS_ONE_HALL(90107, "只能加入一个厅哦!"),
HALL_ALREADY_APPLY(90108, "你已提交申请,请等待审批"),
HALL_QUIT_LIMIT(90109, "退出7天后才可以重新加入"),
HALL_OWNER_NOT_ALLOW_QUIT(90110, "厅主不允许退出"),
HALL_PERMISSION_DENIED(90111, "没有操作权限"),
HALL_TARGET_NOT_JOIN(90112, "对方没有加入该厅"),
HAS_QUIT_HALL_APPLY(90113, "你已申请退出,请等待审批"),
HAVE_JOIN_IN_HALL(90114, "需要退出当前厅才可以加入该厅"),
HALL_MANAGER_COUNT_LIMIT(90115, "高管人数已达上限"),
HALL_LIMIT_MAX_CHAT(90116, "超出群聊创建限额"),
HALL_GROUP_NAME_IS_SENSITIVE(90117, "群名称含有敏感词"),
HALL_CHAT_NOT_EXIST(90118, "该群聊不存在"),
HALL_LIMIT_MAX_MEMBER(90119, "超过群最大人数限制"),
REMOVE_HALL_CHAT_FAILED(90119, "退出群聊失败"),
HALL_ALREADY_INVITE(90120, "已经发送过邀请咯"),
HALL_OPERATE_RECORD_EXPIRE(90121, "消息已过期"),
HALL_OPERATE_RECORD_DEAL(90122, "消息已处理"),
HALL_IS_MANAGER(90123, "该成员已经是高管"),
HALL_IS_MEMBER(90124, "该成员已经不是高管"),
HALL_APPLY_LIMIT(90125, "七天内只能申请一次"),
HALL_CREATE_GROUP_FAIL(90126, "创建群聊失败"),
HALL_JOIN_PRIVATE_CHAT(90127, "你没有加入该厅"),
HALL_HAS_IN_CHAT(90128, "你已经在群聊中"),
HALL_CHAT_MANAGER_TOO_MANY(90129, "管理员数量已达上限"),
CAN_NOT_REMOVE_ELDER(90130, "不能移除族长"),
HALL_NAME_HAS_EXSIT(90131, "公会名已存在"),
HALL_MANAGER_NOT_FOUND_MENU_AUTH(80789, "高管权限为空"),
HALL_MANAGER_NOT_FOUND(80790, "当前没有此高管"),
HALL_MANAGER_NOT_BELONG(80791, "当前高管不是这个厅的"),
HALL_MEMBER_OWNER_NOT_FOUND(80604, "厅主为空"),
HALL_GIFT_SEND_RECORD_NULL(80601, "礼物赠送记录为空"),
HALL_GIFT_SEND_RECORD_DB_NULL(80602, "礼物赠送记录数据库查询为空"),
HALL_INCOME_SEL_TIME_ERROR(80603, "收入统计查询时间格式错误"),
ROOM_NOT_EXIST(1601,"还没有开过房间,快去开房嗨起来吧~"),
ROOM_IS_PUBLIC(1602,"对方不在房间内~"),
ROOM_IN_FRIEND_LIMIT(1603,"亲~该房间仅房主好友可进"),
ROOM_IN_INVITE_LIMIT(1604,"亲~该房间仅邀请可进"),
ROOM_IOS_VERSION(1605,"当前版本较低,请前往appstore下载66星球"),
ONLINE_SENSATION_NOT_EXIST(80604, "该用户没有作品"),
H5_EXCHANGE_OUT_OF_LIMIT(6619,"兑换功能暂未开放"),
EXCHANGE_NOT_EXIST(6620,"没有彩蛋,不能兑换!"),
LIKE_UID_ERROR(80605, "点赞与被点赞id不能一致"),
LIKE_COUNT_OUT_OF_MAX(80606, "每天最多点赞3次"),
LIKE__OUT_OF_TIME(80607, "不在点赞活动时间内"),
RECOMMEND_STOCK_NOT_ENOUGH(7567001, "推荐位库存不足"),
NOT_FOUND_AVAILABLE_RECOMMEND_CARD(7567002, "没有可用的推荐卡"),
RECOMMEND_ALREADY_APPLY(7567004, "已申请该时间段的推荐位"),
RECOMMEND_APPLY_TIME_ERROR(7567003, "请在当前时间前进行申请"),
RECOMMEND_CRAD_STOCK_NOT_ENOUGH(7567001, "推荐卡的推荐位库存不足"),
GAME_INVITE_EXPIRED(20001,"链接已过期"),
GAME_INVITE_INVALID(20002,"游戏已失效"),
GAME_INVITE_OVER(20003,"游戏已结束"),
GAME_INVITE_BEGUN(20004,"游戏已开始,是否进入观战"),
EMOJI_CODE_NULL(90130, "Emoji表情不存在"),
EMOJI_CODE_NOTEXIST(90131, "暗号已过期或不存在"),
USER_ALREADY_IN_HALL(90132, "你已经是厅成员啦!"),
OUT_OF_LIMIT(80608,"已超过限定次数"),
ACT_AWARD_HAS_GET(80609, "已经领取过奖励"),
ACT_AWARD_NOT_ACCORD(80610, "未满足条件领取"),
ACT_NOT_ACCORD(80611, "未满足条件"),
PHONE_NO_BIND(30001, "未绑定手机号"),
ADMIN_PHONE_NO_BIND(30001, "您未绑定手机号,请联系管理员"),
USER_NO_CERTIFY(30002, "未实名认证"),
FANS_COUNT_INSUFFICIENT(30003, "粉丝数量不达标"),
SKILL_NO_ACTIVATE(30004,"当前标签未激活"),
CHOOSE_SKILL(30005, "请选择技能"),
BANK_CARD_NO_BIND(30006, "请先添加银行卡"),
PAYMENT_PWD_NO_SET(30007, "未设置支付密码"),
BANK_CARD_BIND_LIMIT(30008, "银行卡绑定次数超过限制"),
BANK_CARD_USER_LIMIT(30009, "用户最多可绑定银行卡张数超过限制"),
BANK_CARD_NOT_MATCH_PHONE(30010, "非银行卡预留手机号"),
BANK_CARD_HAS_BOUND(30011, "银行卡已绑定,请选择其他银行卡"),
CREDIT_CARD_NOT_SUPPORT(30012, "暂不支持信用卡"),
PAYMENT_PROCESSING(30013, "支付处理中,请稍后"),
PAYMENT_FAIL(30014, "支付失败"),
PAYMENT_PWD_NULL(30015, "支付密码不能为空"),
PAYMENT_MONEY_INVALID(30016, "支付金额不合法"),
PAYMENT_ANCHOR_WHITELIST(30017, "当前该用户没权限"),
SEND_FAIL(30018, "赠送失败"),
SEND_SELF_FAIL(30019, "自己不能赠送给自己"),
PAYMENT_MONEY_MAX(30020, "转赠金额超过上限"),
BAND_CARD_NOT_SUPPORT(30021, "暂不支持此银行卡,请选择其他银行卡重新绑定"),
WITHDRAW_BANK_CARD_NOT_EXIST(30022, "请先绑定提现银行卡"),
WITHDRAW_ACCOUNT_TYPE_NOT_SUPPORT(30023, "暂不支持此提现账号类型,请选择其他账号进行提现"),
WITHDRAW_NEED_BANK_CARD(30024, "提现金额大于%s人民币仅支持提现到银行卡"),
CERTIFY_FAIL(30025, "未通过实名认证"),
BANNER_ROOM_NOT_EXISTS(20000, "房间id不存在"),
SEND_GIFT_NUM_TOO_LARGE(8005,"送出礼物数量过大"),
MISSION_SYS_NOT_COMPLETE(892001, "任务未完成"),
MISSION_SYS_NOT_EXISTS(892002, "任务不存在"),
MISSION_SYS_NOT_DEVICEID_LIMIT(892003, "该设备今天已经领取过了哦"),
MISSION_SYS_VERSION_LIMIT(892004, "当前版本不支持"),
MISSION_SYS_EXPER_LEVEL_LIMIT(892005, "未达到指定等级"),
WALLET_AMOUNT_NOT_ENOUGH(881201, "钱包余额不足"),
WALLET_ERROR(881202, "钱包异常"),
GOLD_PRIZE_NOT_FOUND(20001, "金币奖品不存在"),
GOLD_PRIZE_FOUND(20002, "金币奖品已存在"),
GOLD_PRIZE_POOL_NOT_FOUND(20003, "金币池该奖品不存在"),
GOLD_PRIZE_POOL_FOUND(20004, "金币池该奖品已存在"),
LOCK_FAIL(20005, "系统繁忙,请稍后重试"),
PRIZE_GOLD_POOL_RATIO_EXCEED(20006, "概率不得超过100"),
USER_DRAW_STATIS_NOT_FOUND(20007, "记录不存在"),
DRAW_GOLD_SWITCH_CLOSE(20008, "太多人抢啦,请稍候"),
DISSATISFY_DRAW(20009, "未达到瓜分条件"),
ALREADY_DRAW(20010, "金币已瓜分,请勿重复点击"),
DRAW_GOLD_TO_MORE(20011, "瓜分金币人数过多,请稍后再试"),
PRIZE_GOLD_POOL_NULL(20012,"奖池奖品为空"),
PRIZE_GOLD_POOL_DEF_NULL(20013,"奖池默认奖品为空"),
GOLD_PRIZE_NULL(20014, "奖品不存在"),
TODAY_USER_ALREADY_SIGN(20015, "用户已签到,请勿重复签到"),
SIGN_DEVICE_ID_LIMIT(20029, "该设备今天已经签到"),
ALREADY_HAS_CONFIG(91000, "已经有该活动类型的配置了!"),
ALREADY_NOTEXISTS_CONFIG(91001, "缺少该活动配置!"),
SIGN_REWARD_CONFIG_NULL(20016, "签到奖品配置为空"),
ADD_GIFT_TYPE_REWARD_RECORD_ERROR(20017, "添加奖品类型对应的记录出错"),
SIGN_TO_MORE(20018, "签到人数过多,请稍后再试"),
SIGN_EXCEPTION(20019, "签到异常"),
USER_SIGN_ROUND_NULL(20020, "本轮签到情况为空"),
SIGN_REWARD_CONFIG_SIGN_DAYS_NULL(20021, "签到奖品配置签到天数为空"),
SIGN_REWARD_CONFIG_NOT_TOTAL(20022, "该奖励不是累计签到奖励,不可以领取"),
TOTAL_SIGN_DYAS_SHORT(20023, "累计签到天数不够,无法领取奖励"),
TOTAL_REWARD_RECORD_EXISTS(20023, "该累计奖励已领取过,请勿重复领取"),
SIGN_REWARD_CONFIG_ICON_NULL(20024, "保存失败,奖品图片为空"),
SIGN_REWARD_CONFIG_TOTAL_EXCEED(20025, "保存失败,累计奖励数不能超过3个"),
HANDLER_SIGN_EXCEPTION(20026, "签到异常"),
RECEIVE_TOTAL_REWARD_EXCEPTION(20027,"领取累计奖励异常"),
DRAW_GOLD_EXCEPTION(20028,"瓜分金币异常"),
ROOM_CHAT_NO_MATCH(20005,"未匹配到房间"),
PAY_PASSWORD_LIMIT(20029,"超过输入次数请24小时后再试"),
PAY_PASSWORD_ERROR(20030,"密码错误,还有%s次输入机会"),
NOT_ALLOW_OPEN_GIFT_VALUE(20030,"开启礼物值请先关闭KTV模式"),
DRAW_GOLD_NEED_CERTIFICATION(20031,"请先通过实名认证哦"),
PARENT_MODE_PASSWORD_ERROR(20032, "密码错误"),
FILE_FORMAT_ERROR(20035,"文件格式不对"),
FILE_SIZE_TOO_LARGE(20036,"文件内容超过10000行"),
ROW_IS_EMPTY(20037,"行数据为空"),
ETERNAL_HEAR_UID_LIMIT(5201,"每个ID限购一个!"),
NOT_ENOUGH_REPLENISH_SING_COUNT(21100,"本轮已经用完补签机会"),
DONATE_ERROR(21200,"赠送失败,请下载最新版本"),
NOT_ALLOW_LEAVE_MODE(20032,"开启离开模式请先关闭KTV模式"),
NOT_ALLOW_OPEN_KTV_MODE(20033,"开启KTV请先关闭离开模式"),
VOICE_NOT_ALLOW_OPERATE_1(35600, "想要进一步了解Ta \n需要先录制一个声音哦~"),
VOICE_NOT_ALLOW_OPERATE_2(35601, "想要捡更多声音瓶子 \n需要先录制一个声音哦~"),
ROOM_RECOMMEND_LIMIT(23000,"该标签分类下房间配置已达上限"),
ROOM_RECOMMEND_SEQ_NO_LIMIT(23001,"已有时间段内推荐房间占用了该排序"),
ROOM_RECOMMEND_UID_LIMIT(23002,"已有时间段内推荐了该房间"),
ROOM_ALRAEDY_EXIST(23003,"该tab下已存在该房间"),
ROOM_SEQNO_ALRAEDY_EXIST(23004,"同一个tab下房间排序不可相同!"),
MID_YEAR_TASK_TYPE(22001,"任务类型不存在"),
MID_YEAR_DRAW_RECEIVE_MORE(22002,"奖励已领完"),
MID_YEAR_PLAY_TEAM_MORE(22003,"您已创建战队,请勿重复创建"),
MID_YEAR_PLAY_TEAM_NOTEXISTS(22004,"该战队不存在,请核实!"),
MID_YEAR_PLAY_TEAM_ENTRY(22005,"只能加入一个战队!"),
MID_YEAR_PLAY_TEAM_NOT_JION(22006,"您未加入任何战队!"),
MID_YEAR_PLAY_TEAMCODE_NOTEXISTS(22007,"战队码不存在,请核实!"),
WORLD_WORD_SENSITIVE(7900,"内容中包含敏感字"),
WORLD_WORD_TOO_LONG(7901,"内容不能超过16个字"),
WORLD_NOT_EXIST(7903,"话题不存在"),
WORLD_IS_FULL(7904,"世界已满人"),
QUIZ_WORLD_AGREE(7905,"申请成功,等待审核"),
QUIZ_WORLD_ALREADY_JOIN(7906,"加入失败,您已在该世界中,请勿重复加入"),
WORLD_MEMBER_NOT_ENOUGH(7907, "人数达到3人才能生成群聊\n快去邀请好友吧"),
GROUP_CHAT_IS_FULL(7908,"哎呀,群聊人满暂时加不进来啦~"),
MEMBER_NOT_IN_WORLD(7909,"您已被移出话题"),
QUIZ_TOPIC_STATUS_LIMIT(24000,"请配置完题目再上架"),
QUIZ_OPTION_COUNT_LIMIT(24001,"选项配置已达上限"),
QUIZ_TOPIC_RESULT_STATUS_LIMIT(24002,"请配置完结果再上架"),
REGISTER_ERROR(24000,"注册异常,请稍后再试!"),
SHUMEI_REGISTER_ERROR(24001,"注册异常,请稍后再试"),
REGISTER_ERROR_PHONE(24002,"注册异常,请使用手机注册!"),
LOGIN_ERROR(25000,"登录异常"),
LOGIN_SHUMEI_ERROR(25001,"登录异常!"),
SMS_SENDING_FREQUENCY_TOO_HIGH(200390, "短信发送频率过高,请稍后再试"),
CHARGE_LIMIT(25000,"充值超过限额"),
OPER_NOT_OPEN(10960, "功能暂未开放"),
FORBID_IN_ROOM(30000,"根据青少年模式规则你在每日00:00~06:00期间无法使用语音房。请合理安排娱乐时间。"),
NOT_SUPER_USER(18004, "非超级管理员"),
SUPER_USER_DISALLOW_OPEN_ROOM(18005, "超级管理员不允许开房"),
SUPER_ROOM_LIMIT_WAIT(18006, "系统检测涉嫌违规,%s分钟内不可设置进房限制"),
SUPER_CLOSE_ROOM_WAIT(18007, "系统检测涉嫌违规,%s分钟内不可开房"),
SUPER_LIMIT_OPERATE(18008, "好好上班,不要玩游戏"),
DIAMOND_BOX_NOT_OPEN(10005, "请在活动期间许愿,期待您的参与"),
OVER_GIVE_KEY_LIMIT(10006, "超过赠送数量上限!"),
OVER_DRAW_NUM_LIMIT(21111, "今天游玩次数已达到上限哦~"),
PACK_NOT_OPEN_TIME(21112,"啊哦,促销活动结束了~"),
DEVICE_ID_NOT_EXISTS(21113, "设备id不能为空!"),
SHARE_EXISTS(31000, "该动态已经分享过!"),
ACTION_REPEAT(31001, "请勿重复操作!"),
DYNAMIC_NOT_EXIST(31002, "动态不存在!"),
DYNAMIC_NOT_SELF_ACTION(31003, "不能执行操作!"),
DYNAMIC_COMMENT_NOT_EXIST(310024, "评论不存在!"),
DYNAMIC_NOT_OWNER_ACTION(31003, "不是创始人不能执行操作!"),
AMOUNT_PARAM_ERROR(31004,"钱包操作参数异常"),
PURSE_MONEY_NOT_ENOUGH(31005,"钱包余额不足"),
/**
* 礼包
*/
NOT_ENOUGH_PIECE(31006,"道具不足"),
COUPLE_MATCH_EXISTS(21114, "该用户已配对!请勿重复操作!"),
COUPLE_SIGN_NOT_ACCORD(21115, "你们认识还没有两天哦~"),
COUPLE_SIGN_ALREADY(21116, "已打卡,请勿重复操作~"),
COUPLE_ANSWER_NOT_ACCORD(21117, "你们认识还没有三天哦~"),
COUPLE_MATCH_POOL_EXISTS(21118, "该用户已进匹配池!请勿重复操作!"),
COUPLE_ANSWER_ALREADY(211169, "已答题,请勿重复操作~"),
ONE_CLICK_LOGIN_ERROR(211170,"一键登录失败"),
ERBAN_NO_NOT_EXIST(211171,"账号不存在"),
PASSWORD_ERROR(211172,"密码错误"),
PHONE_INVALID(211173,"非法的手机号码"),
VERIFY_CODE_ERROR(211174,"短信验证码校验失败"),
RECORD_NOT_EXIST(211175,"记录不存在"),
CHARGE_PROD_NOT_EXIST(211176,"充值产品不存在"),
IOS_PAY_LIMIT(211177,"已超出今日内购充值限额"),
IOS_PAY_LIMIT_DAILY(211177,"充值失败,请联系客服处理"),
UNKNOWN_PAYCHANNEL(211177,"支付失败.未找到正确的支付渠道"),
CODE_DUPLICATE(5207, "code 重复"),
WITHDRAW_PROD_NOT_EXIST(211178, "提现产品不存在"),
CHARGE_AMOUNT_INCORRECT(211179,"充值金额不正确"),
RECORD_ALREADY_EXIST(211180,"记录已经存在"),
WEEK_STAR_HAS_NO_AWARD(211181,"周星榜未配置奖品"),
WEEK_STAR_HAS_NO_GIFT(211182,"周星榜未配置礼物"),
UNKNOWN_RANK_TYPE(211183,"未知的榜单类型"),
/** 邀请码 **/
INVITE_CODE_INVALID(211184,"邀请码不存在"),
INVITE_CODE_DEVICE_DUPLICATED(211185,"该设备已填写过邀请码"),
TIME_OUT_TO_REFILL_INVITE_CODE(211186,"超出不填时间,无法补填邀请码"),
/** 邀请码 */
PHONE_BE_INTERCEPTED(211187,"该手机号存在违规行为"),
/**
* 深海奇缘活动
**/
PIECE_NOT_ENOUGH(211188, "当前碎片不足,购买头像装饰获得碎片"),
JOIN_GAME_USER_TOO_MORE(211189, "参与游戏人数过多,请稍后再试"),
NOT_ENOUGH_LEVEL(5246, "等级未达到要求"),
/**
* 相亲玩法
*/
NOT_HAVE_BLIND_DATE_ROOM_PERMISSION(211190,"没有相亲玩法权限"),
BLIND_DATE_ROOM_VERSIONTOLOW(80002, "需先升级最新版本才能进入"),
/** 比赛相关 */
NOT_BIND_GAME_ACCOUNT(220001, "请先绑定游戏账号"),
NOT_ENOUGH_GAME_TICKET(220002, "门票不足"),
GAME_USER_PURSE_MONEY_NOT_ENOUGH(220003, "钱包余额不足"),
GAME_NOT_EXSIT(220004, "比赛不存在"),
UNDER_AGE_WITHDRAWAL(25006,"未成年用户 (<18岁),无法使用提现功能哦"),
/**
* 渠道门票包
*/
USER_NOT_EXIST(230003, "用户未注册"),
PHONE_HAS_RECEIVE_TICKET(230004, "该手机号已经领取过门票"),
HAS_CLOSED(230006, "链接已失效"),
HAS_OVER_TIME(230007, "已超过领取时间"),
STOCK_NOT_ENOUGH(230008, "库存不足"),
USER_HAS_RECEIVE_TICKET(230009, "该用户已经领取过门票"),
/**
* 隐私协议
*/
PRIVACY_POLICY_VERSION_ERR(2300010, "隐私政策版本号不正确,版本号不能小于以往版本号!"),
/**
* 公会超管
*/
OVER_MAX_COUNT(2300011, "达到公会超管设置上限,如需设置请先移除现有超管。"),
NOT_CLAN_MEMBER(2300012, "非公会成员不可设置为超管"),
NOT_SUPER_MANAGE(2300013, "非超管无需移除"),
EXPORT_DATA_BEYOND_LIMIT(8513, "超过时间范围限制!"),
CLAN_ASSOCIATE_ACCOUNT(8515, "家族族长关联号禁止提现!"),
ROOM_TYPE_NOT_ALLOW(8516, "房间类型不被允许!"),
current_room_cross_pking(8517, "您的房间正在PK中!"),
invited_room_cross_pking(8518, "您邀请的房间正在PK中!"),
ROOM_PKING_NOT_ALLOW_MIC(8519, "房间PK中不允许改变排麦模式!"),
KEY_NUM_ERR(8511, "钥匙数不能小于0!"),
KEY_NUM_BEYOND_NUM(8512, "单次上限200!"),
MINI_GAME_CLOSED(8520, "当前游戏已关闭,可以切换其他游戏体验哦~!"),
FAST_PICK_FAIL_MSG(8521, "当前没有合适的房间,请稍后再试哦~"),
FIND_ROOM_FAIL(8522, "暂未寻找到合适的房间哦,去其他地方逛逛吧~"),
FIND_MINIGAME_ROOM_FAIL(8523, "小游戏暂无房间状态为\"等人中\""),
MINI_GAME_CLOSE(8524, "游戏房已关闭!"),
MINI_GAME_TYPE_CLOSE(8525, "当前游戏已关闭,选择其他游戏吧~"),
VERSION_TOO_LOW(8526, "当前版本过低,请升级最新版本!"),
QUERY_ROOM_MINI_GAME(8527, "查询房间游戏失败!"),
/** 贵族start **/
ALREADY_VIP(8534, "当前已有贵族身份,无法重复开通"),
VIP_GIFT_SENDER_LOWER_LEVEL(8535, "贵族等级不足"),
/** 贵族end **/
BROAD_IS_NO_HOMEOWNER(8528, "权限不足,只有房主才可以发送广播!"),
BROAD_WORD_NUM_IS_ERROR(8529, "发送广播内容真实字数不满足要求!"),
BROAD_SEND_NO_IN_CORRECT_TIME(8530,"发布广播间隔时长未满足要求,请稍后再试!"),
BROAD_SEND_MSG_NO_CORRECT(8531,"当前消息内容不符合要求,请重新输入!"),
BROAD_SEND_NO_OPEN(8532,"广播功能未开启"),
BROAD_SEND_NO_PERMIT(8533,"当前房间类型不支持发布广播"),
BROAD_SEND_NO_PERMIT_BY_PASSWORD(8534,"当前房间设置了密码,暂不支持发布广播"),
BROAD_SEND_NO_PERMIT_BY_MIC(8535,"当前房间麦上用户数不满足要求,暂不支持发布广播"),
/**
* 个播
*/
SINGLE_BROADCAST_NOT_EXISTS(8502, "此个播不存在!"),
SINGLE_BROADCAST_VERSIONTOLOW(8506, "当前版本过低,请前往升级最新版本!"),
BOTTOM_BAR_NOT_EXISTS(8528, "查询不到底部bar配置信息!"),
USER_SKILL_CARD_NOT_EXIST(8528,"用户不存在该技能卡"),
USER_SKILL_CARD_INPUT_TO_LONG(8529,"技能卡输入字数过长"),
USER_SKILL_CARD_DUPLICATE(8530,"已拥有此类型的技能卡,请勿重复添加"),
USER_SKILL_CARD_HAVE_ALL_TYPE(8530,"您已拥有目前所有种类的技能卡"),
SKILL_CARD_INPUT_IS_SENSITIVE(8531,"当前输入的内容中包含敏感词,请重新输入!"),
SKILL_CARD_CHECKNUM_OVER_LIMIT(8532,"多选项数量超过限制,请重新选择!"),
USER_CANCEL(11002, "用户已注销"),
CANCEL_USER_INFO_NOT_EXIST(8702, "获取不到注销用户信息!"),
CANCEL_USER_CREDENTIALS_NOT_EXIST(8702, "注销用户凭证不存在!"),
CP_RECORD_NOT_EXISTS(8703, "未查询到对应cp关系!"),
CP_INVITE_DECLARATION_NOT_ALLOW_EXISTS(8704, "关系誓言不能为空!"),
CP_INVITE_DECLARATION_LEN_ERR(8705, "关系誓言5~20字!"),
USER_SELF_MAKE_INVITE_ERR(8706, "只能和别人组CP哦~"),
DECLARATION_SENSITIVE(8707,"关系誓言包含敏感词!"),
CP_MP_REPEAT_APPLY_ERR(8708,"不能重复申请cp铭牌!"),
VIP_LEVEL_NOT_ENOUGH(8710, "贵族等级未达要求"),
/** 寻找小精灵活动 */
SEEK_ELFIN_LIMIT(8801,"最多只能选择9张卡牌哦"),
HAS_SENSITIVE(8709, "当前内容不符合规范,请修改后重试哦~"),
/** 粉丝团 */
CURRENT_FANS_TEAM_IS_JOINED(8711, "您当前已是该粉丝团成员,无需赠送入团礼物哦~"),
JOIN_FANS_TEAM_LIMIT(8712, "距离您退出该粉丝团还不足24小时,无法重新加入!"),
ERBAN_NO_ERROR(8713,"厅号错误"),
CHANNEL_EXIST(8714,"渠道来源已存在配置"),
CHANNEL_CANNOT_DELETE(8715,"该渠道无法删除"),
SINGLE_BROADCAST_SORT_NOTEXISTS(8716,"个播分类标签不存在"),
DRESS_SHOP_TYPE_NOTEXISTS(8802,"装扮商城对应类型不存在"),
DRESS_NOTEXISTS(8803,"装扮不存在"),
GIFT_COMPOUND_LIMIT_NOT_OPEN(26001, "限时礼物合成未开启"),
GIFT_COMPOUND_LIMIT_IN_COOLING(26002, "限时礼物合成冷却中"),
/**
* 线性奖池
*/
LINEARLY_POOL_USER_TO_MORE(11001, "参与人数过多,请稍后再试"),
ACT_MID_AUTUMU_TICKET_NOT_ENOUGH(30001,"月饼券不足"),
;
private final int value;
private final String reasonPhrase;
/**
* 格式化reasonPhrase参数
*/
private Object[] formatArgs;
private BusiStatus(int value, String reasonPhrase) {
this.value = value;
this.reasonPhrase = reasonPhrase;
}
public int value() {
return this.value;
}
public String getReasonPhrase() {
if(formatArgs != null && formatArgs.length > 0){
return String.format(reasonPhrase,formatArgs);
}
return reasonPhrase;
}
@Override
public String toString() {
return Integer.toString(value);
}
public BusiStatus build(Object... formatArgs){
this.formatArgs = formatArgs;
return this;
}
}

View File

@@ -0,0 +1,8 @@
package com.accompany.common.support;
/**
* Created by PaperCut on 2018/4/27.
*/
public interface BeanSelfAware {
void setBeanSelf(Object self);
}

View File

@@ -0,0 +1,57 @@
package com.accompany.common.support;
import com.accompany.common.utils.HttpUtils;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class BodyReaderHttpServletRequestWrapper extends HttpServletRequestWrapper {
private final byte[] body;
public BodyReaderHttpServletRequestWrapper(HttpServletRequest request) throws IOException {
super(request);
body = HttpUtils.getBodyString(request).getBytes("UTF-8");;
}
@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 boolean isFinished() {
return false;
}
@Override
public boolean isReady() {
return false;
}
@Override
public void setReadListener(ReadListener readListener) {
}
};
}
}

View File

@@ -0,0 +1,37 @@
package com.accompany.common.support;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/**
* Created by PaperCut on 2018/4/27.
*/
public class InjectBeanSelfBeanPostProcessor implements BeanPostProcessor, ApplicationContextAware{
private ApplicationContext applicationContext;
@Override
public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
return o;
}
@Override
public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
if(o instanceof BeanSelfAware) {
BeanSelfAware self = (BeanSelfAware)o;
if(AopUtils.isAopProxy(o)) {
self.setBeanSelf(o);
} else {
self.setBeanSelf(applicationContext.getBean(s));
}
}
return o;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
}

View File

@@ -0,0 +1,20 @@
package com.accompany.common.utils;
/**
* 账号工具
*
* @author linuxea
* @date 2019/8/14 11:43
*/
public class AccounUtil {
/**
* 检测是否为手机号
*
* @param string 匹配字符串
* @return 是否为手机号
*/
public static Boolean isPhone(String string) {
return StringUtils.isNotBlank(string) && string.length() == 11;
}
}

View File

@@ -0,0 +1,40 @@
package com.accompany.common.utils;
import com.accompany.common.constant.AppEnum;
import com.accompany.common.device.DeviceInfo;
import com.accompany.common.utils.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public final class AppUtils {
public static boolean isYinyouApp(DeviceInfo deviceInfo) {
if (deviceInfo == null || StringUtils.isBlank(deviceInfo.getApp())) {
return false;
}
if (deviceInfo.getApp().equalsIgnoreCase(AppEnum.yinyou.getValue()) || deviceInfo.getApp().equalsIgnoreCase(AppEnum.yinyouEnterprise.getValue())) {
return true;
}
return false;
}
public static List<String> getGroupApps(String app) {
if (StringUtils.isBlank(app)) {
return Collections.emptyList();
}
List<String> groupApps = new ArrayList<>();
if (app.equalsIgnoreCase(AppEnum.PlanetStar.getValue()) || app.equalsIgnoreCase(AppEnum.PlanetStar66.getValue())) {
groupApps.add(AppEnum.PlanetStar.getValue());
groupApps.add(AppEnum.PlanetStar66.getValue());
} else if (app.equalsIgnoreCase(AppEnum.yinyou.getValue()) || app.equalsIgnoreCase(AppEnum.yinyouEnterprise.getValue())) {
groupApps.add(AppEnum.yinyou.getValue());
groupApps.add(AppEnum.yinyouEnterprise.getValue());
}
return groupApps;
}
}

View File

@@ -0,0 +1,34 @@
package com.accompany.common.utils;
/**
* @Author: yangming
* @Date: 2019/12/30 15:55
* @Description: 版本号判断工具类
**/
public class AppVersionUtil {
/**
* 比较版本号的大小,前者大则返回一个正数,后者大返回一个负数,相等则返回0
*
* @param version1
* @param version2
*/
public static int compareVersion(String version1, String version2) {
// 注意此处为正则匹配,不能用.
String[] versionArray1 = version1.split("\\.");
String[] versionArray2 = version2.split("\\.");
int idx = 0;
// 取最小长度值
int minLength = Math.min(versionArray1.length, versionArray2.length);
int diff = 0;
// 先比较长度, 再比较字符
while (idx < minLength
&& (diff = versionArray1[idx].length() - versionArray2[idx].length()) == 0
&& (diff = versionArray1[idx].compareTo(versionArray2[idx])) == 0) {
++idx;
}
// 如果已经分出大小,则直接返回,如果未分出大小,则再比较位数,有子版本的为大;
diff = (diff != 0) ? diff : versionArray1.length - versionArray2.length;
return diff;
}
}

View File

@@ -0,0 +1,17 @@
package com.accompany.common.utils;
import org.springframework.util.Assert;
/**
* 断言
*/
public class AssertUtil extends Assert {
public static void isTrue(boolean expression, RuntimeException exception) {
if (!expression) {
throw exception;
}
}
}

View File

@@ -0,0 +1,155 @@
package com.accompany.common.utils;
import ma.glasnost.orika.MapperFacade;
import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.impl.DefaultMapperFactory;
import ma.glasnost.orika.metadata.Type;
import ma.glasnost.orika.metadata.TypeFactory;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* bean操作
*
* @author fangchengyan
*/
public class BeanUtil {
private static Logger logger = LoggerFactory.getLogger(BeanUtil.class);
public static <T> T mapToObject(Map<String, ?> map, Class<T> beanClass) throws Exception {
if (map == null) {
return null;
}
T obj = beanClass.newInstance();
BeanUtils.populate(obj, map);
return obj;
}
/**
* 将对象转换为map默认不过滤null属性
* @param obj
* @return
*/
@SuppressWarnings({ "unchecked"})
public static Map<String, Object> objectToMap(Object obj) {
return objectToMap(obj, false);
}
/**
* 将对象转换为map过滤值为null的属性
* @param obj
* @param filterNull 是否过滤null属性
* @return
*/
@SuppressWarnings({ "unchecked"})
public static Map<String, Object> objectToMap(Object obj, boolean filterNull) {
if (obj == null) {
return null;
}
try {
Map<Object, Object> map = new BeanMap(obj);
Map<String, Object> result = new HashMap<>(map.size());
for (Map.Entry<Object, Object> entry : map.entrySet()) {
if(entry.getKey() instanceof String && entry.getKey().equals("class")) {
continue;
}
if (filterNull) {
if(null != entry.getValue()) {
result.put(entry.getKey().toString(), entry.getValue());
}
} else {
result.put(entry.getKey().toString(), entry.getValue());
}
}
return result;
} catch (Exception e) {
logger.error("对象转换为map出错{}", ExceptionUtils.getStackTrace(e));
return new HashMap<>(2);
}
}
private static final MapperFactory mapperFactory;
private static MapperFacade mapper;
static {
mapperFactory = new DefaultMapperFactory.Builder().build();
mapper = mapperFactory.getMapperFacade();
}
/**
* 简单的复制出新类型对象.
*
* <p>通过source.getClass() 获得源Class
*/
public static <S, D> D map(S source, Class<D> destinationClass) {
return mapper.map(source, destinationClass);
}
/**
* 极致性能的复制出新类型对象.
*
* <p>预先通过BeanMapper.getType() 静态获取并缓存Type类型在此处传入
*/
public static <S, D> D map(S source, Type<S> sourceType, Type<D> destinationType) {
return mapper.map(source, sourceType, destinationType);
}
/**
* 简单的复制出新对象列表到ArrayList
*
* <p>不建议使用mapper.mapAsList(Iterable<S>,Class<D>)接口, sourceClass需要反射实在有点慢
*/
public static <S, D> List<D> mapList(
Iterable<S> sourceList, Class<S> sourceClass, Class<D> destinationClass) {
return mapper.mapAsList(
sourceList, TypeFactory.valueOf(sourceClass), TypeFactory.valueOf(destinationClass));
}
/**
* 极致性能的复制出新类型对象到ArrayList.
*
* <p>预先通过BeanMapper.getType() 静态获取并缓存Type类型在此处传入
*/
public static <S, D> List<D> mapList(
Iterable<S> sourceList, Type<S> sourceType, Type<D> destinationType) {
return mapper.mapAsList(sourceList, sourceType, destinationType);
}
/**
* 简单复制出新对象列表到数组
*
* <p>通过source.getComponentType() 获得源Class
*/
public static <S, D> D[] mapArray(
final D[] destination, final S[] source, final Class<D> destinationClass) {
return mapper.mapAsArray(destination, source, destinationClass);
}
/**
* 极致性能的复制出新类型对象到数组
*
* <p>预先通过BeanMapper.getType() 静态获取并缓存Type类型在此处传入
*/
public static <S, D> D[] mapArray(
D[] destination, S[] source, Type<S> sourceType, Type<D> destinationType) {
return mapper.mapAsArray(destination, source, sourceType, destinationType);
}
/** 预先获取orika转换所需要的Type避免每次转换. */
public static <E> Type<E> getType(final Class<E> rawType) {
return TypeFactory.valueOf(rawType);
}
public static MapperFactory getMapperFactory() {
return mapperFactory;
}
}

View File

@@ -0,0 +1,91 @@
package com.accompany.common.utils;
import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
/**
* @author Andy 2015-11-12
* @description 判断字符串、集合、哈希、数组对象是否为空
*/
public class BlankUtil {
/**
* 判断字符串是否为空
*/
public static boolean isBlank(final String str) {
return (str == null) || (str.trim().length() <= 0);
}
/**
* 判断字符是否为空
*
* @param cha
* @return
*/
public static boolean isBlank(final Character cha) {
return (cha == null) || cha.equals(' ');
}
/**
* 判断对象是否为空
*/
public static boolean isBlank(final Object obj) {
return (obj == null);
}
/**
* 判断数组是否为空
*
* @param objs
* @return
*/
public static boolean isBlank(final Object[] objs) {
return (objs == null) || (objs.length <= 0);
}
/**
* 判断Collectionj是否为空
*
* @param obj
* @return
*/
public static boolean isBlank(final Collection<?> obj) {
return (obj == null) || (obj.size() <= 0);
}
/**
* 判断Set是否为空
*
* @param obj
* @return
*/
public static boolean isBlank(final Set<?> obj) {
return (obj == null) || (obj.size() <= 0);
}
public static boolean isBlank(Integer i) {
return i == null || i < 1;
}
/**
* 判断Serializable是否为空
*
* @param obj
* @return
*/
public static boolean isBlank(final Serializable obj) {
return obj == null;
}
/**
* 判断Map是否为空
*
* @param obj
* @return
*/
public static boolean isBlank(final Map<?, ?> obj) {
return (obj == null) || (obj.size() <= 0);
}
}

View File

@@ -0,0 +1,43 @@
package com.accompany.common.utils;
import java.security.MessageDigest;
/**
* Created by liuguofu on 2017/4/27.
*/
public class CommonCheckSumBuilder {
// 计算并获取CheckSum
public static String getCheckSum(String appSecret, String nonce, String curTime) {
return encode("sha1", appSecret + nonce + curTime);
}
// 计算并获取md5值
public static String getMD5(String requestBody) {
return encode("md5", requestBody);
}
private static String encode(String algorithm, String value) {
if (value == null) {
return null;
}
try {
MessageDigest messageDigest
= MessageDigest.getInstance(algorithm);
messageDigest.update(value.getBytes());
return getFormattedText(messageDigest.digest());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private static String getFormattedText(byte[] bytes) {
int len = bytes.length;
StringBuilder buf = new StringBuilder(len * 2);
for (int j = 0; j < len; j++) {
buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);
buf.append(HEX_DIGITS[bytes[j] & 0x0f]);
}
return buf.toString();
}
private static final char[] HEX_DIGITS = { '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
}

Some files were not shown because too many files have changed in this diff Show More