1
This commit is contained in:
parent
a9b6ae14e7
commit
f58f61120a
@ -1,6 +1,14 @@
|
||||
package q5
|
||||
|
||||
import "crypto/md5"
|
||||
import "encoding/hex"
|
||||
|
||||
func Test()(a string) {
|
||||
return "testb"
|
||||
}
|
||||
|
||||
func Md5Str(data string) string {
|
||||
h := md5.New()
|
||||
h.Write([]byte(data))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
20
sysutils.go
20
sysutils.go
@ -1,5 +1,6 @@
|
||||
package q5
|
||||
|
||||
import "net/http"
|
||||
import "time"
|
||||
|
||||
func GetDaySeconds(seconds int64) int64 {
|
||||
@ -9,3 +10,22 @@ func GetDaySeconds(seconds int64) int64 {
|
||||
func GetTickCount() int64 {
|
||||
return time.Now().UnixNano() / 1e6
|
||||
}
|
||||
|
||||
func MkInt64(lo32 int32, hi32 int32) int64 {
|
||||
return int64(lo32) + (int64(hi32) << 32)
|
||||
}
|
||||
|
||||
func Request(r *http.Request, name string) *XValue {
|
||||
if r.Form == nil {
|
||||
r.ParseForm()
|
||||
}
|
||||
v := &XValue{}
|
||||
if vs, ok := r.Form[name]; ok {
|
||||
if len(vs) > 0 {
|
||||
v.SetString(vs[0])
|
||||
} else {
|
||||
v.SetString("")
|
||||
}
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
4
timer.go
4
timer.go
@ -241,6 +241,10 @@ func (this *Timer) GetRunningTimer() *TimerList {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *Timer) GetIdleMilliSeconds() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (this *Timer) detachTimer(timerList *TimerList) {
|
||||
if !timerList.entry.Empty() {
|
||||
timerList.entry.DelInit()
|
||||
|
@ -11,6 +11,7 @@ func (this *XParams) Reset() *XParams {
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *XParams) SetInt32(val int32) *XParams {
|
||||
func (this *XParams) Init(initFunc func (*XParams)) *XParams {
|
||||
initFunc(this)
|
||||
return this
|
||||
}
|
||||
|
11
xvalue.go
11
xvalue.go
@ -57,6 +57,10 @@ func (this *XValue) SetUserData(val interface{}) *XValue {
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *XValue) GetInt32() int32 {
|
||||
return int32(this.GetInt64())
|
||||
}
|
||||
|
||||
func (this *XValue) GetInt64() int64 {
|
||||
switch this._type {
|
||||
case XVT_INT:
|
||||
@ -81,5 +85,10 @@ func (this *XValue) GetInt64() int64 {
|
||||
}
|
||||
|
||||
func (this *XValue) GetString() string {
|
||||
return ""
|
||||
switch this._type {
|
||||
case XVT_STRING:
|
||||
return *(this._val.(*string))
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user