utils

package
v0.0.0-...-28c635c Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2015 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SESSION_KEY_UID = "uid"   //session存储用户ID键
	ADMIN_USERNAME  = "admin" //管理员用户名
	ADMIN_PASSWORD  = "admin" //管理员密码

	PERPAGE       = 20 //分页
	DATA_IMPORTED = false

	LEAVE_STATUS_ASKING   = 1
	LEAVE_STATUS_ASK_OK   = 2
	LEAVE_STATUS_ASK_FAIL = 3

	LEAVE_STATUS_CANCELING   = 4
	LEAVE_STATUS_CANCEL_OK   = 5
	LEAVE_STATUS_CANCEL_FAIL = 6

	LEAVE_CHECKING   = 0
	LEAVE_CHECK_OK   = 1
	LEAVE_CHECK_FAIL = 2
)

common

View Source
const (
	Alnum = iota
	Alpha
	Numeric
)

Variables

View Source
var EmploymentType = map[int]string{
	1: "长期合同工",
	2: "劳务工",
}

用工性质

View Source
var LeaveType = map[int]string{
	1: "事假",
	2: "病假",
	3: "年休假",
	4: "婚假",
	5: "丧假",
	6: "产假",
	7: "探亲假",
	8: "因公外出",
	9: "学习",
}

请假类型

View Source
var UserGender = map[int]string{
	1: "男",
	2: "女",
}

员工性别

View Source
var UserLevel = map[int]string{
	1: "一般员工",
	2: "科级管理人员",
}

员工级别

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 Pagination

func Pagination(limit, offset int, totalCount int64) string

func RandString

func RandString(stringType, n int) string

func Salt

func Salt() string

func StringInSlice

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

func ValidationErrorToString

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

Types

type Flow

type Flow struct {
	Id    string          `json:"id"`
	Name  string          `json:"name"`
	Steps map[string]Step `json:"steps"`
}

type Step

type Step struct {
	Charge string `json:"charge"`
	Type   string `json:"type"`
}

type TrackResult

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

Jump to

Keyboard shortcuts

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