作者 tangxuhui

数据结构调整

  1 +package domain
  2 +
  3 +import "testing"
  4 +
  5 +func TestTokenParse(t *testing.T) {
  6 + tk := LoginToken{}
  7 + str := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Mjk4NzY3OTcsImlhdCI6MTYyOTg2OTU5NywiaXNzIjoiYWxsaWVkX2NyZWF0aW9uX2dhdGV3YXkiLCJuYmYiOjE2Mjk4Njk1OTcsInVzZXJJZCI6MSwidXNlckJhc2VJZCI6MSwiYWNjb3VudCI6IjE4ODYwMTgzMDUwIiwicGxhdGZvcm0iOiJhcHAiLCJjb21wYW55SWQiOjEsIm9yZ0lkIjoxLCJvcmdJZHMiOlsxLDU2XSwic2Vzc2lvbk1vZGUiOjF9.aDxfLwOpZCYWRhKa4GeKRh8sXsy2WOyt4X92uEEEXKg"
  8 + err := tk.ParseToken(str)
  9 + if err != nil {
  10 + t.Error(err)
  11 + }
  12 + t.Log("tk.Account=", tk.Account, " tk.CompanyId=", tk.CompanyId, " tk.OrgId=", tk.OrgId)
  13 +}
@@ -70,7 +70,7 @@ type ( @@ -70,7 +70,7 @@ type (
70 CooperationModeNumber string `json:"cooperationModeNumber"` 70 CooperationModeNumber string `json:"cooperationModeNumber"`
71 PublisherUid int `json:"publisherUid,string"` 71 PublisherUid int `json:"publisherUid,string"`
72 SponsorUid int `json:"sponsorUid,string"` 72 SponsorUid int `json:"sponsorUid,string"`
73 - DepartmentId int `json:"departmentId,string"` 73 + DepartmentId int `json:"departmentId"`
74 CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"` 74 CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"`
75 Attachment []*domain.Attachment `json:"attachment"` 75 Attachment []*domain.Attachment `json:"attachment"`
76 } 76 }
@@ -118,7 +118,7 @@ type ( @@ -118,7 +118,7 @@ type (
118 // 共创项目描述 118 // 共创项目描述
119 CooperationProjectDescription string `json:"cooperationProjectDescription"` 119 CooperationProjectDescription string `json:"cooperationProjectDescription"`
120 Attachment []domain.Attachment `json:"attachment"` 120 Attachment []domain.Attachment `json:"attachment"`
121 - DepartmentId int `json:"departmentId,string"` 121 + DepartmentId int `json:"departmentId"`
122 } 122 }
123 123
124 DataCooperationProjectUpdate struct { 124 DataCooperationProjectUpdate struct {