摘要: peewee通过insert_many批量插入数据,需要保证各元素都拥有相同的字段 如 :add_data = [{"id": 1, "name": "名称1"}, {"id": 1,}] 是不行滴 改为 :add_data = [{"id": 1, "name": "名称1"}, {"id": 1 阅读全文
posted @ 2022-12-09 17:28 日照龙鳞一点金 阅读(33) 评论(0) 推荐(0)
摘要: 故障原因:由于服务器熵值低,导致获取随机数时候 服务卡死。 先查看服务器熵值 cat /proc/sys/kernel/random/entropy_avail 安装 yum install rng-tools 工具 重启服务 sudo service rngd start 阅读全文
posted @ 2022-08-01 11:34 日照龙鳞一点金 阅读(143) 评论(0) 推荐(0)
摘要: IO错误:系统磁盘资源不足 iostat -x 1 10 查看系统io情况 阅读全文
posted @ 2022-06-29 18:20 日照龙鳞一点金 阅读(119) 评论(0) 推荐(0)
摘要: func SubMonth(startDate, endDate time.Time) int { yearInterval := endDate.Year() - startDate.Year() startMonth, endMonth := int(startDate.Month()), in 阅读全文
posted @ 2022-03-29 11:42 日照龙鳞一点金 阅读(61) 评论(0) 推荐(0)
摘要: gin框架中 日期格式无法插入数据库time.Time(string/JsonTime) 阅读全文
posted @ 2022-02-21 12:05 日照龙鳞一点金 阅读(376) 评论(0) 推荐(0)
摘要: 在使用vue 富文本框的时候,我们会使用Tinymce富文本框处理内容,该组件默认的上传地址的服务器部署的机器,重启机器的话会导致图片丢失。 此时我们希望把图片上传至fastdfs图片服务器,然后content中保存对应的图片路径 组件 <el-upload :multiple="true" :fi 阅读全文
posted @ 2022-01-06 11:10 日照龙鳞一点金 阅读(839) 评论(0) 推荐(0)
摘要: 使用gorm框架插入数据的时候,官方没有现成的批量插入方法,可通过自己拼接sql语句,执行原生sql来实现 实现代码 func (c *SalesDay)BatchSave(dataSlice []interface{}) (interface{}, error) { var buffer byte 阅读全文
posted @ 2022-01-05 16:09 日照龙鳞一点金 阅读(1563) 评论(0) 推荐(0)