utils

package
v0.0.0-...-7fa1929 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2015 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SMS_EXPIRY        = 5 //验证码有效期 单位分钟
	URL_CLIENT_ID_KEY = "client_id"
	URL_TOKEN_KEY     = "token"
	URL_CLIENT_ID     = "cf23df2207d99a74"
)

common

View Source
const (
	COMPANY_USER_STATUS_CHECK_NO  = 0
	COMPANY_USER_STATUS_CHECK_YES = 1
	COMPANY_USER_STATUS_DELETE    = 2
)

company user

View Source
const (
	TASK_STATUS_INIT  = 0
	TASK_STATUS_DOING = 1
	TASK_STATUS_DONE  = 2

	TASK_PRIORITY_LOW    = 1
	TASK_PRIORITY_NORMAL = 2
	TASK_PRIORITY_HIGH   = 3

	TASK_IS_READ = 1
	TASK_UN_READ = 0
)
View Source
const (
	Alnum = iota
	Alpha
	Numeric
)
View Source
const (
	COMPANY_NAME_MINSIZE = 4
)

company

View Source
const (
	PROJECT_NAME_MINSIZE = 4
)

project

Variables

View Source
var UPLOAD_ALLOWED_FILE_TYPE []string = []string{"avatar", "companyLogo"}

Functions

func EncryptPassword

func EncryptPassword(salt, password string) string

加密密码,转成md5

func FormatNow

func FormatNow(format string) string

func Md5String

func Md5String(src string) string

func RandString

func RandString(stringType, n int) string

func Salt

func Salt() string

func Sms_code

func Sms_code() string

func StringInSlice

func StringInSlice(a string, list []string) bool

func Token

func Token(uid int, ip string) string

func ValidationErrorToString

func ValidationErrorToString(e []*revel.ValidationError) string

Types

type TrackResult

type TrackResult struct {
	Code    int         `json:"code"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

func WrapFailJsonResult

func WrapFailJsonResult(message string) *TrackResult

func WrapJsonResult

func WrapJsonResult(c int, d interface{}, m string) *TrackResult

func WrapOKJsonResult

func WrapOKJsonResult(data interface{}) *TrackResult

func WrapValidationFailJsonResult

func WrapValidationFailJsonResult(code int, e []*revel.ValidationError) *TrackResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL