作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/mmm-go/opp into dev

@@ -90,6 +90,7 @@ func GetRequestHeader(ctx *context.Context) *protocol.RequestHeader { @@ -90,6 +90,7 @@ func GetRequestHeader(ctx *context.Context) *protocol.RequestHeader {
90 h.Uid, _ = strconv.ParseInt(ctx.Input.Header("x-mmm-uid"), 10, 64) 90 h.Uid, _ = strconv.ParseInt(ctx.Input.Header("x-mmm-uid"), 10, 64)
91 } 91 }
92 h.CompanyId, _ = strconv.ParseInt(ctx.Input.Header("x-mmm-cid"), 10, 64) 92 h.CompanyId, _ = strconv.ParseInt(ctx.Input.Header("x-mmm-cid"), 10, 64)
  93 + h.UserId, _ = strconv.ParseInt(ctx.Input.Header("x-mmm-id"), 10, 64)
93 log.Debug(common.AssertJson(h)) 94 log.Debug(common.AssertJson(h))
94 return h 95 return h
95 } 96 }
@@ -103,7 +104,7 @@ func FilterComm(ctx *context.Context) { @@ -103,7 +104,7 @@ func FilterComm(ctx *context.Context) {
103 //统计 104 //统计
104 MetricCounter(ctx) 105 MetricCounter(ctx)
105 106
106 - if beego.BConfig.RunMode == "dev" && (ctx.Input.Header("x-mmm-uid")!="" || ctx.Input.Header("uid")!=""){ 107 + if beego.BConfig.RunMode == "dev" && (ctx.Input.Header("x-mmm-uid") != "" || ctx.Input.Header("uid") != "") {
107 return 108 return
108 } 109 }
109 //1.检查签名 110 //1.检查签名
@@ -160,10 +161,10 @@ func CheckToken(ctx *context.Context) (result bool) { @@ -160,10 +161,10 @@ func CheckToken(ctx *context.Context) (result bool) {
160 msg *protocol.ResponseMessage 161 msg *protocol.ResponseMessage
161 ) 162 )
162 token := ctx.Input.Header("x-mmm-accesstoken") 163 token := ctx.Input.Header("x-mmm-accesstoken")
163 - if token==""{ 164 + if token == "" {
164 if strings.HasSuffix(ctx.Request.RequestURI, "login") || 165 if strings.HasSuffix(ctx.Request.RequestURI, "login") ||
165 - strings.HasSuffix(ctx.Request.RequestURI, "accessToken") ||  
166 - strings.HasSuffix(ctx.Request.RequestURI, "refreshToken") { 166 + strings.HasSuffix(ctx.Request.RequestURI, "accessToken") ||
  167 + strings.HasSuffix(ctx.Request.RequestURI, "refreshToken") {
167 return true 168 return true
168 } 169 }
169 } 170 }
@@ -183,6 +184,7 @@ func CheckToken(ctx *context.Context) (result bool) { @@ -183,6 +184,7 @@ func CheckToken(ctx *context.Context) (result bool) {
183 //设置附加数据 184 //设置附加数据
184 ctx.Request.Header.Add("x-mmm-uid", fmt.Sprintf("%v", rsp.UserInfo.UserId)) 185 ctx.Request.Header.Add("x-mmm-uid", fmt.Sprintf("%v", rsp.UserInfo.UserId))
185 ctx.Request.Header.Add("x-mmm-cid", fmt.Sprintf("%v", rsp.UserInfo.CurrentCompanyId)) 186 ctx.Request.Header.Add("x-mmm-cid", fmt.Sprintf("%v", rsp.UserInfo.CurrentCompanyId))
  187 + ctx.Request.Header.Add("x-mmm-id", fmt.Sprintf("%v", rsp.UserInfo.CurrentUserCompanyId))
186 } 188 }
187 } 189 }
188 return 190 return
@@ -11,20 +11,21 @@ import ( @@ -11,20 +11,21 @@ import (
11 ) 11 )
12 12
13 type UserAuth struct { 13 type UserAuth struct {
14 - Id int `orm:"column(id);auto" description:"唯一编号"`  
15 - UserId int64 `orm:"column(user_id)" description:"表user.id "`  
16 - RefreshToken string `orm:"column(refresh_token);size(64)" description:"refresh token "`  
17 - RefreshTokenExp time.Time `orm:"column(refresh_token_exp);type(timestamp)" description:"refresh token 过期时间"`  
18 - AccessToken string `orm:"column(access_token);size(64)" description:"access_token "`  
19 - AccessTokenExp time.Time `orm:"column(access_token_exp);type(timestamp)" description:"access token 过期时间"`  
20 - AuthCode string `orm:"column(auth_code);size(64)" description:"auth_code"`  
21 - AuthCodeExp time.Time `orm:"column(auth_code_exp);type(timestamp)" description:"auth_code过期时间"`  
22 - DeviceType int8 `orm:"column(device_type)" description:"设备类型 0:ios 1:安卓 2:web "`  
23 - ClientId string `orm:"column(client_id);size(100)" description:"设备识别码 推送标识"`  
24 - DeviceToken string `orm:"column(device_token);size(100)" description:"设备识别码 推送标识"`  
25 - CreateAt time.Time `orm:"column(create_at);type(timestamp)" description:"创建时间"`  
26 - UpdateAt time.Time `orm:"column(update_at);type(timestamp)" description:"更新时间"`  
27 - CurrentCompanyId int64 `orm:"column(current_company_id)" description:"当前登录的公司id "` 14 + Id int `orm:"column(id);auto" description:"唯一编号"`
  15 + UserId int64 `orm:"column(user_id)" description:"表user.id "`
  16 + RefreshToken string `orm:"column(refresh_token);size(64)" description:"refresh token "`
  17 + RefreshTokenExp time.Time `orm:"column(refresh_token_exp);type(timestamp)" description:"refresh token 过期时间"`
  18 + AccessToken string `orm:"column(access_token);size(64)" description:"access_token "`
  19 + AccessTokenExp time.Time `orm:"column(access_token_exp);type(timestamp)" description:"access token 过期时间"`
  20 + AuthCode string `orm:"column(auth_code);size(64)" description:"auth_code"`
  21 + AuthCodeExp time.Time `orm:"column(auth_code_exp);type(timestamp)" description:"auth_code过期时间"`
  22 + DeviceType int8 `orm:"column(device_type)" description:"设备类型 0:ios 1:安卓 2:web "`
  23 + ClientId string `orm:"column(client_id);size(100)" description:"设备识别码 推送标识"`
  24 + DeviceToken string `orm:"column(device_token);size(100)" description:"设备识别码 推送标识"`
  25 + CreateAt time.Time `orm:"column(create_at);type(timestamp)" description:"创建时间"`
  26 + UpdateAt time.Time `orm:"column(update_at);type(timestamp)" description:"更新时间"`
  27 + CurrentCompanyId int64 `orm:"column(current_company_id)" description:"当前登录的公司id "`
  28 + CurrentUserCompanyId int64 `orm:"column(current_user_company_id)" description:"当前登录的公司 user_company.id "`
28 } 29 }
29 30
30 func (t *UserAuth) TableName() string { 31 func (t *UserAuth) TableName() string {
@@ -180,10 +181,10 @@ func GetUserAuthByRefreshToken(refreshToken string) (v *UserAuth, err error) { @@ -180,10 +181,10 @@ func GetUserAuthByRefreshToken(refreshToken string) (v *UserAuth, err error) {
180 return nil, err 181 return nil, err
181 } 182 }
182 183
183 -func GetUserAuthByToken(refreshToken string) (v *UserAuth, err error) { 184 +func GetUserAuthByToken(token string) (v *UserAuth, err error) {
184 o := orm.NewOrm() 185 o := orm.NewOrm()
185 sql := "select * from user_auth where access_token=? and access_token_exp >= Now()" 186 sql := "select * from user_auth where access_token=? and access_token_exp >= Now()"
186 - if err = o.Raw(sql, refreshToken).QueryRow(&v); err == nil { 187 + if err = o.Raw(sql, token).QueryRow(&v); err == nil {
187 return v, nil 188 return v, nil
188 } 189 }
189 return nil, err 190 return nil, err
@@ -8,7 +8,7 @@ import ( @@ -8,7 +8,7 @@ import (
8 ) 8 )
9 9
10 type UserCompany struct { 10 type UserCompany struct {
11 - Id int `orm:"column(id);auto" description:"唯一标识"` 11 + Id int64 `orm:"column(id)" description:"唯一标识"`
12 CompanyId int64 `orm:"column(company_id)" description:"表company.id 公司编号"` 12 CompanyId int64 `orm:"column(company_id)" description:"表company.id 公司编号"`
13 UserId int64 `orm:"column(user_id)" description:"表user.id 用户编号"` 13 UserId int64 `orm:"column(user_id)" description:"表user.id 用户编号"`
14 DepartmentId int `orm:"column(department_id)" description:"部门id"` 14 DepartmentId int `orm:"column(department_id)" description:"部门id"`
@@ -37,7 +37,7 @@ func AddUserCompany(m *UserCompany) (id int64, err error) { @@ -37,7 +37,7 @@ func AddUserCompany(m *UserCompany) (id int64, err error) {
37 37
38 // GetUserCompanyById retrieves UserCompany by Id. Returns error if 38 // GetUserCompanyById retrieves UserCompany by Id. Returns error if
39 // Id doesn't exist 39 // Id doesn't exist
40 -func GetUserCompanyById(id int) (v *UserCompany, err error) { 40 +func GetUserCompanyById(id int64) (v *UserCompany, err error) {
41 o := orm.NewOrm() 41 o := orm.NewOrm()
42 v = &UserCompany{Id: id} 42 v = &UserCompany{Id: id}
43 if err = o.Read(v); err == nil { 43 if err = o.Read(v); err == nil {
@@ -63,7 +63,7 @@ func UpdateUserCompanyById(m *UserCompany) (err error) { @@ -63,7 +63,7 @@ func UpdateUserCompanyById(m *UserCompany) (err error) {
63 63
64 // DeleteUserCompany deletes UserCompany by Id and returns error if 64 // DeleteUserCompany deletes UserCompany by Id and returns error if
65 // the record to be deleted doesn't exist 65 // the record to be deleted doesn't exist
66 -func DeleteUserCompany(id int) (err error) { 66 +func DeleteUserCompany(id int64) (err error) {
67 o := orm.NewOrm() 67 o := orm.NewOrm()
68 v := UserCompany{Id: id} 68 v := UserCompany{Id: id}
69 // ascertain id exists in the database 69 // ascertain id exists in the database
@@ -94,4 +94,4 @@ func GetUserCompanyFirst(uid int64) (v *UserCompany, err error) { @@ -94,4 +94,4 @@ func GetUserCompanyFirst(uid int64) (v *UserCompany, err error) {
94 return v, nil 94 return v, nil
95 } 95 }
96 return nil, err 96 return nil, err
97 -}  
  97 +}
@@ -7,8 +7,8 @@ const ( @@ -7,8 +7,8 @@ const (
7 LoginTypeSmdcode = "signInCaptcha" 7 LoginTypeSmdcode = "signInCaptcha"
8 ) 8 )
9 9
10 -const(  
11 - DeviceType =1 10 +const (
  11 + DeviceType = 1
12 ) 12 )
13 13
14 const TokenExpire = 3600 14 const TokenExpire = 3600
@@ -24,8 +24,9 @@ type RequestHeader struct { @@ -24,8 +24,9 @@ type RequestHeader struct {
24 DeviceType int 24 DeviceType int
25 AppProject string 25 AppProject string
26 AccessToken string 26 AccessToken string
27 - Uid int64 27 + Uid int64 //用户基本信息Id
28 CompanyId int64 28 CompanyId int64
  29 + UserId int64 //UserId 唯一标识,唯一关联所有用户信息(=user_company.id)
29 } 30 }
30 31
31 /*Login */ 32 /*Login */
@@ -9,266 +9,266 @@ func init() { @@ -9,266 +9,266 @@ func init() {
9 9
10 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"], 10 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"],
11 beego.ControllerComments{ 11 beego.ControllerComments{
12 - Method: "AccessToken",  
13 - Router: `/accessToken`, 12 + Method: "AccessToken",
  13 + Router: `/accessToken`,
14 AllowHTTPMethods: []string{"post"}, 14 AllowHTTPMethods: []string{"post"},
15 - MethodParams: param.Make(),  
16 - Params: nil}) 15 + MethodParams: param.Make(),
  16 + Params: nil})
17 17
18 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"], 18 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"],
19 beego.ControllerComments{ 19 beego.ControllerComments{
20 - Method: "Login",  
21 - Router: `/login`, 20 + Method: "Login",
  21 + Router: `/login`,
22 AllowHTTPMethods: []string{"post"}, 22 AllowHTTPMethods: []string{"post"},
23 - MethodParams: param.Make(),  
24 - Params: nil}) 23 + MethodParams: param.Make(),
  24 + Params: nil})
25 25
26 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"], 26 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"],
27 beego.ControllerComments{ 27 beego.ControllerComments{
28 - Method: "RefreshToken",  
29 - Router: `/refreshToken`, 28 + Method: "RefreshToken",
  29 + Router: `/refreshToken`,
30 AllowHTTPMethods: []string{"post"}, 30 AllowHTTPMethods: []string{"post"},
31 - MethodParams: param.Make(),  
32 - Params: nil}) 31 + MethodParams: param.Make(),
  32 + Params: nil})
33 33
34 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"], 34 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"],
35 beego.ControllerComments{ 35 beego.ControllerComments{
36 - Method: "Revoke",  
37 - Router: `/revoke`, 36 + Method: "Revoke",
  37 + Router: `/revoke`,
38 AllowHTTPMethods: []string{"post"}, 38 AllowHTTPMethods: []string{"post"},
39 - MethodParams: param.Make(),  
40 - Params: nil}) 39 + MethodParams: param.Make(),
  40 + Params: nil})
41 41
42 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"], 42 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"],
43 beego.ControllerComments{ 43 beego.ControllerComments{
44 - Method: "SmsCode",  
45 - Router: `/smsCode`, 44 + Method: "SmsCode",
  45 + Router: `/smsCode`,
46 AllowHTTPMethods: []string{"post"}, 46 AllowHTTPMethods: []string{"post"},
47 - MethodParams: param.Make(),  
48 - Params: nil}) 47 + MethodParams: param.Make(),
  48 + Params: nil})
49 49
50 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"], 50 beego.GlobalControllerRouter["opp/controllers/v1:AuthController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:AuthController"],
51 beego.ControllerComments{ 51 beego.ControllerComments{
52 - Method: "UpdateDevice",  
53 - Router: `/updateDevice`, 52 + Method: "UpdateDevice",
  53 + Router: `/updateDevice`,
54 AllowHTTPMethods: []string{"post"}, 54 AllowHTTPMethods: []string{"post"},
55 - MethodParams: param.Make(),  
56 - Params: nil}) 55 + MethodParams: param.Make(),
  56 + Params: nil})
