1234567891011121314151617181920212223242526272829303132 |
- package bus
- import "math/rand"
- type TreeAddDefineResp struct {
- DbId string
- Host string
- DefineId string
- Collection string
- }
- type TreeAddDefReq struct {
- DbName string
- UserId string
- Name string
- }
- type TreeRemoveDefReq struct {
- DbId string
- DefineId string
- }
- // 长度为62
- var bytes []byte = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890")
- func RandName(n int) string {
- result := make([]byte, n)
- for i := 0; i < n; i++ {
- result[i] = bytes[rand.Int31()%62]
- }
- return string(result)
- }
|