发表于: 2019-10-14 17:45:12

0 863


今天完成的事情:(一定要写非常细致的内容,比如说学会了盒子模型,了解了Margin)

昨天完成基本的后台消息模块,还差一个定时任务。

先测试昨天写的接口,出现了很多bug,第一个写的list列表没有问题的也出现了问题。

看web的日志:因为分页插件,所有的类必须序列化。

成功调通这个list接口。

调试模糊搜索接口:

查看service日志,不推荐使用,但是并不是我的模糊搜索不出现结果的原因。没找到,重新修改代码,在serviceimpl中加log日志;

修改最后取交集的顺序,由时间部分集合取前面的条件搜索集合。

成功

查看接口调试通过;

新增失败:

"message": "org.springframework.dao.DataIntegrityViolationException: \n### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null\n### The error may exist in class path resource [mapper/MessageMapper.xml]\n### The error may involve com.ptteng.academy.dao.MessageMapper.insert-Inline\n### The error occurred while setting parameters\n### SQL: insert into message (id, title, content,        url, type, push_time,        create_at, update_at, create_by,        update_by)     values (?, ?, ?,        ?, ?, ?,        ?, ?, ?,        ?)\n### Cause: java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null\n; Column 'id' cannot be null; nested exception is java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null\norg.springframework.dao.DataIntegrityViolationException: \n### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null\n### The error may exist in class path resource [mapper/MessageMapper.xml]\n### The error may involve com.ptteng.academy.dao.MessageMapper.insert-Inline\n### The error occurred while setting parameters\n### SQL: insert into message (id, title, content,        url, type, push_time,        create_at, update_at, create_by,        update_by)     values (?, ?, ?,        ?, ?, ?,        ?, ?, ?,        ?)\n### Cause: java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null\n; Column 'id' cannot be null; nested exception is java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null\n\tat 

id不能为空。

将xml中的sql语句的id去掉;或者使用可选性插入方法;

修改之后再次运行还是报错;

说的是id没有默认值。

数据库表没有设置成自增,修改之后再次运行。

成功:



调试:

立即推送;调试成功;

删除接口:测试成功。


然后就是最后的定时任务:没有人推送时到了推送时间,自动推送;

前台又出了问题;


将mapper.xml加入到了web端。


学习定时任务:

1、Timer

new Timer("testTimer").schedule(new TimerTask() {

            @Override

            public void run() {

                System.out.println("TimerTask");

            }

        }, 1000,2000);


解释:1000ms是延迟启动时间,2000ms是定时任务周期,每2s执行一次







明天计划的事情:(一定要写非常细致的内容)
遇到的问题:(遇到什么困难,怎么解决的)
收获:(通过今天的学习,学到了什么知识)


返回列表 返回列表
评论

    分享到