57 57
58 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 58 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
59 beego.ControllerComments{ 59 beego.ControllerComments{
60 - Method: "ChanceType",  
61 - Router: `/chanceType`, 60 + Method: "ChanceType",
  61 + Router: `/chanceType`,
62 AllowHTTPMethods: []string{"post"}, 62 AllowHTTPMethods: []string{"post"},
63 - MethodParams: param.Make(),  
64 - Params: nil}) 63 + MethodParams: param.Make(),
  64 + Params: nil})
65 65
66 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 66 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
67 beego.ControllerComments{ 67 beego.ControllerComments{
68 - Method: "CommentDetailsMulti",  
69 - Router: `/commentDetailsMulti`, 68 + Method: "CommentDetailsMulti",
  69 + Router: `/commentDetailsMulti`,
70 AllowHTTPMethods: []string{"post"}, 70 AllowHTTPMethods: []string{"post"},
71 - MethodParams: param.Make(),  
72 - Params: nil}) 71 + MethodParams: param.Make(),
  72 + Params: nil})
73 73
74 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 74 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
75 beego.ControllerComments{ 75 beego.ControllerComments{
76 - Method: "CommentDetailsSingle",  
77 - Router: `/commentDetailsSingle`, 76 + Method: "CommentDetailsSingle",
  77 + Router: `/commentDetailsSingle`,
78 AllowHTTPMethods: []string{"post"}, 78 AllowHTTPMethods: []string{"post"},
79 - MethodParams: param.Make(),  
80 - Params: nil}) 79 + MethodParams: param.Make(),
  80 + Params: nil})
