fix: 修复一些已知Bug

This commit is contained in:
felord.cn
2021-03-23 21:19:01 +08:00
parent ace5a900d2
commit aae5096349
4 changed files with 24 additions and 45 deletions

View File

@@ -29,64 +29,42 @@ public enum CouponBgColor {
/** /**
* Color 010 coupon bg color. * Color 010 coupon bg color.
*/ */
COLOR010("#63B359"), Color010,
/** /**
* Color 020 coupon bg color. * Color 020 coupon bg color.
*/ */
COLOR020("#2C9F67"), Color020,
/** /**
* Color 030 coupon bg color. * Color 030 coupon bg color.
*/ */
COLOR030("#509FC9"), Color030,
/** /**
* Color 040 coupon bg color. * Color 040 coupon bg color.
*/ */
COLOR040("#5885CF"), Color040,
/** /**
* Color 050 coupon bg color. * Color 050 coupon bg color.
*/ */
COLOR050("#9062C0"), Color050,
/** /**
* Color 060 coupon bg color. * Color 060 coupon bg color.
*/ */
COLOR060("#D09A45"), Color060,
/** /**
* Color 070 coupon bg color. * Color 070 coupon bg color.
*/ */
COLOR070("#E4B138"), Color070,
/** /**
* Color 080 coupon bg color. * Color 080 coupon bg color.
*/ */
COLOR080("#EE903C"), Color080,
/** /**
* Color 090 coupon bg color. * Color 090 coupon bg color.
*/ */
COLOR090("#DD6549"), Color090,
/** /**
* Color 100 coupon bg color. * Color 100 coupon bg color.
*/ */
COLOR100("#CC463D"); Color100
/**
* The Color.
*/
private final String color;
/**
* Instantiates a new Coupon bg color.
*
* @param color the color
*/
CouponBgColor(String color) {
this.color = color;
}
/**
* Color string.
*
* @return the string
*/
public String color() {
return this.color;
}
} }

View File

@@ -24,9 +24,9 @@ import cn.felord.payment.wechat.v3.model.FundFlowBillParams;
import cn.felord.payment.wechat.v3.model.TradeBillParams; import cn.felord.payment.wechat.v3.model.TradeBillParams;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy; import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
@@ -88,10 +88,11 @@ public abstract class AbstractApi {
* @param mapper the mapper * @param mapper the mapper
*/ */
private void applyObjectMapper(ObjectMapper mapper) { private void applyObjectMapper(ObjectMapper mapper) {
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false)
SimpleModule module = new JavaTimeModule(); .configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
mapper.registerModule(module); .setSerializationInclusion(JsonInclude.Include.NON_NULL)
.registerModule(new JavaTimeModule());
} }
@@ -185,10 +186,11 @@ public abstract class AbstractApi {
return RequestEntity.get(uri).header("Pay-TenantId", tenantId) return RequestEntity.get(uri).header("Pay-TenantId", tenantId)
.build(); .build();
} }
/** /**
* 构建Get请求对象. * 构建Get请求对象.
* *
* @param uri the uri * @param uri the uri
* @param httpHeaders the http headers * @param httpHeaders the http headers
* @return the request entity * @return the request entity
*/ */

View File

@@ -34,7 +34,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy; import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -72,11 +71,11 @@ public class WechatPayCallback {
private final String tenantId; private final String tenantId;
static { static {
MAPPER.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); MAPPER.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); .setSerializationInclusion(JsonInclude.Include.NON_NULL)
MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false); .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false)
SimpleModule module = new JavaTimeModule(); .configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,true)
MAPPER.registerModule(module); .registerModule(new JavaTimeModule());
} }
/** /**

View File

@@ -49,7 +49,7 @@ public class BusiFavorReceiveConsumeData {
/** /**
* 发放时间 rfc 3339 yyyy-MM-ddTHH:mm:ss+TIMEZONE * 发放时间 rfc 3339 yyyy-MM-ddTHH:mm:ss+TIMEZONE
*/ */
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", timezone = "GMT+8")
private OffsetDateTime sendTime; private OffsetDateTime sendTime;
/** /**
* 微信用户在appid下的唯一标识。 * 微信用户在appid下的唯一标识。