feat:完善项目

This commit is contained in:
henry
2021-11-03 17:55:27 +08:00
parent 62c2dda714
commit af976f83c1
14 changed files with 376 additions and 27 deletions

13
lib/order.go Normal file
View File

@ -0,0 +1,13 @@
package lib
import (
"fmt"
"math/rand"
"time"
)
// OrderNo 订单号
func OrderNo() string {
now := time.Now()
return fmt.Sprintf("%s%d%05d", now.Format("20060102"), now.Unix(), rand.Intn(100000))
}

11
lib/order_test.go Normal file
View File

@ -0,0 +1,11 @@
package lib
import "testing"
func TestOrderNo(t *testing.T) {
i := 0
for i < 20 {
t.Log(OrderNo())
i++
}
}