81 81
82 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 82 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
83 beego.ControllerComments{ 83 beego.ControllerComments{
84 - Method: "Comments",  
85 - Router: `/comments`, 84 + Method: "Comments",
  85 + Router: `/comments`,
86 AllowHTTPMethods: []string{"post"}, 86 AllowHTTPMethods: []string{"post"},
87 - MethodParams: param.Make(),  
88 - Params: nil}) 87 + MethodParams: param.Make(),
  88 + Params: nil})
89 89
90 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 90 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
91 beego.ControllerComments{ 91 beego.ControllerComments{
92 - Method: "Favorite",  
93 - Router: `/favorite`, 92 + Method: "Favorite",
  93 + Router: `/favorite`,
94 AllowHTTPMethods: []string{"post"}, 94 AllowHTTPMethods: []string{"post"},
95 - MethodParams: param.Make(),  
96 - Params: nil}) 95 + MethodParams: param.Make(),
  96 + Params: nil})
97 97
98 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 98 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
99 beego.ControllerComments{ 99 beego.ControllerComments{
100 - Method: "IComment",  
101 - Router: `/iComment`, 100 + Method: "IComment",
  101 + Router: `/iComment`,
102 AllowHTTPMethods: []string{"post"}, 102 AllowHTTPMethods: []string{"post"},
103 - MethodParams: param.Make(),  
104 - Params: nil}) 103 + MethodParams: param.Make(),
  104 + Params: nil})
