05 2021 档案

摘要:https://blog.jetbrains.com/2020/06/18/goland-template/?lang=zh-hans 阅读全文
posted @ 2021-05-30 14:54 winyh 阅读(215) 评论(0) 推荐(0) 编辑
摘要:Update 可以更新单个值,即使非零值 阅读全文
posted @ 2021-05-29 19:10 winyh 阅读(611) 评论(0) 推荐(0) 编辑
摘要:Error 1292: Incorrect datetime value: '0000-00-00' for column 'end_at' at row StartAt time.Time `json:"start_at" gorm:"comment:广告开始时间"`EndAt time.Time 阅读全文
posted @ 2021-05-29 10:18 winyh 阅读(527) 评论(0) 推荐(0) 编辑
摘要:db.AutoMigrate(&Address{}, &Apply{}, &Banner{}, &Booth{}, &Category{}, &Comment{}, &Coupon{}, &Dictionary{}, &Group{}, &Img{}, &Order{}, &Product{}, & 阅读全文
posted @ 2021-05-28 15:08 winyh 阅读(595) 评论(0) 推荐(0) 编辑
摘要:检查 go.mod 文件 项目名称是否正确 阅读全文
posted @ 2021-05-28 11:39 winyh 阅读(1584) 评论(0) 推荐(0) 编辑
摘要:go mod init projectName go mod init 会报错: go: cannot determine module path for source directory /xxx/xxx/xxx/name (outside GOPATH, module path must be 阅读全文
posted @ 2021-05-28 11:04 winyh 阅读(760) 评论(0) 推荐(1) 编辑
摘要:(1)这个问题只是从纯技术的考虑 (2)没有描述应用场景(3)问题的所需的目标 (4)等等 。想得太仓促,文不对题,见谅。 现在的思路是:(1)尽快完成产品,比较还有进度紧(2)在合适的时候重构或者升级,等有利润和时间合适,可以请人来解决,没必要事事去亲历。(3)凡事多角度去考虑,技术员(编码好), 阅读全文
posted @ 2021-05-27 07:38 winyh 阅读(51) 评论(0) 推荐(0) 编辑
摘要:orm 对象关系映射 o => 结构体 => 模型对应数据库中某张表 r => mysql m => 映射 结构体对应一张数据表,结构体字段对应数据库字段,结构体实例对应一条数据行记录。 1.自动迁移功能 2.表名默认为结构体名称的复数。大驼峰结构会被转化成小写下划线链接。定义结构体过程就是在定义模 阅读全文
posted @ 2021-05-26 08:29 winyh 阅读(284) 评论(0) 推荐(0) 编辑
摘要:方法一:结构体加 force 标签 `gorm:"force"` 方法二:Select("*") 方法三: map 阅读全文
posted @ 2021-05-24 17:48 winyh 阅读(559) 评论(0) 推荐(0) 编辑
摘要:type User struct { Id string `gorm:"primarykey"` Name string CreatedAt time.Time `gorm:"index"` } db.AutoMigrate(&User{}) db.Create(&User{ Name: "u1", 阅读全文
posted @ 2021-05-16 19:06 winyh 阅读(167) 评论(0) 推荐(0) 编辑
摘要:1.后端请求的access_token 每24小时内需要刷新一次 2.session_key 每次wx.login 执行时更新一次 3.小程序登录只是识别这个用户是谁 4.获取用户手机号,必须先调用wx.login接口 5.用订阅消息来做:服务通知,查看详情可以跳转到小程序页面 > 新版用统一服务下 阅读全文
posted @ 2021-05-15 11:02 winyh 阅读(75) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示