摘要: type Tmp struct { Name string Age int } func main( data := []Tmp{ {"zhangsan", 18}, {"lisi", 22}, {"wangwu", 15}, } for _, v := range data { v.Age = 9 阅读全文
posted @ 2020-09-08 13:39 花名k 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 前文 : https://www.cnblogs.com/zengxm/p/13488448.html https://www.cnblogs.com/zengxm/p/13473340.html 如果业务查询返回json格式字符串,但是该字符串含有多个map,需要将字符串反序列化到切片结构体中 反 阅读全文
posted @ 2020-08-13 02:16 花名k 阅读(1447) 评论(0) 推荐(0) 编辑
摘要: 看我上一篇随笔 https://www.cnblogs.com/zengxm/p/13473340.html 其中使用mysql原始语句查询结果并返回 上一篇随笔代码 并想直接映射到结构体中,后来发现结构体序列化时有个坑 这次实际操作了一下解决了 代码如下 type Curriculums stru 阅读全文
posted @ 2020-08-12 04:15 花名k 阅读(2537) 评论(0) 推荐(0) 编辑
摘要: 场景如下,mysql根据用户u_id查询课程,不过该用户的课程为多列数据 table users table curriculums 查询语句 select * from users as u join curriculums as c on c.u_id = u.u_id where c.u_id 阅读全文
posted @ 2020-08-11 05:15 花名k 阅读(2233) 评论(0) 推荐(0) 编辑
摘要: 假设有一个用户信息需要插入表只,不过信息需要插入user和user_info表中 其中user_info需要user表中u_id这个主键 一般对应操作为先插入user表,再查询user.u_id 去user_info表插入 demo中发现不行,所以不过查询资料发现 LAST_INSERT_ID() 阅读全文
posted @ 2020-08-03 22:21 花名k 阅读(5410) 评论(0) 推荐(0) 编辑
摘要: main.dart import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'conf/config.dart' as conf; import 'views/bottomBarI 阅读全文
posted @ 2020-06-20 13:56 花名k 阅读(167) 评论(0) 推荐(0) 编辑
摘要: type node struct { data int lchild *node rchild *node } func newNode(data int) *node { return &node{data: data} } type binaryTree struct { root *node 阅读全文
posted @ 2020-06-14 17:32 花名k 阅读(154) 评论(0) 推荐(0) 编辑
摘要: func merge(left,right []int) (result []int) { r,l := 0,0 for l < len(left) && r < len(right) { if left[l] < right[r]{ result = append(result,left[l]) 阅读全文
posted @ 2020-06-14 17:29 花名k 阅读(181) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" ) type ListNode struct{ data int next *ListNode } func NewListNode(data int) *ListNode{ return &ListNode{data:data} } type 阅读全文
posted @ 2020-06-14 17:27 花名k 阅读(146) 评论(0) 推荐(0) 编辑
摘要: ps:个人理解 勿看,我看了都觉得傻逼 一、两阶段提交(2PC) 以web系统来说,一个聚合服务(购买请求) 对服务发送分别的请求(商品,订单,金额)方法,开启begin事务,但是不进行提交,返回结果(begin开启,commit未提交的状态) 如果成功则进行下一步,聚合服务返回要对应服务commi 阅读全文
posted @ 2020-06-07 23:12 花名k 阅读(221) 评论(0) 推荐(0) 编辑