105 105
106 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 106 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
107 beego.ControllerComments{ 107 beego.ControllerComments{
108 - Method: "IComments",  
109 - Router: `/iComments`, 108 + Method: "IComments",
  109 + Router: `/iComments`,
110 AllowHTTPMethods: []string{"post"}, 110 AllowHTTPMethods: []string{"post"},
111 - MethodParams: param.Make(),  
112 - Params: nil}) 111 + MethodParams: param.Make(),
  112 + Params: nil})
113 113
114 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 114 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
115 beego.ControllerComments{ 115 beego.ControllerComments{
116 - Method: "ChanceSubmit",  
117 - Router: `/submit`, 116 + Method: "ChanceSubmit",
  117 + Router: `/submit`,
118 AllowHTTPMethods: []string{"post"}, 118 AllowHTTPMethods: []string{"post"},
119 - MethodParams: param.Make(),  
120 - Params: nil}) 119 + MethodParams: param.Make(),
  120 + Params: nil})
121 121
122 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 122 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
123 beego.ControllerComments{ 123 beego.ControllerComments{
124 - Method: "SympathyAction",  
125 - Router: `/sympathyAction`, 124 + Method: "SympathyAction",
  125 + Router: `/sympathyAction`,
126 AllowHTTPMethods: []string{"post"}, 126 AllowHTTPMethods: []string{"post"},
127 - MethodParams: param.Make(),  
128 - Params: nil}) 127 + MethodParams: param.Make(),
  128 + Params: nil})
129 129
130 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"], 130 beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
131 beego.ControllerComments{ 131 beego.ControllerComments{
132 - Method: "Templates",  
133 - Router: `/templates`, 132 + Method: "Templates",
  133 + Router: `/templates`,
134 AllowHTTPMethods: []string{"post"}, 134 AllowHTTPMethods: []string{"post"},
135 - MethodParams: param.Make(),  
136 - Params: nil}) 135 + MethodParams: param.Make(),
  136 + Params: nil})
137 137
138 beego.GlobalControllerRouter["opp/controllers/v1:CommendController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:CommendController"], 138 beego.GlobalControllerRouter["opp/controllers/v1:CommendController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:CommendController"],
139 beego.ControllerComments{ 139 beego.ControllerComments{
140 - Method: "Company",  
141 - Router: `/company`, 140 + Method: "Company",
  141 + Router: `/company`,
142 AllowHTTPMethods: []string{"post"}, 142 AllowHTTPMethods: []string{"post"},
143 - MethodParams: param.Make(),  
144 - Params: nil}) 143 + MethodParams: param.Make(),
  144 + Params: nil})
