Compare commits
148 Commits
56c7ed5545
...
ca9020b63d
401 changed files with 17378 additions and 1446 deletions
@ -0,0 +1,33 @@ |
|||
package com.bnyer.img.api.factory; |
|||
|
|||
import com.bnyer.common.core.domain.R; |
|||
import com.bnyer.img.api.remote.RemoteUserVipService; |
|||
import com.bnyer.img.api.vo.UserVipVo; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.cloud.openfeign.FallbackFactory; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 图文服务降级处理 |
|||
* |
|||
* @author penny |
|||
*/ |
|||
@Component |
|||
public class RemoteWxMiniFallbackFactory implements FallbackFactory<RemoteUserVipService> |
|||
{ |
|||
private static final Logger log = LoggerFactory.getLogger(RemoteWxMiniFallbackFactory.class); |
|||
|
|||
|
|||
@Override |
|||
public RemoteUserVipService create(Throwable throwable) { |
|||
log.error("api图文服务调用失败:{}", throwable.getMessage()); |
|||
return new RemoteUserVipService() { |
|||
@Override |
|||
public R<UserVipVo> queryUserVip(Long id) { |
|||
return R.fail("获取会员信息失败:+"+throwable.getMessage()); |
|||
} |
|||
|
|||
}; |
|||
} |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
package com.bnyer.img.api; |
|||
package com.bnyer.img.api.remote; |
|||
|
|||
import com.bnyer.common.core.constant.ServiceNameConstants; |
|||
import com.bnyer.common.core.domain.R; |
|||
@ -0,0 +1,24 @@ |
|||
package com.bnyer.img.api.remote; |
|||
|
|||
import com.bnyer.common.core.constant.ServiceNameConstants; |
|||
import com.bnyer.common.core.domain.R; |
|||
import com.bnyer.img.api.factory.RemoteWxMiniFallbackFactory; |
|||
import com.bnyer.img.api.vo.UserVipVo; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
@FeignClient(path = "/img/mini/vip",contextId = "remoteWxMiniService", value = ServiceNameConstants.IMG_SERVICE, fallbackFactory = RemoteWxMiniFallbackFactory.class) |
|||
public interface RemoteUserVipService { |
|||
|
|||
/** |
|||
* 获取会员信息 |
|||
* @return |
|||
*/ |
|||
@GetMapping(value = "/queryUserVip/{id}") |
|||
R<UserVipVo> queryUserVip(@PathVariable(value = "id") Long id); |
|||
} |
|||
@ -0,0 +1,63 @@ |
|||
package com.bnyer.img.api.vo; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("会员vip响应类") |
|||
public class UserVipVo implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键Id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="vip类型id") |
|||
private Long vipTypeId; |
|||
|
|||
@ApiModelProperty(value = "会员类型名称") |
|||
private String vipTypeName; |
|||
|
|||
@ApiModelProperty(value="vip编码") |
|||
private String vipCode; |
|||
|
|||
@ApiModelProperty(value="vip名称") |
|||
private String vipName; |
|||
|
|||
@ApiModelProperty(value="原价") |
|||
private BigDecimal originPrice; |
|||
|
|||
@ApiModelProperty(value="售价") |
|||
private BigDecimal price; |
|||
|
|||
@ApiModelProperty(value="描述") |
|||
private String description; |
|||
|
|||
@ApiModelProperty(value="热门描述") |
|||
private String hotSignDesc; |
|||
|
|||
@ApiModelProperty(value="排序") |
|||
private Integer sort; |
|||
|
|||
@ApiModelProperty(value="是否到期自动续费(0>否;1->是)") |
|||
private String isDelay; |
|||
|
|||
@ApiModelProperty(value = "用户客户端类型:10用户-抖音 20用户-快手 30用户-微信 40艺术家-微信") |
|||
private Integer userClientType; |
|||
|
|||
@ApiModelProperty(value = "有效时长单位:0天,1周,2月,3季,4年") |
|||
private Integer validTimeUnit; |
|||
|
|||
@ApiModelProperty(value = "有效时长:表示几天、几周、几月、几年") |
|||
private Integer validTimeNum; |
|||
|
|||
@ApiModelProperty(value = "会员类型编码") |
|||
private String vipTypeCode; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -1,2 +1,4 @@ |
|||
org.springframework.boot.autoconfigure.EnableAutoConfiguration = com.bnyer.img.api.factory.RemoteImgFallbackFactory |
|||
org.springframework.boot.autoconfigure.EnableAutoConfiguration =\ |
|||
com.bnyer.img.api.factory.RemoteImgFallbackFactory,\ |
|||
com.bnyer.img.api.factory.RemoteWxMiniFallbackFactory |
|||
|
|||
|
|||
@ -0,0 +1,26 @@ |
|||
<?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> |
|||
<groupId>com.dimensionalnode</groupId> |
|||
<artifactId>bnyer-api</artifactId> |
|||
<version>1.0.0</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<artifactId>bnyer-api-order</artifactId> |
|||
|
|||
<description> |
|||
bnyer-api-order订单服务接口模块 |
|||
</description> |
|||
|
|||
<dependencies> |
|||
<!-- bnyer Common Core--> |
|||
<dependency> |
|||
<groupId>com.dimensionalnode</groupId> |
|||
<artifactId>bnyer-common-core</artifactId> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
</project> |
|||
@ -0,0 +1,26 @@ |
|||
package com.bnyer.order.api.bean.query; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/03/27 |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@Setter |
|||
@NoArgsConstructor |
|||
public class VipOrderExtQuery implements Serializable { |
|||
|
|||
@ApiModelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="订单号") |
|||
private String orderNo; |
|||
|
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.bnyer.order.api.bean.query; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/03/27 |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@Setter |
|||
@NoArgsConstructor |
|||
public class VipOrderQuery implements Serializable { |
|||
|
|||
@ApiModelProperty(value="订单号") |
|||
private String orderNo; |
|||
|
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.bnyer.order.api.bean.vo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/03/27 |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@Setter |
|||
@NoArgsConstructor |
|||
public class VipOrderVo { |
|||
|
|||
@ApiModelProperty(value="主键") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="订单号") |
|||
private String orderNo; |
|||
|
|||
@ApiModelProperty(value="手机号") |
|||
private String phone; |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="vip表id") |
|||
private Long vipId; |
|||
|
|||
@ApiModelProperty(value = "vip编码") |
|||
private String vipCode; |
|||
|
|||
@ApiModelProperty(value = "vip名称") |
|||
private String vipName; |
|||
|
|||
@ApiModelProperty(value = "用户客户端类型:10用户-抖音 20用户-快手 30用户-微信 40艺术家-微信") |
|||
private Integer userClientType; |
|||
|
|||
@ApiModelProperty(value="是否到期自动续费(0>否;1->是)") |
|||
private String isDelay; |
|||
|
|||
@ApiModelProperty(value="时长天数") |
|||
private Integer days; |
|||
|
|||
@ApiModelProperty(value="支付金额") |
|||
private BigDecimal payAmount; |
|||
|
|||
@ApiModelProperty(value = "vip类型名称") |
|||
private String vipTypeName; |
|||
|
|||
@ApiModelProperty(value="订单状态:0待付款;1已付款;2已退款;3支付超时取消;4买家取消") |
|||
private Integer orderStatus; |
|||
|
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.bnyer.order.api.factory; |
|||
|
|||
import com.bnyer.common.core.domain.R; |
|||
import com.bnyer.order.api.bean.query.VipOrderQuery; |
|||
import com.bnyer.order.api.bean.query.VipOrderExtQuery; |
|||
import com.bnyer.order.api.remote.RemoteVipOrderService; |
|||
import com.bnyer.order.api.bean.vo.VipOrderVo; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.cloud.openfeign.FallbackFactory; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/04/03 |
|||
* @description :订单服务:vip订单接口熔断降级 |
|||
*/ |
|||
@Component |
|||
public class RemoteVipOrderFallbackFactory implements FallbackFactory<RemoteVipOrderService> |
|||
{ |
|||
private static final Logger log = LoggerFactory.getLogger(RemoteVipOrderFallbackFactory.class); |
|||
|
|||
|
|||
@Override |
|||
public RemoteVipOrderService create(Throwable throwable) { |
|||
log.error("api订单服务调用失败:{}", throwable.getMessage()); |
|||
return new RemoteVipOrderService() { |
|||
|
|||
@Override |
|||
public R<List<VipOrderVo>> queryVipOrderList(VipOrderQuery query) { |
|||
return R.fail("获取会员订单信息失败:+"+throwable.getMessage()); |
|||
} |
|||
|
|||
@Override |
|||
public R<VipOrderVo> queryVipOrder(VipOrderExtQuery query) { |
|||
return R.fail("获取会员订单信息失败:+"+throwable.getMessage()); |
|||
} |
|||
}; |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
package com.bnyer.order.api.remote; |
|||
|
|||
import com.bnyer.common.core.constant.ServiceNameConstants; |
|||
import com.bnyer.common.core.domain.R; |
|||
import com.bnyer.order.api.factory.RemoteVipOrderFallbackFactory; |
|||
import com.bnyer.order.api.bean.query.VipOrderQuery; |
|||
import com.bnyer.order.api.bean.query.VipOrderExtQuery; |
|||
import com.bnyer.order.api.bean.vo.VipOrderVo; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/04/03 |
|||
* @description :订单服务:vip订单接口远程调用 |
|||
*/ |
|||
@FeignClient(path = "/vip",contextId = "remoteVipOrderService", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteVipOrderFallbackFactory.class) |
|||
public interface RemoteVipOrderService { |
|||
|
|||
/** |
|||
* 获取会员订单信息 |
|||
* @param query |
|||
* @return |
|||
*/ |
|||
@PostMapping("/queryVipOrderList") |
|||
R<List<VipOrderVo>> queryVipOrderList(@RequestBody VipOrderQuery query); |
|||
|
|||
/** |
|||
* 查询会员订单信息(单表查询) |
|||
*/ |
|||
@PostMapping("/queryVipOrder") |
|||
R<VipOrderVo> queryVipOrder(@RequestBody VipOrderExtQuery query); |
|||
} |
|||
@ -0,0 +1,2 @@ |
|||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.bnyer.order.api.factory.RemoteVipOrderFallbackFactory |
|||
|
|||
@ -1,4 +1,4 @@ |
|||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ |
|||
com.bnyer.system.api.factory.RemoteUserFallbackFactory,\ |
|||
com.bnyer.system.api.factory.RemoteLogFallbackFactory, \ |
|||
com.bnyer.system.api.factory.RemoteFileFallbackFactory |
|||
com.bnyer.system.api.factory.RemoteSystemFileFallbackFactory |
|||
|
|||
@ -0,0 +1,36 @@ |
|||
package com.bnyer.auth.config; |
|||
|
|||
import com.bnyer.auth.serializer.LongToStringSerializer; |
|||
import com.fasterxml.jackson.databind.DeserializationFeature; |
|||
import com.fasterxml.jackson.databind.ObjectMapper; |
|||
import com.fasterxml.jackson.databind.module.SimpleModule; |
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.context.annotation.Primary; |
|||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; |
|||
|
|||
/** |
|||
* 解决雪花Id长度超过16位前端传入精度丢失的问题 |
|||
*/ |
|||
@Configuration |
|||
public class JsonConfig { |
|||
@Bean |
|||
@Primary |
|||
@ConditionalOnMissingBean(ObjectMapper.class) |
|||
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) |
|||
{ |
|||
ObjectMapper objectMapper = builder.createXmlMapper(false).build(); |
|||
// 全局配置序列化返回 JSON 处理
|
|||
SimpleModule simpleModule = new SimpleModule(); |
|||
//JSON Long ==> String
|
|||
//自定义字符串转化规则ToStringSerializer换成自定义的LongToStringSerializer
|
|||
simpleModule.addSerializer(Long.class, LongToStringSerializer.instance); |
|||
simpleModule.addSerializer(Long.TYPE, LongToStringSerializer.instance); |
|||
|
|||
objectMapper.registerModule(simpleModule); |
|||
//参数在bean中没有的情况处理
|
|||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
|||
return objectMapper; |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.bnyer.auth.serializer; |
|||
|
|||
import com.fasterxml.jackson.core.JsonGenerator; |
|||
import com.fasterxml.jackson.databind.JsonSerializer; |
|||
import com.fasterxml.jackson.databind.SerializerProvider; |
|||
|
|||
import java.io.IOException; |
|||
|
|||
public class LongToStringSerializer extends JsonSerializer<Long> { |
|||
public static final LongToStringSerializer instance = new LongToStringSerializer(); |
|||
|
|||
@Override |
|||
public void serialize(Long id, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { |
|||
if(id != null){ |
|||
//长度小于某个值的,还是保持long类型
|
|||
if(id < 10000000000000000L){ |
|||
jsonGenerator.writeNumber(id); |
|||
}else { |
|||
//长度超过某个值的,转化为字符串
|
|||
jsonGenerator.writeString(id.toString()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,351 @@ |
|||
package com.bnyer.common.core.annotation; |
|||
|
|||
|
|||
import org.apache.commons.lang3.StringUtils; |
|||
|
|||
import javax.validation.Constraint; |
|||
import javax.validation.ConstraintValidator; |
|||
import javax.validation.ConstraintValidatorContext; |
|||
import javax.validation.Payload; |
|||
import java.lang.annotation.Documented; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
import java.util.regex.Matcher; |
|||
import java.util.regex.Pattern; |
|||
|
|||
import static java.lang.annotation.ElementType.*; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/04/11 |
|||
* @description : |
|||
*/ |
|||
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER}) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
@Constraint(validatedBy = { CustomParamsValidation.CustomParamsValidationImpl.class }) |
|||
public @interface CustomParamsValidation { |
|||
|
|||
/** |
|||
* 预定义的正则表达式 |
|||
*/ |
|||
class Regexp{ |
|||
/** |
|||
* 常规输入框:匹配中文,字母,数字 |
|||
*/ |
|||
private final static String INPUTTXT="^[A-Za-z0-9\u4e00-\u9fa5]*$"; |
|||
|
|||
/** |
|||
* 昵称匹配:匹配中文,字母,数字 下划线 |
|||
*/ |
|||
private final static String NICKNAME="^[A-Za-z0-9_\u4e00-\u9fa5]*$"; |
|||
|
|||
/**********以上public 的正则提供 regexp 属性使用**********/ |
|||
|
|||
/**********以下private 的正则提供 paramType 计算**********/ |
|||
/** |
|||
* 匹配邮箱 |
|||
*/ |
|||
private final static String EMAIL="^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"; |
|||
/** |
|||
* uuid |
|||
* 格式 |
|||
* {8}-{4}-{4}-{4}-{12} |
|||
* 如 |
|||
* 4cbd6c8b-1111-45f4-b477-a524707aedfd |
|||
*/ |
|||
private static final String UUID="^[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}$"; |
|||
/** |
|||
* yyyy-MM-dd |
|||
*/ |
|||
private static final String DATE = "^[1-9][0-9]{3}-((01|03|05|07|08|10|12)-(0[1-9]|[1-2][0-9]|30|31)|(04|06|09|11)-(0[1-9]|[1-2][0-9]|30)|(02)-(0[1-9]|1[0-9]|2[0-9]))$"; |
|||
/** |
|||
* yyyyMMdd |
|||
*/ |
|||
private static final String DATE2 = "^[1-9][0-9]{3}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|30|31)|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|(02)(0[1-9]|1[0-9]|2[0-9]))$"; |
|||
/** |
|||
* yyyy-MM-dd HH:mm:ss |
|||
*/ |
|||
private static final String DATETIME = "^[1-9][0-9]{3}-((01|03|05|07|08|10|12)-(0[1-9]|[1-2][0-9]|30|31)|(04|06|09|11)-(0[1-9]|[1-2][0-9]|30)|(02)-(0[1-9]|1[0-9]|2[0-9])) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"; |
|||
/** |
|||
* yyyyMMddHHmmss |
|||
*/ |
|||
private static final String DATETIME2 = "^[1-9][0-9]{3}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|30|31)|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|(02)(0[1-9]|1[0-9]|2[0-9]))([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$"; |
|||
/** |
|||
* yyyy-MM-dd HH:mm |
|||
*/ |
|||
private static final String DATETIME3 = "^[1-9][0-9]{3}-((01|03|05|07|08|10|12)-(0[1-9]|[1-2][0-9]|30|31)|(04|06|09|11)-(0[1-9]|[1-2][0-9]|30)|(02)-(0[1-9]|1[0-9]|2[0-9])) ([01][0-9]|2[0-3]):([0-5][0-9])$"; |
|||
|
|||
/** |
|||
* HH:mm:ss |
|||
*/ |
|||
private static final String TIME = "^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"; |
|||
/** |
|||
* HHmmss |
|||
*/ |
|||
private static final String TIME2 = "^([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$"; |
|||
|
|||
/** |
|||
* 手机号码 |
|||
*/ |
|||
private static final String MOBILEPHONE="^1\\d{10}$"; |
|||
|
|||
/** |
|||
* 匹配IPV4地址 |
|||
*/ |
|||
private final static String IPV4="((25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d)))\\.){3}(25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d)))"; |
|||
//=============可以在此扩展正则=============
|
|||
|
|||
|
|||
/** |
|||
* 校验正则 |
|||
* @param regexp |
|||
* @param value |
|||
* @return |
|||
*/ |
|||
public static boolean validateRegexp(String regexp,String value){ |
|||
Pattern pattern = Pattern.compile(regexp); |
|||
Matcher matcher = pattern.matcher(value); |
|||
return matcher.matches(); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 预定义的参数类型 |
|||
*/ |
|||
class ParamType { |
|||
//匹配IPV4地址
|
|||
public static final String IPV4 = "ipv4"; |
|||
/** |
|||
* uuid |
|||
*/ |
|||
public static final String UUID="uuid"; |
|||
/** |
|||
* 匹配中文 |
|||
*/ |
|||
public static final String INPUTTXT="inputtxt"; |
|||
/** |
|||
* 匹配中文英文数字下划线 |
|||
*/ |
|||
public static final String NICKNAME="nickname"; |
|||
|
|||
/** |
|||
* 匹配邮箱 |
|||
*/ |
|||
public static final String EMAIL="email"; |
|||
|
|||
/** |
|||
* 手机号码 |
|||
*/ |
|||
public static final String MOBILEPHONE="mobilephone"; |
|||
|
|||
/** |
|||
* yyyy-MM-dd |
|||
*/ |
|||
public static final String DATE = "yyyy-MM-dd"; |
|||
/** |
|||
* yyyyMMdd |
|||
*/ |
|||
public static final String DATE2 = "yyyyMMdd"; |
|||
/** |
|||
* yyyy-MM-dd HH:mm:ss |
|||
*/ |
|||
public static final String DATETIME = "yyyy-MM-dd HH:mm:ss"; |
|||
/** |
|||
* yyyyMMddHHmmss |
|||
*/ |
|||
public static final String DATETIME2 = "yyyyMMddHHmmss"; |
|||
/** |
|||
* yyyy-MM-dd HH:mm |
|||
*/ |
|||
public static final String DATETIME3 = "yyyy-MM-dd HH:mm"; |
|||
|
|||
/** |
|||
* HH:mm:ss |
|||
*/ |
|||
public static final String TIME = "HH:mm:ss"; |
|||
/** |
|||
* HHmmss |
|||
*/ |
|||
public static final String TIME2 = "HHmmss"; |
|||
/** |
|||
* 参数类型校验 |
|||
* |
|||
* @param paramType |
|||
* @param value |
|||
* @return |
|||
*/ |
|||
public static boolean validateParamType(String paramType, String value) { |
|||
boolean flag = false; |
|||
|
|||
switch (paramType) { |
|||
case ParamType.IPV4: |
|||
value = value.replaceAll(" ",""); |
|||
flag = Regexp.validateRegexp(Regexp.IPV4, value); |
|||
break; |
|||
case ParamType.MOBILEPHONE: flag = Regexp.validateRegexp(Regexp.MOBILEPHONE, value);break; |
|||
case ParamType.NICKNAME: flag = Regexp.validateRegexp(Regexp.NICKNAME, value);break; |
|||
case ParamType.EMAIL: flag = Regexp.validateRegexp(Regexp.EMAIL, value);break; |
|||
case ParamType.UUID : flag = Regexp.validateRegexp(Regexp.UUID, value);break; |
|||
case ParamType.INPUTTXT : flag = Regexp.validateRegexp(Regexp.INPUTTXT, value);break; |
|||
case ParamType.DATE : flag = validateDateParamType(ParamType.DATE, value);break; |
|||
case ParamType.DATE2 : flag = validateDateParamType(ParamType.DATE2, value);break; |
|||
case ParamType.DATETIME : flag = validateDateParamType(ParamType.DATETIME, value);break; |
|||
case ParamType.DATETIME2 : flag = validateDateParamType(ParamType.DATETIME2, value);break; |
|||
case ParamType.DATETIME3 : flag = validateDateParamType(ParamType.DATETIME3, value);break; |
|||
case ParamType.TIME : flag = validateDateParamType(ParamType.TIME, value);break; |
|||
case ParamType.TIME2 : flag = validateDateParamType(ParamType.TIME2, value);break; |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* dateFormat 属性配置,配置的值 不是内置值,验证无法通过 |
|||
* @param dateFormat |
|||
* @param value |
|||
* @return |
|||
*/ |
|||
private static boolean validateDateParamType(String dateFormat,String value){ |
|||
String regexp = null; |
|||
|
|||
if(DATE.equals(dateFormat)){ |
|||
regexp = Regexp.DATE; |
|||
}else if(DATE2.equals(dateFormat)){ |
|||
regexp = Regexp.DATE2; |
|||
}else if(DATETIME.equals(dateFormat)){ |
|||
regexp = Regexp.DATETIME; |
|||
}else if(DATETIME2.equals(dateFormat)){ |
|||
regexp = Regexp.DATETIME2; |
|||
}else if(DATETIME3.equals(dateFormat)){ |
|||
regexp = Regexp.DATETIME3; |
|||
}else if(TIME.equals(dateFormat)){ |
|||
regexp = Regexp.TIME; |
|||
}else if(TIME2.equals(dateFormat)){ |
|||
regexp = Regexp.TIME2; |
|||
} |
|||
|
|||
if(regexp!=null){ |
|||
boolean flag = Regexp.validateRegexp(regexp, value); |
|||
//时间不用做2月29日瑞年判断
|
|||
if(TIME.equals(dateFormat) || TIME2.equals(dateFormat)){ |
|||
return flag; |
|||
} |
|||
if(flag){ |
|||
//月份和日期部分
|
|||
String monthAndDay = ""; |
|||
//2月29日常量
|
|||
String monthAndDayConstant = ""; |
|||
Integer year = null; |
|||
switch (dateFormat) { |
|||
case DATE: |
|||
case DATETIME: |
|||
case DATETIME3: |
|||
monthAndDay = StringUtils.substring(value, 5, 10); |
|||
monthAndDayConstant = "02-29"; |
|||
year = Integer.valueOf(StringUtils.substring(value, 0, 4)); |
|||
break; |
|||
case DATE2: |
|||
case DATETIME2: |
|||
monthAndDay = StringUtils.substring(value, 4, 8); |
|||
monthAndDayConstant = "0229"; |
|||
year = Integer.valueOf(StringUtils.substring(value, 0, 4)); |
|||
break; |
|||
} |
|||
//2月29日判断是否是润年,非润年没有2月29日
|
|||
if(monthAndDay.equals(monthAndDayConstant)){ |
|||
if(!isLeapYear(year)){ |
|||
flag = false; |
|||
} |
|||
} |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
|
|||
/** |
|||
* 判断是否是润年 |
|||
* @param year |
|||
* @return |
|||
*/ |
|||
private static boolean isLeapYear(int year){ |
|||
return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 预定义Range |
|||
* |
|||
*/ |
|||
class Range{ |
|||
private static boolean contains(String range,String value){ |
|||
boolean flag = false; |
|||
if(StringUtils.isEmpty(value)){ |
|||
return false; |
|||
} |
|||
if(StringUtils.isNotEmpty(range)){ |
|||
String[] arr = range.split("\\|"); |
|||
for (String string : arr) { |
|||
if(value.equals(string)){ |
|||
flag = true; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
return flag; |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 参数类型,最优先推荐使用的属性 |
|||
* @return |
|||
*/ |
|||
String paramType() default ""; |
|||
|
|||
/** |
|||
* 限制字符串或者数字 可选项,用 | 分割 ,如 00|10|20 |
|||
* @return |
|||
*/ |
|||
String range() default ""; |
|||
|
|||
String message() default "参数基本校验不通过错误:注意格式及长度"; |
|||
|
|||
Class<?>[]groups() default {}; |
|||
|
|||
Class<? extends Payload>[]payload() default {}; |
|||
|
|||
class CustomParamsValidationImpl implements ConstraintValidator<CustomParamsValidation,String> { |
|||
|
|||
String paramType; |
|||
|
|||
String range; |
|||
|
|||
|
|||
@Override |
|||
public void initialize(CustomParamsValidation constraintAnnotation) { |
|||
paramType = constraintAnnotation.paramType(); |
|||
range = constraintAnnotation.range(); |
|||
} |
|||
|
|||
@Override |
|||
public boolean isValid(String value, ConstraintValidatorContext context) { |
|||
if(StringUtils.isNotEmpty(value)){ |
|||
//根据参数类型校验正则
|
|||
if(StringUtils.isNotEmpty(paramType)){ |
|||
return ParamType.validateParamType(paramType, value); |
|||
} |
|||
//校验参数范围
|
|||
if (StringUtils.isNotEmpty(range)){ |
|||
return Range.contains(range, value); |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,63 @@ |
|||
package com.bnyer.common.core.annotation; |
|||
|
|||
import java.lang.annotation.Documented; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
|
|||
import static java.lang.annotation.ElementType.METHOD; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/05/12 |
|||
* @description : 防重复提交 |
|||
*/ |
|||
@Target({ METHOD}) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface LimitRepeatRequest { |
|||
|
|||
/** |
|||
* 限制当前用户同一个api 不能重复提交 |
|||
*/ |
|||
String SELF="self"; |
|||
|
|||
/** |
|||
* 限制所有用户同一个参数不能重复提交,如我新增了用户 张三, 那么其他人不能再并发情况下重复添加张三 |
|||
*/ |
|||
String ALL_USER="all"; |
|||
|
|||
/** |
|||
* 当前时间内 api 只能请求一次,单位秒 |
|||
* @return |
|||
*/ |
|||
long time() default 5; |
|||
|
|||
/** |
|||
* 对部分参数做重复请求限制 |
|||
* @return |
|||
*/ |
|||
String[] bodyParam() default {}; |
|||
|
|||
/** |
|||
* 是否对全部参数做重复请求限制 |
|||
* @return |
|||
*/ |
|||
boolean bodyAllParam() default false; |
|||
|
|||
/** |
|||
* 重复请求限制的用户范围 |
|||
* LimitRepeatRequest.SELF:针对当前登录用户 |
|||
* LimitRepeatRequest.ALL_USER:针对所有用户 |
|||
* |
|||
* @return |
|||
*/ |
|||
String userRange() default SELF; |
|||
|
|||
/** |
|||
* 错误提示信息 |
|||
* @return |
|||
*/ |
|||
String message() default ""; |
|||
|
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
/** |
|||
* 支付宝支付配置表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-domain-PayAlipayConfig") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "pay_alipay_config") |
|||
public class AlipayConfig extends BaseDomain { |
|||
|
|||
/** |
|||
* appid |
|||
*/ |
|||
@TableField(value = "appid") |
|||
@ApiModelProperty(value="appid") |
|||
private String appid; |
|||
|
|||
/** |
|||
* app私钥 |
|||
*/ |
|||
@TableField(value = "app_private_key") |
|||
@ApiModelProperty(value="app私钥") |
|||
private String appPrivateKey; |
|||
|
|||
/** |
|||
* 阿里公钥 |
|||
*/ |
|||
@TableField(value = "alipay_public_key") |
|||
@ApiModelProperty(value="阿里公钥") |
|||
private String alipayPublicKey; |
|||
|
|||
/** |
|||
* RSA/RSA2 |
|||
*/ |
|||
@TableField(value = "key_type") |
|||
@ApiModelProperty(value="RSA/RSA2") |
|||
private String keyType; |
|||
|
|||
/** |
|||
* 回调地址url |
|||
*/ |
|||
@TableField(value = "backurl") |
|||
@ApiModelProperty(value="回调地址url") |
|||
private String backurl; |
|||
|
|||
/** |
|||
* 帐号状态(0正常 1停用) |
|||
*/ |
|||
@TableField(value = "status") |
|||
@ApiModelProperty(value="帐号状态(0正常 1停用)") |
|||
private String status; |
|||
|
|||
@TableField(value = "remark") |
|||
@ApiModelProperty(value="") |
|||
private String remark; |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.bnyer.common.core.enums.EnumMessageStatus; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/05/18 |
|||
* @description :消息记录公共实体 |
|||
*/ |
|||
@Data |
|||
public class BaseMqMessage { |
|||
|
|||
@TableId(value = "id", type = IdType.ASSIGN_ID) |
|||
private Long id; |
|||
|
|||
/** |
|||
* 消息key,作为redis的key,消费的时候判断是否存在, |
|||
* 存在就判断状态是否是已消费,如果不是就进行消费,如果是就过滤该消息 |
|||
*/ |
|||
@TableField(value = "message_key") |
|||
private String messageKey; |
|||
|
|||
/** |
|||
* 消息主题 |
|||
*/ |
|||
@TableField(value = "topic") |
|||
private String topic; |
|||
|
|||
/** |
|||
* 消息tag |
|||
*/ |
|||
@TableField(value = "tag") |
|||
private String tag; |
|||
|
|||
/** |
|||
* 消费组名称 |
|||
*/ |
|||
@TableField(value = "consumer_group_name") |
|||
private String consumerGroupName; |
|||
|
|||
/** |
|||
* 返回主题 |
|||
*/ |
|||
@TableField(value = "return_topic") |
|||
private String returnTopic; |
|||
|
|||
/** |
|||
* 消息状态 |
|||
*/ |
|||
@TableField(value = "status") |
|||
private EnumMessageStatus status; |
|||
|
|||
/** |
|||
* 消息内容 |
|||
*/ |
|||
@TableField(value = "content") |
|||
private String content; |
|||
|
|||
/** |
|||
* 错误信息 |
|||
*/ |
|||
@TableField(value = "err_msg") |
|||
private String errMsg; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@TableField(value = "create_time") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date createTime; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
/** |
|||
* 意心记录表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-DiamondLog") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_diamond_log") |
|||
public class DiamondLog extends BaseDomain { |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@TableField(value = "user_id") |
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 意心获取/消耗点数 |
|||
*/ |
|||
@TableField(value = "diamond_num") |
|||
@ApiModelProperty(value="意心获取/消耗点数") |
|||
private Integer diamondNum; |
|||
|
|||
/** |
|||
* 获取/消耗原因 |
|||
*/ |
|||
@TableField(value = "reason") |
|||
@ApiModelProperty(value="获取/消耗原因") |
|||
private String reason; |
|||
|
|||
/** |
|||
* 平台(0->Hub;1->抖音;2->快手;3->微信) |
|||
*/ |
|||
@TableField(value = "`source`") |
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
|
|||
/** |
|||
* app类型(0->次元意境;1->妙鸭壁纸) |
|||
*/ |
|||
@TableField(value = "app_type") |
|||
@ApiModelProperty(value="app类型(0->次元意境;1->妙鸭壁纸)") |
|||
private String appType; |
|||
|
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,69 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
/** |
|||
* 抖音支付配置表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-domain-PayDypayConfig") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "pay_dypay_config") |
|||
public class DypayConfig extends BaseDomain { |
|||
/** |
|||
* appid |
|||
*/ |
|||
@TableField(value = "appid") |
|||
@ApiModelProperty(value="appid") |
|||
private String appid; |
|||
|
|||
/** |
|||
* 应用秘钥 |
|||
*/ |
|||
@TableField(value = "appSecret") |
|||
@ApiModelProperty(value="应用秘钥") |
|||
private String appSecret; |
|||
|
|||
/** |
|||
* 支付秘钥 |
|||
*/ |
|||
@TableField(value = "salt") |
|||
@ApiModelProperty(value="支付秘钥") |
|||
private String salt; |
|||
|
|||
/** |
|||
* 令牌 |
|||
*/ |
|||
@TableField(value = "token") |
|||
@ApiModelProperty(value="支付令牌") |
|||
private String token; |
|||
|
|||
/** |
|||
* 回调地址url |
|||
*/ |
|||
@TableField(value = "backurl") |
|||
@ApiModelProperty(value="回调地址url") |
|||
private String backurl; |
|||
|
|||
/** |
|||
* 帐号状态(0正常 1停用) |
|||
*/ |
|||
@TableField(value = "status") |
|||
@ApiModelProperty(value="帐号状态(0正常 1停用)") |
|||
private String status; |
|||
|
|||
@TableField(value = "remark") |
|||
@ApiModelProperty(value="") |
|||
private String remark; |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
/** |
|||
* 画意值记录 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-GoldLog") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_gold_log") |
|||
public class GoldLog extends BaseDomain { |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@TableField(value = "user_id") |
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 画意值获取/消耗点数 |
|||
*/ |
|||
@TableField(value = "gold_num") |
|||
@ApiModelProperty(value="画意值获取/消耗点数") |
|||
private Integer goldNum; |
|||
|
|||
/** |
|||
* 获取/消耗原因 |
|||
*/ |
|||
@TableField(value = "reason") |
|||
@ApiModelProperty(value="获取/消耗原因") |
|||
private String reason; |
|||
|
|||
/** |
|||
* 平台(1->抖音;2->快手;3->微信) |
|||
*/ |
|||
@TableField(value = "`source`") |
|||
@ApiModelProperty(value="平台(1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
|
|||
/** |
|||
* app类型(0->次元意境;1->妙鸭壁纸) |
|||
*/ |
|||
@TableField(value = "app_type") |
|||
@ApiModelProperty(value="app类型(0->次元意境;1->妙鸭壁纸)") |
|||
private String appType; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/05/18 |
|||
* @description :图片服务本地消息表 |
|||
*/ |
|||
@Getter |
|||
@Setter |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_mq_message_record") |
|||
public class ImgMqMessageRecord extends BaseMqMessage{ |
|||
|
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
/** |
|||
* 快手支付配置表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-domain-PayKspayConfig") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "pay_kspay_config") |
|||
public class KspayConfig extends BaseDomain { |
|||
/** |
|||
* appid |
|||
*/ |
|||
@TableField(value = "appid") |
|||
@ApiModelProperty(value="appid") |
|||
private String appid; |
|||
|
|||
/** |
|||
* 秘钥 |
|||
*/ |
|||
@TableField(value = "secret") |
|||
@ApiModelProperty(value="秘钥") |
|||
private String secret; |
|||
|
|||
/** |
|||
* 回调地址url |
|||
*/ |
|||
@TableField(value = "backurl") |
|||
@ApiModelProperty(value="回调地址url") |
|||
private String backurl; |
|||
|
|||
/** |
|||
* 帐号状态(0正常 1停用) |
|||
*/ |
|||
@TableField(value = "status") |
|||
@ApiModelProperty(value="帐号状态(0正常 1停用)") |
|||
private String status; |
|||
|
|||
@TableField(value = "remark") |
|||
@ApiModelProperty(value="") |
|||
private String remark; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/05/18 |
|||
* @description :订单服务本地消息表 |
|||
*/ |
|||
@Getter |
|||
@Setter |
|||
@NoArgsConstructor |
|||
@TableName(value = "order_mq_message_record") |
|||
public class OrderMqMessageRecord extends BaseMqMessage{ |
|||
|
|||
} |
|||
@ -0,0 +1,222 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
/** |
|||
* 付款信息表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-domain-PayPayInfo") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "pay_pay_info") |
|||
public class PayInfo extends BaseDomain { |
|||
|
|||
/** |
|||
* 支付单号(内部生成) |
|||
*/ |
|||
@TableField(value = "pay_id") |
|||
@ApiModelProperty(value="支付单号(内部生成)") |
|||
private String payId; |
|||
|
|||
/** |
|||
* 业务主订单号:关联内部业务订单表 |
|||
*/ |
|||
@TableField(value = "order_no") |
|||
@ApiModelProperty(value="业务主订单号:关联内部业务订单表") |
|||
private String orderNo; |
|||
|
|||
/** |
|||
* 支付状态:1000未支付;1001支付成功 ;1002支付失败 |
|||
*/ |
|||
@TableField(value = "pay_status") |
|||
@ApiModelProperty(value="支付状态:1000未支付;1001支付成功 ;1002支付失败") |
|||
private Integer payStatus; |
|||
|
|||
/** |
|||
* 单笔对账状态:1001 对账成功 |
|||
*/ |
|||
@TableField(value = "single_status") |
|||
@ApiModelProperty(value="单笔对账状态:1001 对账成功") |
|||
private Integer singleStatus; |
|||
|
|||
/** |
|||
* 单笔对账时间 |
|||
*/ |
|||
@TableField(value = "single_time") |
|||
@ApiModelProperty(value="单笔对账时间") |
|||
private Date singleTime; |
|||
|
|||
|
|||
/** |
|||
* 支付类型:wxpay/alipay/kspay/dypay |
|||
*/ |
|||
@TableField(value = "pay_type") |
|||
@ApiModelProperty(value="支付类型:wxpay/alipay/kspay/dypay") |
|||
private String payType; |
|||
|
|||
/** |
|||
* 支付渠道 |
|||
*/ |
|||
@TableField(value = "pay_channel") |
|||
@ApiModelProperty(value="支付渠道:wxpay/alipay") |
|||
private String payChannel; |
|||
|
|||
/** |
|||
* 交易类型:1--JSAPI支付(小程序appId支付)、2--Native支付、3--app支付,4--JSAPI支付(公众号appId支付)5--H5支付 |
|||
*/ |
|||
@TableField(value = "trade_type") |
|||
@ApiModelProperty(value = "交易类型:1--JSAPI支付(小程序appId支付)、2--Native支付、3--app支付,4--JSAPI支付(公众号appId支付)5--H5支付") |
|||
private String tradeType; |
|||
|
|||
/** |
|||
* 支付单号(第三方返回) |
|||
*/ |
|||
@TableField(value = "pay_no") |
|||
@ApiModelProperty(value="支付单号(第三方返回)") |
|||
private String payNo; |
|||
|
|||
/** |
|||
* 用户侧订单号(第三方返回) |
|||
*/ |
|||
@TableField(value = "trade_no") |
|||
@ApiModelProperty(value="用户侧订单号(第三方返回)") |
|||
private String tradeNo; |
|||
|
|||
/** |
|||
* appid |
|||
*/ |
|||
@TableField(value = "appid") |
|||
@ApiModelProperty(value="appid") |
|||
private String appid; |
|||
|
|||
/** |
|||
* 商品标题 |
|||
*/ |
|||
@TableField(value = "goods_subject") |
|||
@ApiModelProperty(value="商品标题") |
|||
private String goodsSubject; |
|||
|
|||
/** |
|||
* 商品描述 |
|||
*/ |
|||
@TableField(value = "goods_desc") |
|||
@ApiModelProperty(value="商品描述") |
|||
private String goodsDesc; |
|||
|
|||
/** |
|||
* 支付金额,单位元 |
|||
*/ |
|||
@TableField(value = "pay_amount") |
|||
@ApiModelProperty(value="支付金额,单位元") |
|||
private BigDecimal payAmount; |
|||
|
|||
/** |
|||
* 支付时间 |
|||
*/ |
|||
@TableField(value = "pay_time") |
|||
@ApiModelProperty(value="支付时间") |
|||
private Date payTime; |
|||
|
|||
/** |
|||
* 支付场景:1.会员充值 |
|||
*/ |
|||
@TableField(value = "scene_code") |
|||
@ApiModelProperty(value="支付场景:1.会员充值") |
|||
private Integer sceneCode; |
|||
|
|||
/** |
|||
* 用户ip |
|||
*/ |
|||
@TableField(value = "ip") |
|||
@ApiModelProperty(value="用户ip") |
|||
private String ip; |
|||
|
|||
/** |
|||
* 调用第三方下单返回 |
|||
*/ |
|||
@TableField(value = "third_code") |
|||
@ApiModelProperty(value="调用第三方下单返回") |
|||
private String thirdCode; |
|||
|
|||
/** |
|||
* 调用第三方下单返回 |
|||
*/ |
|||
@TableField(value = "third_msg") |
|||
@ApiModelProperty(value="调用第三方下单返回") |
|||
private String thirdMsg; |
|||
|
|||
/** |
|||
* 调用第三方下单返回 |
|||
*/ |
|||
@TableField(value = "third_no") |
|||
@ApiModelProperty(value="调用第三方下单返回") |
|||
private String thirdNo; |
|||
|
|||
/** |
|||
* 退款状态 1000 未退款 1001退款失败 1002 退款成功 1003 退款中 |
|||
*/ |
|||
@TableField(value = "refund_status") |
|||
@ApiModelProperty(value="退款状态 1000 未退款 1001退款失败 1002 退款成功 1003 退款中") |
|||
private Integer refundStatus; |
|||
|
|||
/** |
|||
* 退款时间 |
|||
*/ |
|||
@TableField(value = "refund_time") |
|||
@ApiModelProperty(value="退款时间") |
|||
private Date refundTime; |
|||
|
|||
/** |
|||
* 退款金额 |
|||
*/ |
|||
@TableField(value = "refund_amount") |
|||
@ApiModelProperty(value="退款金额") |
|||
private BigDecimal refundAmount; |
|||
|
|||
/** |
|||
* 退款流水号(第三方返回) |
|||
*/ |
|||
@TableField(value = "refund_no") |
|||
@ApiModelProperty(value="退款流水号(第三方返回)") |
|||
private String refundNo; |
|||
|
|||
/** |
|||
* 退款接口调用code(第三方返回) |
|||
*/ |
|||
@TableField(value = "refund_code") |
|||
@ApiModelProperty(value="退款接口调用code(第三方返回)") |
|||
private String refundCode; |
|||
|
|||
/** |
|||
* 退款接口调用msg(第三方返回) |
|||
*/ |
|||
@TableField(value = "refund_msg") |
|||
@ApiModelProperty(value="退款接口调用msg(第三方返回)") |
|||
private String refundMsg; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@TableField(value = "remark") |
|||
@ApiModelProperty(value="备注") |
|||
private String remark; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/05/18 |
|||
* @description :支付服务本地消息表 |
|||
*/ |
|||
@Getter |
|||
@Setter |
|||
@NoArgsConstructor |
|||
@TableName(value = "pay_mq_message_record") |
|||
public class PayMqMessageRecord extends BaseMqMessage{ |
|||
|
|||
} |
|||
@ -0,0 +1,134 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
/** |
|||
* 会员订单表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-domain-OrderVipOrder") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "order_vip_order") |
|||
public class VipOrder extends BaseDomain { |
|||
|
|||
/** |
|||
* 订单号 |
|||
*/ |
|||
@TableField(value = "order_no") |
|||
@ApiModelProperty(value="订单号") |
|||
private String orderNo; |
|||
|
|||
/** |
|||
* 用户手机号 |
|||
*/ |
|||
@TableField(value = "phone") |
|||
@ApiModelProperty(value="用户手机号") |
|||
private String phone; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@TableField(value = "user_id") |
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
/** |
|||
* vip主键Id |
|||
*/ |
|||
@TableField(value = "vip_id") |
|||
@ApiModelProperty(value="vip主键Id") |
|||
private Long vipId; |
|||
|
|||
/** |
|||
* vip编码 |
|||
*/ |
|||
@TableField(value = "vip_code") |
|||
@ApiModelProperty(value="vip编码") |
|||
private String vipCode; |
|||
|
|||
/** |
|||
* vip名称 |
|||
*/ |
|||
@TableField(value = "vip_name") |
|||
@ApiModelProperty(value="vip名称") |
|||
private String vipName; |
|||
|
|||
/** |
|||
* 支付金额,单位元 |
|||
*/ |
|||
@TableField(value = "pay_amount") |
|||
@ApiModelProperty(value="支付金额,单位元") |
|||
private BigDecimal payAmount; |
|||
|
|||
/** |
|||
* 是否到期自动续费(0>否;1->是) |
|||
*/ |
|||
@TableField(value = "is_delay") |
|||
@ApiModelProperty(value="是否到期自动续费(0>否;1->是)") |
|||
private String isDelay; |
|||
|
|||
/** |
|||
* 时长天数 |
|||
*/ |
|||
@TableField(value = "days") |
|||
@ApiModelProperty(value="时长天数") |
|||
private Integer days; |
|||
|
|||
/** |
|||
* 订单状态:0未处理;1成功;2失败 |
|||
*/ |
|||
@TableField(value = "order_status") |
|||
@ApiModelProperty(value="订单状态:0待付款;1已付款;2已退款;3支付超时取消;4买家取消") |
|||
private Integer orderStatus; |
|||
|
|||
/** |
|||
* 支付时间 |
|||
*/ |
|||
@TableField(value = "pay_time") |
|||
@ApiModelProperty(value="支付时间") |
|||
private Date payTime; |
|||
|
|||
/** |
|||
* 取消时间 |
|||
*/ |
|||
@TableField(value = "cancel_time") |
|||
@ApiModelProperty(value="取消时间") |
|||
private Date cancelTime; |
|||
|
|||
/** |
|||
* 用户客户端类型:10用户-抖音 20用户-快手 30用户-微信 40艺术家-微信 |
|||
*/ |
|||
@TableField(value = "user_client_type") |
|||
@ApiModelProperty(value = "用户客户端类型:10用户-抖音 20用户-快手 30用户-微信 40艺术家-微信") |
|||
private Integer userClientType; |
|||
|
|||
/** |
|||
* vip类型名称 |
|||
*/ |
|||
@TableField(value = "vip_type_name") |
|||
@ApiModelProperty(value = "vip类型名称") |
|||
private String vipTypeName; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@TableField(value = "remark") |
|||
@ApiModelProperty(value="备注") |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_vip_type") |
|||
public class VipType extends BaseDomain { |
|||
|
|||
/** |
|||
* 类型编码 |
|||
*/ |
|||
@TableField(value = "type_code") |
|||
@ApiModelProperty(value="类型编码") |
|||
private String typeCode; |
|||
|
|||
/** |
|||
* 类型名称 |
|||
*/ |
|||
@TableField(value = "type_name") |
|||
@ApiModelProperty(value="类型名称") |
|||
private String typeName; |
|||
|
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
/** |
|||
* 微信支付配置表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-domain-PayWxpayConfig") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "pay_wxpay_config") |
|||
public class WxpayConfig extends BaseDomain { |
|||
|
|||
/** |
|||
* 1--JSAPI支付(小程序appId支付)、2--Native支付、3--app支付,4--JSAPI支付(公众号appId支付)5--H5支付 |
|||
*/ |
|||
@TableField(value = "trade_type") |
|||
@ApiModelProperty(value="1--JSAPI支付(小程序appId支付)、2--Native支付、3--app支付,4--JSAPI支付(公众号appId支付)5--H5支付") |
|||
private String tradeType; |
|||
|
|||
/** |
|||
* appid |
|||
*/ |
|||
@TableField(value = "appid") |
|||
@ApiModelProperty(value="appid") |
|||
private String appid; |
|||
|
|||
/** |
|||
* 商户号 |
|||
*/ |
|||
@TableField(value = "mchid") |
|||
@ApiModelProperty(value="商户号") |
|||
private String mchid; |
|||
|
|||
/** |
|||
* 回调地址url |
|||
*/ |
|||
@TableField(value = "backurl") |
|||
@ApiModelProperty(value="回调地址url") |
|||
private String backurl; |
|||
|
|||
/** |
|||
* 密钥 |
|||
*/ |
|||
@TableField(value = "`key`") |
|||
@ApiModelProperty(value="密钥") |
|||
private String key; |
|||
|
|||
/** |
|||
* 接口密钥 |
|||
*/ |
|||
@TableField(value = "api_key") |
|||
@ApiModelProperty(value="接口密钥") |
|||
private String apiKey; |
|||
|
|||
/** |
|||
* 证书序列号值 |
|||
*/ |
|||
@TableField(value = "cert_serial_no") |
|||
@ApiModelProperty(value="证书序列号值") |
|||
private String certSerialNo; |
|||
|
|||
/** |
|||
* apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径. |
|||
*/ |
|||
@TableField(value = "key_path") |
|||
@ApiModelProperty(value="apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径.") |
|||
private String keyPath; |
|||
|
|||
/** |
|||
* apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径. |
|||
*/ |
|||
@TableField(value = "cert_path") |
|||
@ApiModelProperty(value="apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径.") |
|||
private String certPath; |
|||
|
|||
/** |
|||
* 帐号状态(0正常 1停用) |
|||
*/ |
|||
@TableField(value = "`status`") |
|||
@ApiModelProperty(value="帐号状态(0正常 1停用)") |
|||
private String status; |
|||
|
|||
@TableField(value = "remark") |
|||
@ApiModelProperty(value="") |
|||
private String remark; |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import com.bnyer.common.core.domain.UserVipRecord; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@NoArgsConstructor |
|||
public class AddUserVipRecordDto extends BaseDto<UserVipRecord>{ |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="用户手机号") |
|||
private String phone; |
|||
|
|||
@ApiModelProperty(value="vip表id") |
|||
private Long vipId; |
|||
|
|||
@ApiModelProperty(value="时长天数") |
|||
private Integer days; |
|||
|
|||
@ApiModelProperty(value="vip名称") |
|||
private String vipName; |
|||
|
|||
@ApiModelProperty(value = "vip类型名称") |
|||
private String vipTypeName; |
|||
|
|||
@ApiModelProperty(value = "用户客户端类型:10用户-抖音 20用户-快手 30用户-微信 40艺术家-微信") |
|||
private Integer userClientType; |
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import com.bnyer.common.core.domain.BaseDomain; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.common.core.utils.bean.ReflectUtils; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.beans.BeanUtils; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/05/10 |
|||
* @description : |
|||
*/ |
|||
@Data |
|||
public class BaseDto <T extends BaseDomain> implements Serializable { |
|||
private static final long serialVersionUID = 320272502336434381L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private Long id; |
|||
|
|||
/** |
|||
* 数据创建时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date createTime; |
|||
|
|||
/** |
|||
* 数据更新时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date updateTime; |
|||
|
|||
/** |
|||
* 是否显示 |
|||
*/ |
|||
private String isShow; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 主键ID集合 |
|||
*/ |
|||
private List<Long> ids; |
|||
|
|||
/** |
|||
* 转为实体类 |
|||
* |
|||
* @return 实体类 |
|||
*/ |
|||
public T toEntity() { |
|||
Class<T> entity = ReflectUtils.getParameterizedType(this.getClass()); |
|||
T entityInstance = ReflectUtils.newInstance(entity); |
|||
BeanUtils.copyProperties(this, entityInstance); |
|||
if (this.id == null) { |
|||
entityInstance.setIsShow("1"); |
|||
entityInstance.setCreateTime(new Date()); |
|||
entityInstance.setUpdateTime(null); |
|||
if (StringUtils.isNotBlank(this.isShow)){ |
|||
entityInstance.setIsShow(this.isShow); |
|||
}else { |
|||
entityInstance.setIsShow("1"); |
|||
} |
|||
if (this.sort != null){ |
|||
entityInstance.setSort(this.sort); |
|||
}else { |
|||
entityInstance.setSort(0); |
|||
} |
|||
} else { |
|||
entityInstance.setUpdateTime(new Date()); |
|||
} |
|||
return entityInstance; |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("意心记录分页接收类") |
|||
public class DiamondLogPageDto extends BasePageDto { |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="平台(1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
|
|||
@ApiModelProperty(value="app类型(0->次元意境;1->妙鸭壁纸)") |
|||
private String appType; |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("生成画意值cdk接收类") |
|||
public class GeneratePaintCdkDto implements Serializable { |
|||
|
|||
|
|||
|
|||
@NotNull(message = "app类型不能为空!") |
|||
@ApiModelProperty(value="app类型(0->次元意境;1->妙鸭壁纸)") |
|||
private String appType; |
|||
|
|||
@NotNull(message = "生成数量不能为空!") |
|||
@ApiModelProperty(value="生成数量") |
|||
private int paintNum; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("签到获取画意值接收类") |
|||
public class GetGoldDto implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -522268377128588554L; |
|||
|
|||
@NotNull(message = "用户id不能为空!") |
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@NotBlank(message = "应用类型不能为空!") |
|||
@ApiModelProperty(value="app类型(0->次元意境;1->妙鸭壁纸)") |
|||
private String appType; |
|||
|
|||
@NotNull(message = "平台渠道不能为空!") |
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("画意值记录分页接收类") |
|||
public class GoldLogPageDto extends BasePageDto { |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
|
|||
@ApiModelProperty(value="app类型(0->次元意境;1->妙鸭壁纸)") |
|||
private String appType; |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("情侣头像接收类") |
|||
public class TextToImgLoveDto implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = 3028022777339473876L; |
|||
@ApiModelProperty(value="内容提示词") |
|||
private String prompt; |
|||
|
|||
@ApiModelProperty(value="场景提示词") |
|||
private String scenePrompt; |
|||
|
|||
@ApiModelProperty(value="风格名称") |
|||
private String styleName; |
|||
|
|||
@ApiModelProperty(value="绘图者id") |
|||
private Long painterId; |
|||
|
|||
@ApiModelProperty(value="绘图者昵称") |
|||
private String painterName; |
|||
|
|||
@ApiModelProperty(value="app类型(0->次元意境;1->妙鸭壁纸)") |
|||
private String appType; |
|||
|
|||
@ApiModelProperty(value="平台(1->抖音;2->快手;3->微信)") |
|||
private String platform; |
|||
|
|||
@ApiModelProperty(value="消耗画意值") |
|||
private int goldNum; |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* @author :penny |
|||
* @description : app类型枚举 |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumAppType { |
|||
|
|||
YJ_APP("0","次元意境"), |
|||
MY_APP("1","妙鸭壁纸"), |
|||
; |
|||
|
|||
private final String code; |
|||
|
|||
private final String msg; |
|||
|
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/05/18 |
|||
* @description :消息状态 |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumMessageStatus { |
|||
//处理中
|
|||
PROCESS, |
|||
//成功
|
|||
SUCCESS, |
|||
//失败,
|
|||
FAILS, |
|||
//作废
|
|||
INVALID, |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/05/18 |
|||
* @description :消息类型 |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumMessageType { |
|||
//普通
|
|||
GENERAL, |
|||
//延时
|
|||
DELAY |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
import java.util.Arrays; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumPayStatus { |
|||
|
|||
NO_PAY(1000,"未支付"), |
|||
SUCCESS(1001,"已支付"), |
|||
FAILS(1002,"支付失败"), |
|||
; |
|||
|
|||
private final int status; |
|||
|
|||
private final String name; |
|||
|
|||
public static EnumPayStatus getEnumPayStatusByStatus(int status) { |
|||
return Arrays.stream(values()) |
|||
.filter(payStatus -> payStatus.getStatus() == status) |
|||
.findFirst().orElseThrow(() -> new SecurityException("status 未匹配上对应的支付状态")); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumPayType { |
|||
|
|||
WX_PAY("wxpay","微信支付"), |
|||
ALI_PAY("alipay","支付宝支付"), |
|||
DY_PAY("dypay","抖音支付"), |
|||
KS_PAY("kspay","快手支付"), |
|||
; |
|||
|
|||
private final String type; |
|||
|
|||
private final String name; |
|||
|
|||
public static String getName(String type) { |
|||
for (EnumPayType s : EnumPayType.values()) { |
|||
if (Objects.equals(type, s.getType())) { |
|||
return s.getName(); |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static EnumPayType getEnumPayTypeByType(String type) { |
|||
return Arrays.stream(values()) |
|||
.filter(payType -> Objects.equals(payType.getType(), type)) |
|||
.findFirst().orElseThrow(() -> new SecurityException("type 未匹配上对应的支付方式")); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
import java.util.Arrays; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumRefundStatus { |
|||
|
|||
NO_REFUND(1000,"未退款"), |
|||
FAILS(1001,"退款失败"), |
|||
SUCCESS(1002,"退款成功"), |
|||
PROCESS(1003,"退款中"), |
|||
; |
|||
|
|||
private final int status; |
|||
|
|||
private final String name; |
|||
|
|||
public static EnumRefundStatus getEnumStatusByStatus(int status) { |
|||
return Arrays.stream(values()) |
|||
.filter(payStatus -> payStatus.getStatus() == status) |
|||
.findFirst().orElseThrow(() -> new SecurityException("status 未匹配上对应的支付状态")); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
import java.util.Arrays; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumSceneCode { |
|||
|
|||
VIP_RECHARGE(1,"会员充值"), |
|||
UNKNOWN(-1,"未知"), |
|||
; |
|||
|
|||
private final int sceneCode; |
|||
|
|||
private final String name; |
|||
|
|||
public static String getSceneCodeName(int sceneCode) { |
|||
for (EnumSceneCode s : EnumSceneCode.values()) { |
|||
if (sceneCode == s.getSceneCode()) { |
|||
return s.getName(); |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static EnumSceneCode getSceneCodeByCode(int code) { |
|||
return Arrays.stream(values()) |
|||
.filter(sceneCode -> sceneCode.getSceneCode() == code) |
|||
.findFirst().orElse(EnumSceneCode.UNKNOWN); |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
import java.util.Arrays; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @Date :2023/04/23 |
|||
* @description :时间单位 |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumTimeUnit { |
|||
|
|||
DAY(0,"天"), |
|||
WEEK(1,"周"), |
|||
MONTH(2,"月"), |
|||
QUARTER(3,"季"), |
|||
YEAR(4,"年"), |
|||
HOURS(5,"时"), |
|||
MINUTE(6,"分"), |
|||
SECONDS(7,"秒"), |
|||
; |
|||
|
|||
private final int unit; |
|||
private final String name; |
|||
|
|||
public static EnumTimeUnit getEnumTimeUnitByUnit(int unit) { |
|||
return Arrays.stream(values()) |
|||
.filter(vipTimeUnit -> unit == vipTimeUnit.getUnit()) |
|||
.findFirst().orElseThrow(() -> new SecurityException("unit 未匹配上对应的时间单位")); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import com.bnyer.common.core.exception.ServiceException; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumUserClientType { |
|||
|
|||
DU(10,"DU","抖音用户"), |
|||
KU(20,"KU","快手用户"), |
|||
WU(30,"WU","微信用户"), |
|||
WY(40,"WY","微信艺术家"), |
|||
PU(50,"PU","pc管理员") |
|||
; |
|||
|
|||
private final int type; |
|||
|
|||
private final String code; |
|||
|
|||
private final String desc; |
|||
|
|||
public static String getCodeByType(int type) { |
|||
for (EnumUserClientType s : EnumUserClientType.values()) { |
|||
if (type == s.type) { |
|||
return s.getCode(); |
|||
} |
|||
} |
|||
throw new ServiceException("userClientType 未匹配上对应的类型"); |
|||
} |
|||
|
|||
public static EnumUserClientType getEnumByType(Integer type) { |
|||
return Arrays.stream(values()) |
|||
.filter(userClientType -> userClientType.getType() == type) |
|||
.findFirst().orElseThrow(() -> new ServiceException("type 未匹配上对应的客户端类型")); |
|||
} |
|||
|
|||
public static EnumUserClientType getTypeByCode(String code) { |
|||
return Arrays.stream(values()) |
|||
.filter(type -> Objects.equals(type.getCode(), code)) |
|||
.findFirst().orElse(EnumUserClientType.PU); |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.bnyer.common.core.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
/** |
|||
* @author :WXC |
|||
* @description : |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum EnumVipOrderStatus { |
|||
|
|||
WAIT_PAY(0,"待付款"), |
|||
SUCCESS(1,"已付款"), |
|||
REFUNDED(2,"已退款"), |
|||
PAY_TIMEOUT_CLOSE(3,"支付超时取消"), |
|||
CANCEL_CLOSE(4,"买家取消"), |
|||
; |
|||
|
|||
private final int status; |
|||
|
|||
private final String name; |
|||
|
|||
public static String getStatusName(int status) { |
|||
for (EnumVipOrderStatus s : EnumVipOrderStatus.values()) { |
|||
if (status == s.status) { |
|||
return s.getName(); |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue