|
@@ -0,0 +1,33 @@
|
|
|
+package identity
|
|
|
+
|
|
|
+import (
|
|
|
+ "encoding/json"
|
|
|
+
|
|
|
+ "app.yhyue.com/moapp/jybase/encrypt"
|
|
|
+)
|
|
|
+
|
|
|
+type Identity struct {
|
|
|
+ PersonId int64 //自然人id
|
|
|
+ UserName string //用户昵称
|
|
|
+ AccountId int64 //账户id
|
|
|
+ EntAccountId int64 //企业账户id
|
|
|
+ PositionId int64 //职位id
|
|
|
+ PositionType int64 //职位类型
|
|
|
+ EntId int64 //企业id
|
|
|
+ EntName string //企业名称
|
|
|
+ EntUserId int64 //企业员工id
|
|
|
+ EntUserName string //企业员工姓名
|
|
|
+}
|
|
|
+
|
|
|
+//加密
|
|
|
+func Encode(i *Identity) string {
|
|
|
+ b, _ := json.Marshal(i)
|
|
|
+ return encrypt.SE.EncodeString(string(b))
|
|
|
+}
|
|
|
+
|
|
|
+//解密
|
|
|
+func Decode(v string) *Identity {
|
|
|
+ i := &Identity{}
|
|
|
+ json.Unmarshal([]byte(encrypt.SE.DecodeString(v)), &i)
|
|
|
+ return i
|
|
|
+}
|