145 145
146 beego.GlobalControllerRouter["opp/controllers/v1:DepartmentController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:DepartmentController"], 146 beego.GlobalControllerRouter["opp/controllers/v1:DepartmentController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:DepartmentController"],
147 beego.ControllerComments{ 147 beego.ControllerComments{
148 - Method: "Departments",  
149 - Router: `/departments`, 148 + Method: "Departments",
  149 + Router: `/departments`,
150 AllowHTTPMethods: []string{"post"}, 150 AllowHTTPMethods: []string{"post"},
151 - MethodParams: param.Make(),  
152 - Params: nil}) 151 + MethodParams: param.Make(),
  152 + Params: nil})
153 153
154 beego.GlobalControllerRouter["opp/controllers/v1:MessageController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:MessageController"], 154 beego.GlobalControllerRouter["opp/controllers/v1:MessageController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:MessageController"],
155 beego.ControllerComments{ 155 beego.ControllerComments{
156 - Method: "MessageCenter",  
157 - Router: `/messageCenter`, 156 + Method: "MessageCenter",
  157 + Router: `/messageCenter`,
158 AllowHTTPMethods: []string{"post"}, 158 AllowHTTPMethods: []string{"post"},
159 - MethodParams: param.Make(),  
160 - Params: nil}) 159 + MethodParams: param.Make(),
  160 + Params: nil})
161 161
162 beego.GlobalControllerRouter["opp/controllers/v1:MessageController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:MessageController"], 162 beego.GlobalControllerRouter["opp/controllers/v1:MessageController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:MessageController"],
163 beego.ControllerComments{ 163 beego.ControllerComments{
164 - Method: "MsgCenterAllRead",  
165 - Router: `/msgCenterAllRead`, 164 + Method: "MsgCenterAllRead",
  165 + Router: `/msgCenterAllRead`,
166 AllowHTTPMethods: []string{"post"}, 166 AllowHTTPMethods: []string{"post"},
167 - MethodParams: param.Make(),  
168 - Params: nil}) 167 + MethodParams: param.Make(),
  168 + Params: nil})
169 169
170 beego.GlobalControllerRouter["opp/controllers/v1:MessageController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:MessageController"], 170 beego.GlobalControllerRouter["opp/controllers/v1:MessageController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:MessageController"],
171 beego.ControllerComments{ 171 beego.ControllerComments{
172 - Method: "MsgCenterRead",  
173 - Router: `/msgCenterRead`, 172 + Method: "MsgCenterRead",
  173 + Router: `/msgCenterRead`,
174 AllowHTTPMethods: []string{"post"}, 174 AllowHTTPMethods: []string{"post"},
175 - MethodParams: param.Make(),  
176 - Params: nil}) 175 + MethodParams: param.Make(),
  176 + Params: nil})
177 177
178 beego.GlobalControllerRouter["opp/controllers/v1:MessageController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:MessageController"], 178 beego.GlobalControllerRouter["opp/controllers/v1:MessageController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:MessageController"],
179 beego.ControllerComments{ 179 beego.ControllerComments{
180 - Method: "MsgInteractive",  
181 - Router: `/msgInteractive`, 180 + Method: "MsgInteractive",
  181 + Router: `/msgInteractive`,
182 AllowHTTPMethods: []string{"post"}, 182 AllowHTTPMethods: []string{"post"},
183 - MethodParams: param.Make(),  
184 - Params: nil}) 183 + MethodParams: param.Make(),
  184 + Params: nil})
185 185
186 beego.GlobalControllerRouter["opp/controllers/v1:UcenterController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UcenterController"], 186 beego.GlobalControllerRouter["opp/controllers/v1:UcenterController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UcenterController"],
187 beego.ControllerComments{ 187 beego.ControllerComments{
188 - Method: "UCenterLogin",  
189 - Router: `/login`, 188 + Method: "UCenterLogin",
  189 + Router: `/login`,
190 AllowHTTPMethods: []string{"post"}, 190 AllowHTTPMethods: []string{"post"},
191 - MethodParams: param.Make(),  
192 - Params: nil}) 191 + MethodParams: param.Make(),
  192 + Params: nil})
193 193
194 beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"], 194 beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"],
195 beego.ControllerComments{ 195 beego.ControllerComments{
196 - Method: "Image",  
197 - Router: `/image`, 196 + Method: "Image",
  197 + Router: `/image`,
198 AllowHTTPMethods: []string{"post"}, 198 AllowHTTPMethods: []string{"post"},
199 - MethodParams: param.Make(),  
200 - Params: nil}) 199 + MethodParams: param.Make(),
  200 + Params: nil})
201 201
202 beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"], 202 beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"],
203 beego.ControllerComments{ 203 beego.ControllerComments{
204 - Method: "Video",  
205 - Router: `/video`, 204 + Method: "Video",
  205 + Router: `/video`,
206 AllowHTTPMethods: []string{"post"}, 206 AllowHTTPMethods: []string{"post"},
207 - MethodParams: param.Make(),  
208 - Params: nil}) 207 + MethodParams: param.Make(),
  208 + Params: nil})
209 209
210 beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"], 210 beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"],
211 beego.ControllerComments{ 211 beego.ControllerComments{
212 - Method: "Voice",  
213 - Router: `/voice`, 212 + Method: "Voice",
  213 + Router: `/voice`,
214 AllowHTTPMethods: []string{"post"}, 214 AllowHTTPMethods: []string{"post"},
215 - MethodParams: param.Make(),  
216 - Params: nil}) 215 + MethodParams: param.Make(),
  216 + Params: nil})
