1.目录结构不确定
models对应表结构 service对应
2.cluster需要生产uuid
需要:231564917885799 15位
https://my.oschina.net/moks/blog/3127704
uuid的hash转数字(10)+拼接时间戳 拼接低位有开头有0 拼接高位不会变动
uuid裁剪
https://ask.csdn.net/questions/1040513
uuid转byte数组,byte数组转int
uuid := uuid.NewV4()
bytes := uuid.Bytes()
u15 := binary.LittleEndian.Uint64(bytes)&1125899906842623
https://www.zhihu.com/question/327448992
3.数据集初始化
4.gin入参校验
入参绑定结构体,校验
通过后继续绑定
5.bson查询
https://blog.csdn.net/LightUpHeaven/article/details/82663146
6.get参数绑定
https://www.kancloud.cn/shuangdeyu/gin_book/949428
https://www.kancloud.cn/shuangdeyu/gin_book/949426
7.update document must contain key beginning with ‘$’
https://www.thinbug.com/q/52684304
8.Performing an update on the path ‘_id’ would modify the immutable field ‘_id
https://ld246.com/article/1575376323553
9.重复id
不需要传objectId
10,参数绑定失效
type OamClusterQuery struct {
ClusterId int64 `json:"clusterId" binding:"required"`
UserName string `json:"userName" binding:"required"`
}
11.空切片
pageList.Items=make([]interface{},0)
12.Uri参数
不绑定至结构体
https://blog.csdn.net/qq_37767455/article/details/104686917
13.动态获取类型
14.动态更新bson.M
https://www.golangtc.com/t/536ad7c3320b52601900002b
14反射获取的为大写属性,与json不匹配
func GetPageList(m interface{}, items *bson.M) response.PagedList {
}
pageList = utils.GetPageList(&mo, &items)
//传入结构体指针
15
CommandMonitor 实现
16代码
triggered 触发
17更新数据只更新了部分数据
添加bson Tag
18
E11000 duplicate key error collection
索引重复
19.结构体内的结构体数据绑定失败
ctx.BindJSON(&rule.OamAppIngStatus)
ctx.BindJSON(&rule)
解决:绑定两次
20.拉平结构体
https://studygolang.com/articles/24072?fr=sidebar
https://stackoverflow.com/questions/61130889/mongo-go-driver-inline-with-embedded-structs-not-working
21.如何返回”Required request body is missing: 的错误
22查询结果相同
原因:存入切片中使用了同一个结构体
23.新增,数组增加
24.修改数组某一项
https://cloud.tencent.com/developer/article/1674247
25.
Found multiple array filters with the same top-level field name item”
26.入参数组校验
java:valid 数组内部的参数也要进行校验
https://www.cnblogs.com/asong2020/p/13546848.html
20210726
1./pipelines/cache GET
1./pipelines/cache POST
https://blog.csdn.net/LightUpHeaven/article/details/82663146