order apis
This commit is contained in:
+24
-14
@@ -10,20 +10,22 @@ import (
|
||||
)
|
||||
|
||||
type UserInfo struct {
|
||||
ID int64
|
||||
Name string
|
||||
RawUID string
|
||||
Refresh string
|
||||
ClientIP string // 客户端ip
|
||||
UserAgent string // 完整原始ua
|
||||
BrowserName string // 浏览器名称
|
||||
BrowserVer string // 浏览器版本
|
||||
StoreName string // 店铺名称
|
||||
StoreId int64 // 店铺id
|
||||
SaleName string // 销售名称
|
||||
SaleId int64 // 销售id
|
||||
GroupId int64 // 分组ID
|
||||
Valid bool
|
||||
ID int64
|
||||
Name string
|
||||
RawUID string
|
||||
Refresh string
|
||||
ClientIP string // 客户端ip
|
||||
UserAgent string // 完整原始ua
|
||||
BrowserName string // 浏览器名称
|
||||
BrowserVer string // 浏览器版本
|
||||
StoreName string // 店铺名称
|
||||
StoreId int64 // 店铺id
|
||||
SaleName string // 销售名称
|
||||
SaleId int64 // 销售id
|
||||
SaleMobile string // 销售手机
|
||||
SaleProvince int64 // 销售省份
|
||||
GroupId int64 // 分组ID
|
||||
Valid bool
|
||||
}
|
||||
|
||||
func GetUserFromCtx(ctx context.Context) UserInfo {
|
||||
@@ -42,6 +44,8 @@ func GetUserFromCtx(ctx context.Context) UserInfo {
|
||||
saleName := md.Get("x-sale-name")
|
||||
saleId := md.Get("x-sale-id")
|
||||
groupId := md.Get("x-group-id")
|
||||
province := md.Get("x-sale-province")
|
||||
mobile := md.Get("x-sale-mobile")
|
||||
|
||||
if len(refreshList) == NumberZero {
|
||||
refreshList = md.Get("X-Refresh")
|
||||
@@ -62,6 +66,12 @@ func GetUserFromCtx(ctx context.Context) UserInfo {
|
||||
if len(saleName) > NumberZero {
|
||||
userInfo.SaleName = saleName[NumberZero]
|
||||
}
|
||||
if len(province) > NumberZero {
|
||||
userInfo.SaleProvince, _ = strconv.ParseInt(province[NumberZero], NumberTen, NumberSixtyFourth)
|
||||
}
|
||||
if len(mobile) > NumberZero {
|
||||
userInfo.SaleMobile = mobile[NumberZero]
|
||||
}
|
||||
if len(saleId) > NumberZero {
|
||||
userInfo.SaleId, _ = strconv.ParseInt(saleId[NumberZero], NumberTen, NumberSixtyFourth)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user