217 217
218 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 218 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
219 beego.ControllerComments{ 219 beego.ControllerComments{
220 - Method: "ChangePassword",  
221 - Router: `/changePassword`, 220 + Method: "ChangePassword",
  221 + Router: `/changePassword`,
222 AllowHTTPMethods: []string{"post"}, 222 AllowHTTPMethods: []string{"post"},
223 - MethodParams: param.Make(),  
224 - Params: nil}) 223 + MethodParams: param.Make(),
  224 + Params: nil})
225 225
226 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 226 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
227 beego.ControllerComments{ 227 beego.ControllerComments{
228 - Method: "ChangePhone",  
229 - Router: `/changePhone`, 228 + Method: "ChangePhone",
  229 + Router: `/changePhone`,
230 AllowHTTPMethods: []string{"post"}, 230 AllowHTTPMethods: []string{"post"},
231 - MethodParams: param.Make(),  
232 - Params: nil}) 231 + MethodParams: param.Make(),
  232 + Params: nil})
233 233
234 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 234 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
235 beego.ControllerComments{ 235 beego.ControllerComments{
236 - Method: "CheckSmsCode",  
237 - Router: `/checkSmsCode`, 236 + Method: "CheckSmsCode",
  237 + Router: `/checkSmsCode`,
238 AllowHTTPMethods: []string{"post"}, 238 AllowHTTPMethods: []string{"post"},
239 - MethodParams: param.Make(),  
240 - Params: nil}) 239 + MethodParams: param.Make(),
  240 + Params: nil})
241 241
242 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 242 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
243 beego.ControllerComments{ 243 beego.ControllerComments{
244 - Method: "ResetPassword",  
245 - Router: `/resetPassword`, 244 + Method: "ResetPassword",
  245 + Router: `/resetPassword`,
246 AllowHTTPMethods: []string{"post"}, 246 AllowHTTPMethods: []string{"post"},
247 - MethodParams: param.Make(),  
248 - Params: nil}) 247 + MethodParams: param.Make(),
  248 + Params: nil})
249 249
250 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 250 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
251 beego.ControllerComments{ 251 beego.ControllerComments{
252 - Method: "SwitchCompany",  
253 - Router: `/switchCompany`, 252 + Method: "SwitchCompany",
  253 + Router: `/switchCompany`,
254 AllowHTTPMethods: []string{"post"}, 254 AllowHTTPMethods: []string{"post"},
255 - MethodParams: param.Make(),  
256 - Params: nil}) 255 + MethodParams: param.Make(),
  256 + Params: nil})
257 257
258 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 258 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
259 beego.ControllerComments{ 259 beego.ControllerComments{
260 - Method: "UserCompanys",  
261 - Router: `/userCompanys`, 260 + Method: "UserCompanys",
  261 + Router: `/userCompanys`,
262 AllowHTTPMethods: []string{"post"}, 262 AllowHTTPMethods: []string{"post"},
263 - MethodParams: param.Make(),  
264 - Params: nil}) 263 + MethodParams: param.Make(),
  264 + Params: nil})
265 265
266 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 266 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
267 beego.ControllerComments{ 267 beego.ControllerComments{
268 - Method: "UserInfo",  
269 - Router: `/userInfo`, 268 + Method: "UserInfo",
  269 + Router: `/userInfo`,
270 AllowHTTPMethods: []string{"post"}, 270 AllowHTTPMethods: []string{"post"},
271 - MethodParams: param.Make(),  
272 - Params: nil}) 271 + MethodParams: param.Make(),
  272 + Params: nil})
