|  |  |  | 
|---|
|  |  |  | package com.doumee.dao.business.web.response; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonInclude; | 
|---|
|  |  |  | import com.fasterxml.jackson.core.JsonProcessingException; | 
|---|
|  |  |  | import com.fasterxml.jackson.databind.ObjectMapper; | 
|---|
|  |  |  | import com.fasterxml.jackson.databind.PropertyNamingStrategy; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModel; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModelProperty; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author T14 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | @ApiModel("骑行记录返回类") | 
|---|
|  |  |  | public class MiniProgrammeDTO { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("主页主题") | 
|---|
|  |  |  | private String projectName; | 
|---|
|  |  |  | private String projectName = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("服务电话") | 
|---|
|  |  |  | private String serverPhone; | 
|---|
|  |  |  | private String serverPhone = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("押金金额") | 
|---|
|  |  |  | private String rentDeposit; | 
|---|
|  |  |  | @ApiModelProperty("押金金额(元)") | 
|---|
|  |  |  | private String rentDeposit = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("营业时间起始") | 
|---|
|  |  |  | private String businessStarttime; | 
|---|
|  |  |  | private String businessStarttime = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("营业时间结束") | 
|---|
|  |  |  | private String businessEndtime; | 
|---|
|  |  |  | private String businessEndtime = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("免费骑行时长") | 
|---|
|  |  |  | private String freeRentTime; | 
|---|
|  |  |  | private String freeRentTime = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("满足预警最小值") | 
|---|
|  |  |  | private String warnMin; | 
|---|
|  |  |  | private String warnMin = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("满足预警最大值") | 
|---|
|  |  |  | private String warnMax; | 
|---|
|  |  |  | private String warnMax = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("小程序预警钉钉群地址") | 
|---|
|  |  |  | private String warnDingdingUrl; | 
|---|
|  |  |  | private String warnDingdingUrl = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("租赁流程视频") | 
|---|
|  |  |  | private String rentTipsVideo; | 
|---|
|  |  |  | private String rentTipsVideo = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("骑车通知内容") | 
|---|
|  |  |  | private String rentNotice; | 
|---|
|  |  |  | private String rentNotice = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("是否停止服务") | 
|---|
|  |  |  | private String  isStopServe; | 
|---|
|  |  |  | private String  isStopServe = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("停止服务提示") | 
|---|
|  |  |  | private String stopServeTips; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String stopServeTips = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("停止服务开始") | 
|---|
|  |  |  | private String stopServeStarttime; | 
|---|
|  |  |  | private String stopServeStarttime = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("停止服务结束") | 
|---|
|  |  |  | private String stopServeEndtime; | 
|---|
|  |  |  | private String stopServeEndtime = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("停止服务结束") | 
|---|
|  |  |  | private String leaseNotice = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("停止服务结束") | 
|---|
|  |  |  | private String leaseNoticeUrl = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 对象驼峰属性转下划线 | 
|---|
|  |  |  | * @param object | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | * @throws JsonProcessingException | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static String toUnderlineJSONString(Object object) throws JsonProcessingException { | 
|---|
|  |  |  | ObjectMapper mapper = new ObjectMapper(); | 
|---|
|  |  |  | mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); | 
|---|
|  |  |  | mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); | 
|---|
|  |  |  | String reqJson = mapper.writeValueAsString(object); | 
|---|
|  |  |  | return reqJson; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static <T> T toSnakeObject(String json, Class<T> clazz) throws IOException { | 
|---|
|  |  |  | ObjectMapper mapper = new ObjectMapper(); | 
|---|
|  |  |  | mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); | 
|---|
|  |  |  | T reqJson =  mapper.readValue(json, clazz); | 
|---|
|  |  |  | return reqJson; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|