Commit d157091a by wangnb

账户体系方法命名规范化--think.wang

1 parent 8b5aedf0
......@@ -14,26 +14,26 @@ public class ConvertRequest {
/**
* 转化请求参数
*
* @param re 原入参
* @param newob 转后后的参数
* @param <T> 泛型
* @param re 原入参
* @param newObj 转后后的参数
* @param <T> 泛型
* @return
*/
public static <T> T converRequest(Object re,T newob){
BeanUtils.copyProperties(re, newob);
return newob;
public static <T> T convertRequest(Object re, T newObj) {
BeanUtils.copyProperties(re, newObj);
return newObj;
}
/**
* 分页对象转化参数
*
* @param old 原入参
* @param t 转化后的参数
* @param t 转化后的参数
* @param <T> 泛型
* @return
*/
public static <T> RpcPagination<T> convertPage(Object old, T t){
RpcPagination rpcPagination=new RpcPagination();
public static <T> RpcPagination<T> convertPage(Object old, T t) {
RpcPagination rpcPagination = new RpcPagination();
BeanUtils.copyProperties(old, rpcPagination);
BeanUtils.copyProperties(old, t);
rpcPagination.setCondition(t);
......
......@@ -34,14 +34,14 @@ public class MerchantDictDataService {
private MerchantUserService merchantUserService;
public void saveDictData(DictDataSaveRequest dictDataSaveRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantDictDataRemote.saveMerchantDictDataRemote(ConvertRequest.converRequest(dictDataSaveRequest, new MerchantDictDataRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantDictDataRemote.saveMerchantDictDataRemote(ConvertRequest.convertRequest(dictDataSaveRequest, new MerchantDictDataRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
}
public void updateDictData(DictDataUpdateRequest DictDataUpdateRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantDictDataRemote.updateMerchantDictDataRemote(ConvertRequest.converRequest(DictDataUpdateRequest, new MerchantDictDataRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantDictDataRemote.updateMerchantDictDataRemote(ConvertRequest.convertRequest(DictDataUpdateRequest, new MerchantDictDataRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
......@@ -56,14 +56,14 @@ public class MerchantDictDataService {
}
public void deleteDictData(DictDataDeleteRequest DictDataDeleteRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantDictDataRemote.deleteMerchantDictDataRemote(ConvertRequest.converRequest(DictDataDeleteRequest, new MerchantDictDataRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantDictDataRemote.deleteMerchantDictDataRemote(ConvertRequest.convertRequest(DictDataDeleteRequest, new MerchantDictDataRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
}
public List<DictDataResponse> findAllDictData(DictDataSearchRequest dictDataSearchRequest) {
RpcResponse<List<MerchantDictDataResponse>> merProductByPageRemote = merchantDictDataRemote.findAllRemote(ConvertRequest.converRequest(dictDataSearchRequest, new MerchantDictDataRequest()));
RpcResponse<List<MerchantDictDataResponse>> merProductByPageRemote = merchantDictDataRemote.findAllRemote(ConvertRequest.convertRequest(dictDataSearchRequest, new MerchantDictDataRequest()));
if (merProductByPageRemote.isSuccess()) {
return ConvertResponse.convertList(merProductByPageRemote.getResult(), DictDataResponse.class);
}
......
......@@ -39,14 +39,14 @@ public class MerchantDictTypeService {
@SysLog(value = "新增字典类型", action = OperateType.ADD,module = "字典类型管理")
public void saveDictType(DictTypeSaveRequest dictTypeSaveRequest) {
merchantUserService.setUser(dictTypeSaveRequest);
RpcResponse<Boolean> booleanRpcResponse = merchantDictTypeRemote.saveMerchantDictTypeRemote(ConvertRequest.converRequest(dictTypeSaveRequest, new MerchantDictTypeRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantDictTypeRemote.saveMerchantDictTypeRemote(ConvertRequest.convertRequest(dictTypeSaveRequest, new MerchantDictTypeRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
}
public void updateDictType(DictTypeUpdateRequest dictTypeUpdateRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantDictTypeRemote.updateMerchantDictTypeRemote(ConvertRequest.converRequest(dictTypeUpdateRequest, new MerchantDictTypeRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantDictTypeRemote.updateMerchantDictTypeRemote(ConvertRequest.convertRequest(dictTypeUpdateRequest, new MerchantDictTypeRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
......@@ -61,7 +61,7 @@ public class MerchantDictTypeService {
}
public void deleteDictType(DictTypeDeleteRequest dictTypeDeleteRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantDictTypeRemote.deleteMerchantDictTypeRemote(ConvertRequest.converRequest(dictTypeDeleteRequest, new MerchantDictTypeRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantDictTypeRemote.deleteMerchantDictTypeRemote(ConvertRequest.convertRequest(dictTypeDeleteRequest, new MerchantDictTypeRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
......
......@@ -30,7 +30,7 @@ public class MerchantFileService {
public List<FileResponse> findMerchantFile(FileSearchRequest fileSearchRequest){
//入参集合转化
RpcResponse<List<MerchantFileResponse>> merchantFileRemoteRpc =
merchantFileRemote.findMerchantFileRemote(ConvertRequest.converRequest(fileSearchRequest, new MerchantFileRequest()));
merchantFileRemote.findMerchantFileRemote(ConvertRequest.convertRequest(fileSearchRequest, new MerchantFileRequest()));
//判断调用远程是否成功
if (merchantFileRemoteRpc.isSuccess()) {
//出参集合转化
......
......@@ -34,14 +34,14 @@ public class MerchantFunctionService {
private MerchantProductFunctionRemote merchantProductFunctionRemote;
public void saveMerchantFunction(FunctionSaveRequest functionSaveRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductFunctionRemote.saveMerchantProductFunctionRemote(ConvertRequest.converRequest(functionSaveRequest, new MerchantProductFunctionRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantProductFunctionRemote.saveMerchantProductFunctionRemote(ConvertRequest.convertRequest(functionSaveRequest, new MerchantProductFunctionRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
}
public void updateMerchantFunction(FunctionUpdateRequest functionUpdateRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductFunctionRemote.updateMerchantProductFunctionRemote(ConvertRequest.converRequest(functionUpdateRequest, new MerchantProductFunctionRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantProductFunctionRemote.updateMerchantProductFunctionRemote(ConvertRequest.convertRequest(functionUpdateRequest, new MerchantProductFunctionRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
......
......@@ -30,7 +30,7 @@ public class MerchantLogService {
private MerchantLogRemote merchantLogRemote;
public MerchantLogResponse saveMerchantLog(LogRequest logRequest) {
RpcResponse<MerchantLogResponse> booleanRpcResponse = merchantLogRemote.saveMerchantLogRemote(ConvertRequest.converRequest(logRequest, new MerchantLogRequest()));
RpcResponse<MerchantLogResponse> booleanRpcResponse = merchantLogRemote.saveMerchantLogRemote(ConvertRequest.convertRequest(logRequest, new MerchantLogRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
} else {
......@@ -39,7 +39,7 @@ public class MerchantLogService {
}
public void updateMerchantLog(LogRequest logRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantLogRemote.updateMerchantLogRemote(ConvertRequest.converRequest(logRequest, new MerchantLogRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantLogRemote.updateMerchantLogRemote(ConvertRequest.convertRequest(logRequest, new MerchantLogRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
......
......@@ -34,7 +34,7 @@ public class MerchantMenuService {
private MerchantProductMenuRemote merchantProductMenuRemote;
public List<MenuResponse> findMerProMenuTreeRemote(MenuSearchRequest menuSearchRequest) {
RpcResponse<List<MerchantProductMenuResponse>> merProMenuTreeRemote = merchantProductMenuRemote.findMerProMenuTreeRemote(ConvertRequest.converRequest(menuSearchRequest, new MerchantProductMenuRequest()));
RpcResponse<List<MerchantProductMenuResponse>> merProMenuTreeRemote = merchantProductMenuRemote.findMerProMenuTreeRemote(ConvertRequest.convertRequest(menuSearchRequest, new MerchantProductMenuRequest()));
if (merProMenuTreeRemote.isSuccess()) {
List<MenuResponse> menuResponseList = ConvertResponse.convertList(merProMenuTreeRemote.getResult(), MenuResponse.class);
return menuResponseList;
......@@ -43,7 +43,7 @@ public class MerchantMenuService {
}
public void saveMerchantProductMenuRemote(MenuSaveRequest menuSaveRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.saveMerchantProductMenuRemote(ConvertRequest.converRequest(menuSaveRequest, new MerchantProductMenuRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.saveMerchantProductMenuRemote(ConvertRequest.convertRequest(menuSaveRequest, new MerchantProductMenuRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
......@@ -58,7 +58,7 @@ public class MerchantMenuService {
}
public void updateMerchantProductMenuRemote(MenuUpdateRequest menuUpdateRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.updateMerchantProductMenuRemote(ConvertRequest.converRequest(menuUpdateRequest, new MerchantProductMenuRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.updateMerchantProductMenuRemote(ConvertRequest.convertRequest(menuUpdateRequest, new MerchantProductMenuRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
......
......@@ -42,7 +42,7 @@ public class MerchantProductService {
}
public void saveProduct(ProductSaveRequest productSearchRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductRemote.saveMerchantProductRemote(ConvertRequest.converRequest(productSearchRequest, new MerchantProductRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantProductRemote.saveMerchantProductRemote(ConvertRequest.convertRequest(productSearchRequest, new MerchantProductRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
......@@ -57,7 +57,7 @@ public class MerchantProductService {
}
public void updateProduct(ProductUpdateRequest productUpdateRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductRemote.updateProductRemote(ConvertRequest.converRequest(productUpdateRequest, new MerchantProductRequest()));
RpcResponse<Boolean> booleanRpcResponse = merchantProductRemote.updateProductRemote(ConvertRequest.convertRequest(productUpdateRequest, new MerchantProductRequest()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!