273 273
274 } 274 }
@@ -15,18 +15,18 @@ import ( @@ -15,18 +15,18 @@ import (
15 func GetUserBaseInfoAggregation(uid int64, companyId int64) (v *protocol.UserBaseInfoAggregation, err error) { 15 func GetUserBaseInfoAggregation(uid int64, companyId int64) (v *protocol.UserBaseInfoAggregation, err error) {
16 v = &protocol.UserBaseInfoAggregation{} 16 v = &protocol.UserBaseInfoAggregation{}
17 var wg sync.WaitGroup 17 var wg sync.WaitGroup
18 - if v.User, err = repository.User.GetUsersById(uid); err != nil { 18 + if v.UserCompany, err = models.GetUserCompanyByUserId(uid, companyId); err != nil {
19 log.Error(err) 19 log.Error(err)
20 return 20 return
21 } 21 }
22 - if v.UserCompany, err = repository.UserCompany.GetUserCompanyByUserId(uid, companyId); err != nil { 22 + if v.User, err = models.GetUsersById(v.UserCompany.UserId); err != nil {
23 log.Error(err) 23 log.Error(err)
24 return 24 return
25 } 25 }
26 wg.Add(3) 26 wg.Add(3)
27 go func() { 27 go func() {
28 defer wg.Done() 28 defer wg.Done()
29 - if v.Company, err = repository.Company.GetCompanyById(int64(v.UserCompany.CompanyId)); err != nil { 29 + if v.Company, err = models.GetCompanyById(int64(v.UserCompany.CompanyId)); err != nil {
30 log.Error(err) 30 log.Error(err)
31 return 31 return
32 } 32 }
@@ -34,7 +34,7 @@ func GetUserBaseInfoAggregation(uid int64, companyId int64) (v *protocol.UserBas @@ -34,7 +34,7 @@ func GetUserBaseInfoAggregation(uid int64, companyId int64) (v *protocol.UserBas
34 34
35 go func() { 35 go func() {
36 defer wg.Done() 36 defer wg.Done()
37 - if err = repository.UserDepartment.GetUserDepartment(uid, companyId, &v.Department); err != nil { 37 + if err = models.GetUserDepartments(uid, companyId, &v.Department); err != nil {
38 log.Error(err) 38 log.Error(err)
39 return 39 return
40 } 40 }
@@ -42,7 +42,7 @@ func GetUserBaseInfoAggregation(uid int64, companyId int64) (v *protocol.UserBas @@ -42,7 +42,7 @@ func GetUserBaseInfoAggregation(uid int64, companyId int64) (v *protocol.UserBas
42 42
43 go func() { 43 go func() {
44 defer wg.Done() 44 defer wg.Done()
45 - if err = repository.UserPosition.GetUserPositions(uid, companyId, &v.Position); err != nil { 45 + if err = models.GetUserPositions(uid, companyId, &v.Position); err != nil {
46 log.Error(err) 46 log.Error(err)
47 return 47 return
48 } 48 }
@@ -41,7 +41,7 @@ func IComment(header *protocol.RequestHeader, request *protocol.ICommentRequest) @@ -41,7 +41,7 @@ func IComment(header *protocol.RequestHeader, request *protocol.ICommentRequest)
41 } 41 }
42 newComment := &models.Comment{ 42 newComment := &models.Comment{
43 Id: idgen.Next(), 43 Id: idgen.Next(),
44 - UserId: header.Uid, 44 + UserId: header.UserId,
45 SourceType: int8(request.SourceType), 45 SourceType: int8(request.SourceType),
46 Content: request.Content, 46 Content: request.Content,
47 CreateAt: time.Now(), 47 CreateAt: time.Now(),
@@ -74,7 +74,7 @@ func IComments(header *protocol.RequestHeader, request *protocol.ICommentsReques @@ -74,7 +74,7 @@ func IComments(header *protocol.RequestHeader, request *protocol.ICommentsReques
74 baseUserInfo *protocol.BaseUserInfo 74 baseUserInfo *protocol.BaseUserInfo
75 total int 75 total int
76 ) 76 )
77 - if comments, total, err = repository.Comment.GetComments(header.Uid, protocol.SourceTypeChance, 0, request.LastId, request.PageSize); err != nil { 77 + if comments, total, err = repository.Comment.GetComments(header.UserId, protocol.SourceTypeChance, 0, request.LastId, request.PageSize); err != nil {
78 log.Error(err) 78 log.Error(err)
79 return 79 return
80 } 80 }
@@ -112,7 +112,7 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest) @@ -112,7 +112,7 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest)
112 total int 112 total int
113 exists bool 113 exists bool
114 ) 114 )
115 - if comments, total, err = repository.Comment.GetComments(header.Uid, request.SourceType, request.SourceId, request.LastId, request.PageSize); err != nil { 115 + if comments, total, err = repository.Comment.GetComments(header.UserId, request.SourceType, request.SourceId, request.LastId, request.PageSize); err != nil {
116 log.Error(err) 116 log.Error(err)
117 return 117 return
118 } 118 }
@@ -134,7 +134,7 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest) @@ -134,7 +134,7 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest)
134 ZanTotal: comment.ZanTotal, 134 ZanTotal: comment.ZanTotal,
135 CommentTotal: comment.CommentTotal, 135 CommentTotal: comment.CommentTotal,
136 } 136 }
137 - if exists, _ = repository.ChanceFavorite.ExitsChanceFavorite(header.Uid, header.CompanyId, comment.Id, protocol.MarkFlag_Zan); exists { 137 + if exists, _ = repository.ChanceFavorite.ExitsChanceFavorite(header.UserId, header.CompanyId, comment.Id, protocol.MarkFlag_Zan); exists {
138 item.IsZan = 1 138 item.IsZan = 1
139 } 139 }
140 rsp.Comments = append(rsp.Comments, item) 140 rsp.Comments = append(rsp.Comments, item)
@@ -167,7 +167,7 @@ func CommentDetailsSingle(header *protocol.RequestHeader, request *protocol.Comm @@ -167,7 +167,7 @@ func CommentDetailsSingle(header *protocol.RequestHeader, request *protocol.Comm
167 ZanTotal: comment.ZanTotal, 167 ZanTotal: comment.ZanTotal,
168 CommentTotal: comment.CommentTotal, 168 CommentTotal: comment.CommentTotal,
169 } 169 }
170 - if exists, _ = repository.ChanceFavorite.ExitsChanceFavorite(header.Uid, header.CompanyId, comment.Id, protocol.MarkFlag_Zan); exists { 170 + if exists, _ = repository.ChanceFavorite.ExitsChanceFavorite(header.UserId, header.CompanyId, comment.Id, protocol.MarkFlag_Zan); exists {
171 rsp.Comment.IsZan = 1 171 rsp.Comment.IsZan = 1
172 } 172 }
173 return 173 return
@@ -183,15 +183,15 @@ func UserCompanys(header *protocol.RequestHeader, request *protocol.UserCompanys @@ -183,15 +183,15 @@ func UserCompanys(header *protocol.RequestHeader, request *protocol.UserCompanys
183 companys []*models.Company 183 companys []*models.Company
184 ) 184 )
185 rsp = &protocol.UserCompanysResponse{} 185 rsp = &protocol.UserCompanysResponse{}
186 - if companys,err =models.GetCompanyByPermission(header.Uid);err!=nil{ 186 + if companys, err = models.GetCompanyByPermission(header.Uid); err != nil {
187 log.Error(err) 187 log.Error(err)
188 err = protocol.NewErrWithMessage(4201) //找不到这家公司 188 err = protocol.NewErrWithMessage(4201) //找不到这家公司
189 return 189 return
190 } 190 }
191 - for i:=range companys{  
192 - rsp.Companys =append(rsp.Companys,protocol.Company{  
193 - Id:companys[i].Id,  
194 - Name:companys[i].Name, 191 + for i := range companys {
  192 + rsp.Companys = append(rsp.Companys, protocol.Company{
  193 + Id: companys[i].Id,
  194 + Name: companys[i].Name,
195 }) 195 })
196 } 196 }
197 return 197 return
@@ -213,11 +213,11 @@ func SwitchCompany(header *protocol.RequestHeader, request *protocol.SwitchCompa @@ -213,11 +213,11 @@ func SwitchCompany(header *protocol.RequestHeader, request *protocol.SwitchCompa
213 log.Error(err) 213 log.Error(err)
214 return 214 return
215 } 215 }
216 - if auth.CurrentCompanyId == request.CompanyId{  
217 - log.Error(fmt.Sprintf("uid:%v 当前公司已经是:%v",header.Uid,request.CompanyId)) 216 + if auth.CurrentCompanyId == request.CompanyId {
  217 + log.Error(fmt.Sprintf("uid:%v 当前公司已经是:%v", header.Uid, request.CompanyId))
218 return 218 return
219 } 219 }
220 - if err = utils.UpdateTableByMap(&models.UserAuth{Id: auth.Id}, map[string]interface{}{"CurrentCompanyId": company.CompanyId}); err != nil { 220 + if err = utils.UpdateTableByMap(&models.UserAuth{Id: auth.Id}, map[string]interface{}{"CurrentCompanyId": company.CompanyId, "CurrentCompanyUserId": company.Id}); err != nil {
221 log.Error(err) 221 log.Error(err)
222 return 222 return
223 } 223 }
@@ -227,15 +227,15 @@ func SwitchCompany(header *protocol.RequestHeader, request *protocol.SwitchCompa @@ -227,15 +227,15 @@ func SwitchCompany(header *protocol.RequestHeader, request *protocol.SwitchCompa
227 //用户信息 227 //用户信息
228 func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) (rsp *protocol.UserInfoResponse, err error) { 228 func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) (rsp *protocol.UserInfoResponse, err error) {
229 var ( 229 var (
230 - companyId = header.CompanyId  
231 - company *models.UserCompany  
232 - baseInfo *protocol.BaseUserInfo  
233 - userAuth *models.UserAuth  
234 - user *models.User 230 + companyId = header.CompanyId
  231 + userCompany *models.UserCompany
  232 + baseInfo *protocol.BaseUserInfo
  233 + userAuth *models.UserAuth
  234 + user *models.User
235 ) 235 )
236 236
237 if companyId == 0 { 237 if companyId == 0 {
238 - if company, err = models.GetUserCompanyFirst(header.Uid); err != nil { 238 + if userCompany, err = models.GetUserCompanyFirst(header.Uid); err != nil {
239 log.Error(err) 239 log.Error(err)
240 return 240 return
241 } 241 }
@@ -243,17 +243,17 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) @@ -243,17 +243,17 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest)
243 log.Error(err) 243 log.Error(err)
244 return 244 return
245 } 245 }
246 - if err = utils.UpdateTableByMap(&models.UserAuth{Id: userAuth.Id}, map[string]interface{}{"CurrentCompanyId": companyId}); err != nil { 246 + if err = utils.UpdateTableByMap(&models.UserAuth{Id: userAuth.Id}, map[string]interface{}{"CurrentCompanyId": userCompany.CompanyId, "CurrentUserCompanyId": userCompany.Id}); err != nil {
247 log.Error(err) 247 log.Error(err)
248 return 248 return
249 } 249 }
250 - companyId = int64(company.Id) 250 + companyId = int64(userCompany.CompanyId)
251 } 251 }
252 if user, err = models.GetUsersById(header.Uid); err != nil { 252 if user, err = models.GetUsersById(header.Uid); err != nil {
253 log.Error(err) 253 log.Error(err)
254 return 254 return
255 } 255 }
256 - if baseInfo, err = agg.GetUserBaseInfo(header.Uid, companyId); err != nil { 256 + if baseInfo, err = agg.GetUserBaseInfo(header.UserId, companyId); err != nil {
257 log.Error(err) 257 log.Error(err)
258 return 258 return
259 } 259 }