package utils

import (
	"github.com/astaxie/beego/orm"

	"time"
)

func GetString(m orm.Params, param string) string {
	ret := ""
	switch i := m[param].(type) {
	case string:
		ret = i
	}

	return ret
}

func GetInt(m orm.Params, param string) int64 {
	var ret int64
	ret = -1

	switch i := m[param].(type) {
	case int, int32, int64:
		ret = i.(int64)
	}

	return ret
}

func GetTime(m orm.Params, param string) time.Time {
	var ret time.Time

	switch i := m[param].(type) {
	case time.Time:
		ret = i
	}

	return ret
}
