随笔分类 - Java
摘要:File file = new File(imgPath); FileSystemResource resource = new FileSystemResource(file); // 2. 构建请求体 MultiValueMap<String, Object> body = new Linked
阅读全文
摘要:不要添加前缀 控制器和类 @PostMapping("text-only") public List<TextDto> ocrTextOnly(@RequestBody OcrParam ocrParam) { //TODO return ocrapiService.ocrText(ocrParam
阅读全文
摘要:网上看大部分是断点引起的问题 但是本项目的问题不同 在于 @Configuration public class WsConfig { @Value("${ws.username}") private String userName; @Value("${ws.password}") private
阅读全文
摘要:Java中Long类型向前端返回值 主要在id之类的字段上 需要将Long转为String 例如: agencyId: "258323682286370816" 如果不转换直接传Long的话 就会变成 造成越界 数据错误 agencyId: 258323682286370800
阅读全文
摘要://将两个类同名属性 source的布尔值 设置到目标值的同名字符类别属性上 true->"1" false->"0" public static void setSameNameField(Object source, Object target) throws InvocationTargetE
阅读全文
摘要://此处用的包是 package org.springframework.beans; public static void copyProperties(Object source, Object target) throws BeansException { copyProperties(sou
阅读全文
摘要:@RequiredArgsConstructor(onConstructor_ = @Autowired) public class V3CauseCustomDaoImpl implements V3CauseCustomDao { private final BiDao biDao;privat
阅读全文
摘要://判断处罚类型和金额 predicates.add( builder.or( builder.and( builder.equal(root.get("targetType"), TargetType.TARGET_TYPE_1.getType()), builder.greaterThanOrE
阅读全文
摘要:得到ServletContext3种方式: ServletContext application1 = request.getServertContext(); ServletContext application2 = this.getServletContext(); ServletContex
阅读全文