提交 e3dd3484 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 96e5da7a
!!!!模版产生代码错误:---- package com.ibiz.client.htsc.feign;
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
---- import java.sql.Timestamp;
import java.util.ArrayList;
---- import java.util.List;
FTL stack trace ("~" means nesting-related): import java.util.Map;
- Failed at: ${item.getKeyDEField().getCodeName()?... [in template "CODETEMPL_zh_CN" at line 68, column 152] import java.util.HashMap;
---- import org.springframework.data.domain.Page;
\ No newline at end of file import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import com.ibiz.core.client.model.Ihealthcheck;
import com.ibiz.client.htsc.model.healthcheckImpl;
import com.ibiz.util.SearchContext;
/**
* 实体[healthcheck] 服务对象接口
*/
public interface healthcheckFeignClient {
@RequestMapping(method = RequestMethod.POST, value = "/htsc-pos-nms/api//healthchecks/{healthcheckid}/test")
public healthcheckImpl test(@PathVariable("healthcheckid") String healthcheckid,@RequestBody healthcheckImpl healthcheck);
}
...@@ -20,4 +20,37 @@ import com.fasterxml.jackson.annotation.JsonFormat; ...@@ -20,4 +20,37 @@ import com.fasterxml.jackson.annotation.JsonFormat;
*/ */
public class healthcheckImpl implements Ihealthcheck,Serializable{ public class healthcheckImpl implements Ihealthcheck,Serializable{
/**
*
*/
public String hEALTHCHECKID;
@JsonIgnore
public boolean hEALTHCHECKIDDirtyFlag;
/**
* 获取 []
*/
@JsonProperty("healthcheckid")
public String getHEALTHCHECKID(){
return this.hEALTHCHECKID ;
}
/**
* 设置 []
*/
@JsonProperty("healthcheckid")
public void setHEALTHCHECKID(String hEALTHCHECKID){
this.hEALTHCHECKID = hEALTHCHECKID ;
this.hEALTHCHECKIDDirtyFlag = true ;
}
/**
* 获取 []脏标记
*/
@JsonIgnore
public boolean getHEALTHCHECKIDDirtyFlag(){
return this.hEALTHCHECKIDDirtyFlag ;
}
} }
!!!!模版产生代码错误:---- package com.ibiz.client.htsc.service;
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
---- import java.sql.Timestamp;
import java.util.ArrayList;
---- import java.util.List;
FTL stack trace ("~" means nesting-related): import java.util.Map;
- Failed at: ${item.getKeyDEField().getCodeName()?... [in template "CODETEMPL_zh_CN" at line 137, column 151] import java.util.HashMap;
----
\ No newline at end of file import lombok.extern.slf4j.Slf4j;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.codec.Decoder;
import feign.codec.Encoder;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import com.ibiz.core.client.model.Ihealthcheck;
import com.ibiz.client.htsc.config.htscClientProperties;
import com.ibiz.core.client.service.IhealthcheckClientService;
import com.ibiz.client.htsc.model.healthcheckImpl;
import com.ibiz.client.htsc.feign.healthcheckFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
import com.ibiz.util.feign.FeignRequestInterceptor;
import com.ibiz.util.SearchContext;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import com.ibiz.util.feign.suport.SearchContextFeignEncode;
import com.ibiz.util.log.IBIZLog;
/**
* 实体[healthcheck] 服务对象接口
*/
@Slf4j
@IBIZLog
@Service
public class healthcheckClientServiceImpl implements IhealthcheckClientService {
healthcheckFeignClient healthcheckFeignClient;
@Autowired
public healthcheckClientServiceImpl(Decoder decoder, Encoder encoder, Client client, Contract contract ,FeignRequestInterceptor feignRequestInterceptor,htscClientProperties htscClientProperties) {
if (htscClientProperties.getServiceId()!=null) {
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.healthcheckFeignClient = nameBuilder.target(healthcheckFeignClient.class,"http://"+htscClientProperties.getServiceId()+"/") ;
}else if (htscClientProperties.getServiceUrl()!=null) {
if (client instanceof LoadBalancerFeignClient) {
client = ((LoadBalancerFeignClient) client).getDelegate();
}
Feign.Builder nameBuilder = Feign.builder()
.client(client)
.encoder(new SearchContextFeignEncode(encoder))
.decoder(decoder)
.contract(contract)
.requestInterceptor(feignRequestInterceptor)
;
this.healthcheckFeignClient = nameBuilder.target(healthcheckFeignClient.class,"http://"+htscClientProperties.getServiceUrl()+"/") ;
}
}
@Override
public Ihealthcheck createModel() {
return new healthcheckImpl();
}
public void test(Ihealthcheck healthcheck){
Ihealthcheck clientModel = healthcheckFeignClient.test(healthcheck.getHEALTHCHECKID(),(healthcheckImpl)healthcheck) ;
BeanCopier copier=BeanCopier.create(clientModel.getClass(), healthcheck.getClass(), false);
copier.copy(clientModel, healthcheck, null);
}
}
...@@ -13,4 +13,18 @@ import java.math.BigInteger; ...@@ -13,4 +13,18 @@ import java.math.BigInteger;
*/ */
public interface Ihealthcheck { public interface Ihealthcheck {
/**
* 获取 []
*/
public void setHEALTHCHECKID(String hEALTHCHECKID);
/**
* 设置 []
*/
public String getHEALTHCHECKID();
/**
* 获取 []脏标记
*/
public boolean getHEALTHCHECKIDDirtyFlag();
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册