热搜配置: http://10.0.8.61:8011/api/configSearchHot?page=0&size=10&sort=level,asc
热搜统计:http://10.0.8.61:8011/api/countSearchHot?page=0&size=10&sort=searchCounts,desc
上移下移:
假设在我们业务逻辑中需要传递一个 UserForm
,接收 age,name,param
三个参数。并对其中输入进行进行校验,其中,param
没有具体的含义,只是为了说明问题。
1 | { |
是有些字段不能为空,在实体类里面有定义
1 |
|
是可以既传请求体,也传参数的,
Target object must not be null; nested exception is java.lang.IllegalArgumentException: Target object must not be null
哦我弄的put请求。。应该要post的
8/14我删除了countSearchHot类中没用的字段,以及download的一些相关代码。
我们一般情况下都是写完代码,commit到本地仓库,生成本地仓库commit ID,当前提交版本号,然后push到远程仓库,。
git pull看起来像git fetch+get merge
ERROR o.h.e.jdbc.spi.SqlExceptionHelper - Zero date value prohibited
WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: S1009
maven报错一般都是导错包,检查检查,不然发布的还是以前的版本
Dto的字段名称跟数据库对应?
排序的问题,还有update问题。
Transaction silently rolled back because it has been marked as rollback-only”,
“data”: null
是因为@Trasactional里面的注解写错了
为什么数据有数据,查出来的字段全部为空null?
Dto的问题,数据库查询出空字段的
Post字段的名称是跟实体domain一致的。
实体的字段名称需要和Dto一致!
修改了字段,记得clean maven!
不然查出来还是空的。
传入卡片
卡片正文是一个list,appcode 就一个应用,写死,pagecode,
1.Boolean类型,生成的get方法是get开头的(建议使用这个).
2.boolean类型,生成的get方法是is开头的(用这个最好重写getXxx()格式的方法).
defined in file [/Users/wuzhenren/IdeaProjects/dasheng/dasheng-admin/da-search/target/classes/com/tigerobo/dasheng/admin/modules/search/rest/ConfigSearchHotController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘configSearchHotServiceImpl’ defined in file [/Users/wuzhenren/IdeaProjects/dasheng/dasheng-admin/da-search/target/classes/com/tigerobo/dasheng/admin/modules/search/service/impl/ConfigSearchHotServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘configSearchHotRepository’: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Using named parameters for method public abstract void com.tigerobo.dasheng.admin.modules.search.repository.ConfigSearchHotRepository.updateLevel(java.lang.Integer) but parameter ‘Optional[targetLevel]’ not found in annotated query ‘update search_hot_config set level =:level -1 where level > targetLevel’!
at
Repository的sql写的有问题, :或者?都是在传入参数绑定用的,别的和原生sql差不多。
Named parameter not bound 绑定参数的问题。
需要添加事务注解
could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet”
实体类和DTO和查询类名字要统一,数据库表和column要统一
然后Maven-clean,重新编译运行。