-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathhelp.txt
39 lines (33 loc) · 1.85 KB
/
help.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package help
func addTenMin2(st string) string {
timeLayout := "2006-01-02 15:04" //转化所需模板
loc, _ := time.LoadLocation("Local") //重要:获取时区
theTime, _ := time.ParseInLocation(timeLayout, st, loc)
fmt.Println(int64(theTime.Weekday()), "WEEK")
return ""
}
func addTenMin(st string) string {
timeLayout := "2006-01-02 15:04" //转化所需模板
loc, _ := time.LoadLocation("Local") //重要:获取时区
theTime, _ := time.ParseInLocation(timeLayout, st, loc)
sr := theTime.Unix() + 600
return time.Unix(sr, 0).Format(timeLayout)
}
// 简单说O(n²)表示当n很大的时候,复杂度约等于Cn²,C是某个常数,简单说就是当n足够大的时候,n的线性增长,复杂度将沿平方增长。O(n)也是差不多的意思,
// 也就是说n很大的时候复杂度约等于Cn,C是某个常数。O(1)就是说n很大的时候,复杂度基本就不增长了,基本就是个常量C。
// 作者:Ivony
// 链接:https://www.zhihu.com/question/21387264/answer/18080913
// 来源:知乎
// 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
//bf的前段控制器--白枫
1.在main里面调用这个,传入struct
common包下面有此函数
func MakeHandler(h Handler) rest.HandlerFunc {
return func(w rest.ResponseWriter, r *rest.Request) {
common_handler(w, r, h)
}
}
2.在common中定义了结构体,就是那个出名的绑定结构体,还有解析函数,就是那个common_handler函数,limina里面的第一个事情就是
把h这个句柄生成model,如果没有转陈宫,继续执行,干别的(他在解析对象的时候,是通过反射解析)
3.那个h为什么会连续的执行makebodey,checkbody,fuckbody是因为他是一个接口,接口里面有这些函数,然后在common_handler函数
里面连续的执行这些自定的函数