Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertStrToInt(s string) int
- func GenerateOTP() string
- func GenerateOrderNumber(purchaseType string) string
- func GenerateSecurityToken(mobileNumber string) string
- func GenerateSequenceNumberForOTP(otp string) string
- func GetBytes(key interface{}) ([]byte, error)
- func GetCurrentTime() string
- func GetMd5String(s string) string
- func Pwdhash(str string) string
- func SendTemplateSMS(to string, datas []string, tempId string, serverInfo *ServerInfo) (result map[string]interface{}, err error)
- func StringsToJson(str string) string
- func Strtomd5(s string) string
- type BizError
- type RedisxCache
- func (rc *RedisxCache) ClearAll() error
- func (rc *RedisxCache) Decr(key string) error
- func (rc *RedisxCache) Delete(key string) error
- func (rc *RedisxCache) Get(key string) interface{}
- func (rc *RedisxCache) Incr(key string) error
- func (rc *RedisxCache) IsExist(key string) bool
- func (rc *RedisxCache) Put(key string, val interface{}, timeout int64) error
- func (rc *RedisxCache) StartAndGC(config string) error
- type ServerInfo
- type SmsData
- type SysError
Constants ¶
View Source
const BIZ_NO_RECORD = "200007"
View Source
const BIZ_OTP_VERIFIED_FAILED = "200001"
View Source
const BIZ_REQUIRED_CATEGORYKEY = "200005"
View Source
const BIZ_REQUIRED_LOVCODE = "200004"
View Source
const BIZ_REQUIRED_TRANSACTIONID = "200006"
View Source
const BIZ_SEND_SMS_FAILED = "200002"
View Source
const BIZ_WRONG_MOBILE_NUMBER = "200003"
View Source
const ERROR_JSON_MARSHAL_FAILED = "300002"
View Source
const ERROR_JSON_UNMARSHAL_FAILED = "300001"
View Source
const ERROR_MYSQL_QUERY_FAILED = "300005"
View Source
const ERROR_MYSQL_UPDATE_FAILED = "300006"
View Source
const ERROR_NO_LOV_DATA = "300004"
View Source
const ERROR_SEND_SMS_FAILED = "300003"
View Source
const ERROR_TOKEN_NOT_VERIFIED = "300007"
View Source
const LOV_MATERIAL_CATEGORY = "MATERIAL_CATEGORY"
LOV Code 材料分类
View Source
const LOV_MERCHANT_KEY_RET = "RET"
餐厅
View Source
const LOV_MERCHANT_KEY_SUP = "SUP"
菜老板
View Source
const LOV_MERCHANT_TYPE = "MERCHANT_TYPE"
商户类型
View Source
const LOV_STANDARD_TYPE = "STANDARD_TYPE"
材料等级
View Source
const LOV_TRANSACTION_TYPE = "TRANSACTION_TYPE"
订单类型
View Source
const LOV_TRANSACTION_TYPE_CANCEL = "007"
View Source
const LOV_TRANSACTION_TYPE_FINISH = "006"
View Source
const LOV_TRANSACTION_TYPE_NOT_PAIED = "002"
View Source
const LOV_TRANSACTION_TYPE_PAIED = "003"
View Source
const LOV_TRANSACTION_TYPE_SIGNOFF = "005"
View Source
const LOV_TRANSACTION_TYPE_START = "001"
订单状态
View Source
const LOV_TRANSACTION_TYPE_TRANSPORT = "004"
View Source
const ORDER_REQUEST = "REQ"
REQ: 询价单 RES: 报价单 TRX: 订单
View Source
const ORDER_RESPONSE = "RES"
View Source
const ORDER_TRANSACTION = "TRX"
View Source
const STATUS_SUCCESS = "000000"
View Source
const SUPPLIER_QUALIFIED = 10
Supplier Priority: 备选送货
View Source
const SUPPLIER_READY = 5
Supplier Priority: 可以合作的级别
Variables ¶
View Source
var Messages map[string]string
Functions ¶
func ConvertStrToInt ¶
func GenerateOrderNumber ¶
生成订单号 REQ: 询价单 RES: 报价单 TRX: 订单
func GenerateSecurityToken ¶
生成Security token
func GenerateSequenceNumberForOTP ¶
生成OTP Sequence Number
func SendTemplateSMS ¶
func StringsToJson ¶
Types ¶
type RedisxCache ¶
type RedisxCache struct {
// contains filtered or unexported fields
}
Redis cache adapter.
func NewRedisxCache ¶
func NewRedisxCache() *RedisxCache
create new redis cache with default collection name.
func (*RedisxCache) ClearAll ¶
func (rc *RedisxCache) ClearAll() error
clean all cache in redis. delete this redis collection.
func (*RedisxCache) IsExist ¶
func (rc *RedisxCache) IsExist(key string) bool
check cache exist in redis.
func (*RedisxCache) Put ¶
func (rc *RedisxCache) Put(key string, val interface{}, timeout int64) error
put cache to redis. timeout is ignored.
func (*RedisxCache) StartAndGC ¶
func (rc *RedisxCache) StartAndGC(config string) error
start redis cache adapter. config is like {"key":"collection key","conn":"connection info"} the cache item in redis are stored forever, so no gc operation.
type ServerInfo ¶
Click to show internal directories.
Click to hide internal directories.