正在显示
26 个修改的文件
包含
303 行增加
和
297 行删除
@@ -54,22 +54,22 @@ func (c AchievementController) AddAchievement() { | @@ -54,22 +54,22 @@ func (c AchievementController) AddAchievement() { | ||
54 | } | 54 | } |
55 | if len(param.ChanceData) == 0 { | 55 | if len(param.ChanceData) == 0 { |
56 | log.Error("len(param.ChanceData) == 0 ") | 56 | log.Error("len(param.ChanceData) == 0 ") |
57 | - msg = protocol.BadRequestParam("10109") | 57 | + msg = protocol.BadRequestParam("11102") |
58 | return | 58 | return |
59 | } | 59 | } |
60 | if param.ChanceTypeId == 0 { | 60 | if param.ChanceTypeId == 0 { |
61 | log.Error(" param.ChanceTypeId == 0 ") | 61 | log.Error(" param.ChanceTypeId == 0 ") |
62 | - msg = protocol.BadRequestParam("10108") | 62 | + msg = protocol.BadRequestParam("11101") |
63 | return | 63 | return |
64 | } | 64 | } |
65 | if param.GraspScore < 0 || param.GraspScore > 100 { | 65 | if param.GraspScore < 0 || param.GraspScore > 100 { |
66 | log.Error(" param.GraspScore < 0 || param.GraspScore > 100 ") | 66 | log.Error(" param.GraspScore < 0 || param.GraspScore > 100 ") |
67 | - msg = protocol.BadRequestParam("10121") | 67 | + msg = protocol.BadRequestParam("11104") |
68 | return | 68 | return |
69 | } | 69 | } |
70 | if param.UserGraspScore < 0 || param.UserGraspScore > 100 { | 70 | if param.UserGraspScore < 0 || param.UserGraspScore > 100 { |
71 | log.Error("param.UserGraspScore < 0 || param.UserGraspScore > 100") | 71 | log.Error("param.UserGraspScore < 0 || param.UserGraspScore > 100") |
72 | - msg = protocol.BadRequestParam("10122") | 72 | + msg = protocol.BadRequestParam("11105") |
73 | } | 73 | } |
74 | var providerScore float64 | 74 | var providerScore float64 |
75 | for _, v := range param.Provider { | 75 | for _, v := range param.Provider { |
@@ -78,7 +78,7 @@ func (c AchievementController) AddAchievement() { | @@ -78,7 +78,7 @@ func (c AchievementController) AddAchievement() { | ||
78 | remainScore := param.GraspScore - param.UserGraspScore - providerScore | 78 | remainScore := param.GraspScore - param.UserGraspScore - providerScore |
79 | if remainScore < 0 { | 79 | if remainScore < 0 { |
80 | log.Error("分配的总分不可大于把握分") | 80 | log.Error("分配的总分不可大于把握分") |
81 | - msg = protocol.BadRequestParam("10122") | 81 | + msg = protocol.BadRequestParam("11105") |
82 | return | 82 | return |
83 | } | 83 | } |
84 | 84 | ||
@@ -103,22 +103,22 @@ func (c AchievementController) EditAchievement() { | @@ -103,22 +103,22 @@ func (c AchievementController) EditAchievement() { | ||
103 | } | 103 | } |
104 | if len(param.ChanceData) == 0 { | 104 | if len(param.ChanceData) == 0 { |
105 | log.Error("len(param.ChanceData) == 0 ") | 105 | log.Error("len(param.ChanceData) == 0 ") |
106 | - msg = protocol.BadRequestParam("10109") | 106 | + msg = protocol.BadRequestParam("11102") |
107 | return | 107 | return |
108 | } | 108 | } |
109 | if param.ChanceTypeId == 0 { | 109 | if param.ChanceTypeId == 0 { |
110 | log.Error(" param.ChanceTypeId == 0 ") | 110 | log.Error(" param.ChanceTypeId == 0 ") |
111 | - msg = protocol.BadRequestParam("10108") | 111 | + msg = protocol.BadRequestParam("11101") |
112 | return | 112 | return |
113 | } | 113 | } |
114 | if param.GraspScore < 0 || param.GraspScore > 100 { | 114 | if param.GraspScore < 0 || param.GraspScore > 100 { |
115 | log.Error(" param.GraspScore < 0 || param.GraspScore > 100 ") | 115 | log.Error(" param.GraspScore < 0 || param.GraspScore > 100 ") |
116 | - msg = protocol.BadRequestParam("10121") | 116 | + msg = protocol.BadRequestParam("11104") |
117 | return | 117 | return |
118 | } | 118 | } |
119 | if param.UserGraspScore < 0 || param.UserGraspScore > 100 { | 119 | if param.UserGraspScore < 0 || param.UserGraspScore > 100 { |
120 | log.Error("param.UserGraspScore < 0 || param.UserGraspScore > 100") | 120 | log.Error("param.UserGraspScore < 0 || param.UserGraspScore > 100") |
121 | - msg = protocol.BadRequestParam("10122") | 121 | + msg = protocol.BadRequestParam("11105") |
122 | } | 122 | } |
123 | var providerScore float64 | 123 | var providerScore float64 |
124 | for _, v := range param.Provider { | 124 | for _, v := range param.Provider { |
@@ -127,7 +127,7 @@ func (c AchievementController) EditAchievement() { | @@ -127,7 +127,7 @@ func (c AchievementController) EditAchievement() { | ||
127 | remainScore := param.GraspScore - param.UserGraspScore - providerScore | 127 | remainScore := param.GraspScore - param.UserGraspScore - providerScore |
128 | if remainScore < 0 { | 128 | if remainScore < 0 { |
129 | log.Error("分配的总分不可大于把握分") | 129 | log.Error("分配的总分不可大于把握分") |
130 | - msg = protocol.BadRequestParam("10122") | 130 | + msg = protocol.BadRequestParam("11105") |
131 | return | 131 | return |
132 | } | 132 | } |
133 | companyid := c.GetCompanyId() | 133 | companyid := c.GetCompanyId() |
@@ -292,11 +292,11 @@ func (c *AuditController) EditReserveType() { | @@ -292,11 +292,11 @@ func (c *AuditController) EditReserveType() { | ||
292 | } | 292 | } |
293 | nameRune := []rune(param.Name) | 293 | nameRune := []rune(param.Name) |
294 | if len(nameRune) == 0 { | 294 | if len(nameRune) == 0 { |
295 | - msg = protocol.BadRequestParam("10133") | 295 | + msg = protocol.BadRequestParam("11112") |
296 | return | 296 | return |
297 | } | 297 | } |
298 | if len(nameRune) > 20 { | 298 | if len(nameRune) > 20 { |
299 | - msg = protocol.BadRequestParam("10134") | 299 | + msg = protocol.BadRequestParam("11113") |
300 | return | 300 | return |
301 | } | 301 | } |
302 | companyId := c.GetCompanyId() | 302 | companyId := c.GetCompanyId() |
@@ -61,7 +61,7 @@ func (c *AuthController) Login() { | @@ -61,7 +61,7 @@ func (c *AuthController) Login() { | ||
61 | return | 61 | return |
62 | } | 62 | } |
63 | if len(param.Account) == 0 || len(param.Password) == 0 { | 63 | if len(param.Account) == 0 || len(param.Password) == 0 { |
64 | - msg = protocol.BadRequestParam("10021") | 64 | + msg = protocol.BadRequestParam("10201") |
65 | return | 65 | return |
66 | } | 66 | } |
67 | logintoken, err := serveauth.LoginAuthByUCenter(param.Account, param.Password) | 67 | logintoken, err := serveauth.LoginAuthByUCenter(param.Account, param.Password) |
@@ -99,7 +99,7 @@ func (c *AuthController) LoginSms() { | @@ -99,7 +99,7 @@ func (c *AuthController) LoginSms() { | ||
99 | return | 99 | return |
100 | } | 100 | } |
101 | if len(param.Account) == 0 || len(param.Code) == 0 { | 101 | if len(param.Account) == 0 || len(param.Code) == 0 { |
102 | - msg = protocol.BadRequestParam("10021") | 102 | + msg = protocol.BadRequestParam("10201") |
103 | return | 103 | return |
104 | } | 104 | } |
105 | var uclientReturn *ucenter.ResponseLoginSms | 105 | var uclientReturn *ucenter.ResponseLoginSms |
@@ -112,7 +112,7 @@ func (c *AuthController) LoginSms() { | @@ -112,7 +112,7 @@ func (c *AuthController) LoginSms() { | ||
112 | Data: protocol.NullData, | 112 | Data: protocol.NullData, |
113 | } | 113 | } |
114 | } else { | 114 | } else { |
115 | - msg = protocol.NewMessage("10028") | 115 | + msg = protocol.NewMessage("10208") |
116 | } | 116 | } |
117 | return | 117 | return |
118 | } | 118 | } |
@@ -151,7 +151,7 @@ func (c *AuthController) LoginSecretKey() { | @@ -151,7 +151,7 @@ func (c *AuthController) LoginSecretKey() { | ||
151 | return | 151 | return |
152 | } | 152 | } |
153 | if len(param.Secret) == 0 { | 153 | if len(param.Secret) == 0 { |
154 | - msg = protocol.BadRequestParam("10080") | 154 | + msg = protocol.BadRequestParam("10210") |
155 | return | 155 | return |
156 | } | 156 | } |
157 | logintoken, err := serveauth.LoginAuthBySecretKey(param.Secret) | 157 | logintoken, err := serveauth.LoginAuthBySecretKey(param.Secret) |
@@ -36,7 +36,7 @@ func (this *BaseController) Prepare() { | @@ -36,7 +36,7 @@ func (this *BaseController) Prepare() { | ||
36 | companyid := this.GetCompanyId() | 36 | companyid := this.GetCompanyId() |
37 | ok := serveauth.ValidUserPermission(p, userid, companyid) | 37 | ok := serveauth.ValidUserPermission(p, userid, companyid) |
38 | if !ok { | 38 | if !ok { |
39 | - msg := protocol.NewMessage("10080") | 39 | + msg := protocol.NewMessage("10210") |
40 | this.ResposeJson(msg) | 40 | this.ResposeJson(msg) |
41 | return | 41 | return |
42 | } | 42 | } |
@@ -42,7 +42,7 @@ func (this *BulletinController) BulletinRelease() { | @@ -42,7 +42,7 @@ func (this *BulletinController) BulletinRelease() { | ||
42 | return | 42 | return |
43 | } | 43 | } |
44 | if len([]rune(request.Title)) > 30 { | 44 | if len([]rune(request.Title)) > 30 { |
45 | - msg = protocol.BadRequestParam("10278") | 45 | + msg = protocol.BadRequestParam("10618") |
46 | return | 46 | return |
47 | } | 47 | } |
48 | rsp, err := bulletin.BulletinRelease(uid, companyId, request) | 48 | rsp, err := bulletin.BulletinRelease(uid, companyId, request) |
@@ -55,11 +55,11 @@ func (c *CompanyController) DepartmentAdd() { | @@ -55,11 +55,11 @@ func (c *CompanyController) DepartmentAdd() { | ||
55 | } | 55 | } |
56 | s := []rune(param.Name) | 56 | s := []rune(param.Name) |
57 | if len(s) == 0 { | 57 | if len(s) == 0 { |
58 | - msg = protocol.BadRequestParam("10044") | 58 | + msg = protocol.BadRequestParam("10403") |
59 | return | 59 | return |
60 | } | 60 | } |
61 | if len(s) > 20 { | 61 | if len(s) > 20 { |
62 | - msg = protocol.BadRequestParam("10043") | 62 | + msg = protocol.BadRequestParam("10402") |
63 | return | 63 | return |
64 | } | 64 | } |
65 | 65 | ||
@@ -90,16 +90,16 @@ func (c *CompanyController) DepartmentUpdate() { | @@ -90,16 +90,16 @@ func (c *CompanyController) DepartmentUpdate() { | ||
90 | } | 90 | } |
91 | s := []rune(param.Name) | 91 | s := []rune(param.Name) |
92 | if len(s) == 0 { | 92 | if len(s) == 0 { |
93 | - msg = protocol.BadRequestParam("10044") | 93 | + msg = protocol.BadRequestParam("10403") |
94 | return | 94 | return |
95 | } | 95 | } |
96 | if len(s) > 20 { | 96 | if len(s) > 20 { |
97 | - msg = protocol.BadRequestParam("10043") | 97 | + msg = protocol.BadRequestParam("10402") |
98 | return | 98 | return |
99 | } | 99 | } |
100 | // if param.ParentID <= 0 { | 100 | // if param.ParentID <= 0 { |
101 | // //部门必定有上级部门 ,至少是公司一级 | 101 | // //部门必定有上级部门 ,至少是公司一级 |
102 | - // msg = protocol.BadRequestParam("10042") | 102 | + // msg = protocol.BadRequestParam("10401") |
103 | // return | 103 | // return |
104 | // } | 104 | // } |
105 | param.CompanyID = c.GetCompanyId() | 105 | param.CompanyID = c.GetCompanyId() |
@@ -170,7 +170,7 @@ func (c *CompanyController) PositionAdd() { | @@ -170,7 +170,7 @@ func (c *CompanyController) PositionAdd() { | ||
170 | } | 170 | } |
171 | n := []rune(param.Name) | 171 | n := []rune(param.Name) |
172 | if len(n) > 10 || len(n) == 0 { | 172 | if len(n) > 10 || len(n) == 0 { |
173 | - msg = protocol.BadRequestParam("10014") | 173 | + msg = protocol.BadRequestParam("10104") |
174 | return | 174 | return |
175 | } | 175 | } |
176 | param.CompanyID = c.GetCompanyId() | 176 | param.CompanyID = c.GetCompanyId() |
@@ -194,7 +194,7 @@ func (c *CompanyController) PositionEdit() { | @@ -194,7 +194,7 @@ func (c *CompanyController) PositionEdit() { | ||
194 | } | 194 | } |
195 | n := []rune(param.Name) | 195 | n := []rune(param.Name) |
196 | if len(n) > 10 || len(n) == 0 { | 196 | if len(n) > 10 || len(n) == 0 { |
197 | - msg = protocol.BadRequestParam("10014") | 197 | + msg = protocol.BadRequestParam("10104") |
198 | return | 198 | return |
199 | } | 199 | } |
200 | param.CompanyID = c.GetCompanyId() | 200 | param.CompanyID = c.GetCompanyId() |
@@ -261,24 +261,24 @@ func (c *CompanyController) PositionList() { | @@ -261,24 +261,24 @@ func (c *CompanyController) PositionList() { | ||
261 | // } | 261 | // } |
262 | // name := []rune(strings.TrimSpace(param.Name)) | 262 | // name := []rune(strings.TrimSpace(param.Name)) |
263 | // if len(name) == 0 { | 263 | // if len(name) == 0 { |
264 | -// msg = protocol.BadRequestParam("10035") | 264 | +// msg = protocol.BadRequestParam("10305") |
265 | // return | 265 | // return |
266 | // } | 266 | // } |
267 | // if len(name) > 10 { | 267 | // if len(name) > 10 { |
268 | -// msg = protocol.BadRequestParam("10034") | 268 | +// msg = protocol.BadRequestParam("10304") |
269 | // return | 269 | // return |
270 | // } | 270 | // } |
271 | // ok := utils.PhoneMatch.MatchString(param.Phone) | 271 | // ok := utils.PhoneMatch.MatchString(param.Phone) |
272 | // if !ok { | 272 | // if !ok { |
273 | -// msg = protocol.BadRequestParam("10036") | 273 | +// msg = protocol.BadRequestParam("10306") |
274 | // return | 274 | // return |
275 | // } | 275 | // } |
276 | // if len(param.Departments) == 0 { | 276 | // if len(param.Departments) == 0 { |
277 | -// msg = protocol.BadRequestParam("10037") | 277 | +// msg = protocol.BadRequestParam("10307") |
278 | // return | 278 | // return |
279 | // } | 279 | // } |
280 | // if len(param.Roles) == 0 { | 280 | // if len(param.Roles) == 0 { |
281 | -// msg = protocol.BadRequestParam("10038") | 281 | +// msg = protocol.BadRequestParam("10308") |
282 | // return | 282 | // return |
283 | // } | 283 | // } |
284 | // param.CompanyId = c.GetCompanyId() | 284 | // param.CompanyId = c.GetCompanyId() |
@@ -302,20 +302,20 @@ func (c *CompanyController) UserEdit() { | @@ -302,20 +302,20 @@ func (c *CompanyController) UserEdit() { | ||
302 | } | 302 | } |
303 | // name := []rune(strings.TrimSpace(param.Name)) | 303 | // name := []rune(strings.TrimSpace(param.Name)) |
304 | // if len(name) == 0 { | 304 | // if len(name) == 0 { |
305 | - // msg = protocol.BadRequestParam("10035") | 305 | + // msg = protocol.BadRequestParam("10305") |
306 | // return | 306 | // return |
307 | // } | 307 | // } |
308 | // if len(name) > 10 { | 308 | // if len(name) > 10 { |
309 | - // msg = protocol.BadRequestParam("10034") | 309 | + // msg = protocol.BadRequestParam("10304") |
310 | // return | 310 | // return |
311 | // } | 311 | // } |
312 | 312 | ||
313 | // if len(param.Departments) == 0 { | 313 | // if len(param.Departments) == 0 { |
314 | - // msg = protocol.BadRequestParam("10037") | 314 | + // msg = protocol.BadRequestParam("10307") |
315 | // return | 315 | // return |
316 | // } | 316 | // } |
317 | if len(param.Roles) == 0 { | 317 | if len(param.Roles) == 0 { |
318 | - msg = protocol.BadRequestParam("10038") | 318 | + msg = protocol.BadRequestParam("10308") |
319 | return | 319 | return |
320 | } | 320 | } |
321 | param.CompanyId = c.GetCompanyId() | 321 | param.CompanyId = c.GetCompanyId() |
@@ -48,7 +48,7 @@ func (c RankController) EditRankType() { | @@ -48,7 +48,7 @@ func (c RankController) EditRankType() { | ||
48 | param.Name = strings.TrimSpace(param.Name) | 48 | param.Name = strings.TrimSpace(param.Name) |
49 | n := []rune(param.Name) | 49 | n := []rune(param.Name) |
50 | if len(n) > 5 || len(n) == 0 { | 50 | if len(n) > 5 || len(n) == 0 { |
51 | - msg = protocol.BadRequestParam("10103") | 51 | + msg = protocol.BadRequestParam("11003") |
52 | return | 52 | return |
53 | } | 53 | } |
54 | companyid := c.GetCompanyId() | 54 | companyid := c.GetCompanyId() |
@@ -132,17 +132,17 @@ func (c RankController) RankSeasonAdd() { | @@ -132,17 +132,17 @@ func (c RankController) RankSeasonAdd() { | ||
132 | } | 132 | } |
133 | param.Name = strings.TrimSpace(param.Name) | 133 | param.Name = strings.TrimSpace(param.Name) |
134 | if len(param.Name) == 0 { | 134 | if len(param.Name) == 0 { |
135 | - msg = protocol.BadRequestParam("10104") | 135 | + msg = protocol.BadRequestParam("11004") |
136 | return | 136 | return |
137 | } | 137 | } |
138 | param.BeginTime = strings.TrimSpace(param.BeginTime) | 138 | param.BeginTime = strings.TrimSpace(param.BeginTime) |
139 | if len(param.BeginTime) == 0 { | 139 | if len(param.BeginTime) == 0 { |
140 | - msg = protocol.BadRequestParam("10105") | 140 | + msg = protocol.BadRequestParam("11005") |
141 | return | 141 | return |
142 | } | 142 | } |
143 | param.EndTime = strings.TrimSpace(param.EndTime) | 143 | param.EndTime = strings.TrimSpace(param.EndTime) |
144 | if len(param.EndTime) == 0 { | 144 | if len(param.EndTime) == 0 { |
145 | - msg = protocol.BadRequestParam("10106") | 145 | + msg = protocol.BadRequestParam("11006") |
146 | return | 146 | return |
147 | } | 147 | } |
148 | var ( | 148 | var ( |
@@ -151,13 +151,13 @@ func (c RankController) RankSeasonAdd() { | @@ -151,13 +151,13 @@ func (c RankController) RankSeasonAdd() { | ||
151 | ) | 151 | ) |
152 | t1, err := time.ParseInLocation("2006-01-02", param.BeginTime, time.Local) | 152 | t1, err := time.ParseInLocation("2006-01-02", param.BeginTime, time.Local) |
153 | if err != nil { | 153 | if err != nil { |
154 | - msg = protocol.BadRequestParam("10105") | 154 | + msg = protocol.BadRequestParam("11005") |
155 | return | 155 | return |
156 | } | 156 | } |
157 | beginTime = t1.Unix() | 157 | beginTime = t1.Unix() |
158 | t2, err := time.ParseInLocation("2006-01-02", param.EndTime, time.Local) | 158 | t2, err := time.ParseInLocation("2006-01-02", param.EndTime, time.Local) |
159 | if err != nil { | 159 | if err != nil { |
160 | - msg = protocol.BadRequestParam("10106") | 160 | + msg = protocol.BadRequestParam("11006") |
161 | return | 161 | return |
162 | } | 162 | } |
163 | endTime = t2.Unix() + 86399 //60*60*24-1 | 163 | endTime = t2.Unix() + 86399 //60*60*24-1 |
@@ -167,7 +167,7 @@ func (c RankController) RankSeasonAdd() { | @@ -167,7 +167,7 @@ func (c RankController) RankSeasonAdd() { | ||
167 | } | 167 | } |
168 | ok := serverank.RankPeriodCheckTime(param.RankTypeId, beginTime, endTime, 0) | 168 | ok := serverank.RankPeriodCheckTime(param.RankTypeId, beginTime, endTime, 0) |
169 | if !ok { | 169 | if !ok { |
170 | - msg = protocol.BadRequestParam("10101") | 170 | + msg = protocol.BadRequestParam("11001") |
171 | return | 171 | return |
172 | } | 172 | } |
173 | companyid := c.GetCompanyId() | 173 | companyid := c.GetCompanyId() |
@@ -203,12 +203,12 @@ func (c RankController) RankSeasonEdit() { | @@ -203,12 +203,12 @@ func (c RankController) RankSeasonEdit() { | ||
203 | } | 203 | } |
204 | param.BeginTime = strings.TrimSpace(param.BeginTime) | 204 | param.BeginTime = strings.TrimSpace(param.BeginTime) |
205 | if len(param.BeginTime) == 0 { | 205 | if len(param.BeginTime) == 0 { |
206 | - msg = protocol.BadRequestParam("10105") | 206 | + msg = protocol.BadRequestParam("11005") |
207 | return | 207 | return |
208 | } | 208 | } |
209 | param.EndTime = strings.TrimSpace(param.EndTime) | 209 | param.EndTime = strings.TrimSpace(param.EndTime) |
210 | if len(param.EndTime) == 0 { | 210 | if len(param.EndTime) == 0 { |
211 | - msg = protocol.BadRequestParam("10106") | 211 | + msg = protocol.BadRequestParam("11006") |
212 | return | 212 | return |
213 | } | 213 | } |
214 | var ( | 214 | var ( |
@@ -218,14 +218,14 @@ func (c RankController) RankSeasonEdit() { | @@ -218,14 +218,14 @@ func (c RankController) RankSeasonEdit() { | ||
218 | t1, err := time.ParseInLocation("2006-01-02", param.BeginTime, time.Local) | 218 | t1, err := time.ParseInLocation("2006-01-02", param.BeginTime, time.Local) |
219 | if err != nil { | 219 | if err != nil { |
220 | log.Error(err.Error()) | 220 | log.Error(err.Error()) |
221 | - msg = protocol.BadRequestParam("10105") | 221 | + msg = protocol.BadRequestParam("11005") |
222 | return | 222 | return |
223 | } | 223 | } |
224 | beginTime = t1.Unix() | 224 | beginTime = t1.Unix() |
225 | t2, err := time.ParseInLocation("2006-01-02", param.EndTime, time.Local) | 225 | t2, err := time.ParseInLocation("2006-01-02", param.EndTime, time.Local) |
226 | if err != nil { | 226 | if err != nil { |
227 | log.Error(err.Error()) | 227 | log.Error(err.Error()) |
228 | - msg = protocol.BadRequestParam("10106") | 228 | + msg = protocol.BadRequestParam("11006") |
229 | return | 229 | return |
230 | } | 230 | } |
231 | 231 | ||
@@ -236,7 +236,7 @@ func (c RankController) RankSeasonEdit() { | @@ -236,7 +236,7 @@ func (c RankController) RankSeasonEdit() { | ||
236 | } | 236 | } |
237 | ok := serverank.RankPeriodCheckTime(param.RankTypeId, beginTime, endTime, param.Id) | 237 | ok := serverank.RankPeriodCheckTime(param.RankTypeId, beginTime, endTime, param.Id) |
238 | if !ok { | 238 | if !ok { |
239 | - msg = protocol.BadRequestParam("10101") | 239 | + msg = protocol.BadRequestParam("11001") |
240 | return | 240 | return |
241 | } | 241 | } |
242 | companyid := c.GetCompanyId() | 242 | companyid := c.GetCompanyId() |
@@ -290,12 +290,12 @@ func (c RankController) RankRangeAdd() { | @@ -290,12 +290,12 @@ func (c RankController) RankRangeAdd() { | ||
290 | param.Name = strings.TrimSpace(param.Name) | 290 | param.Name = strings.TrimSpace(param.Name) |
291 | n := []rune(param.Name) | 291 | n := []rune(param.Name) |
292 | if len(n) == 0 || len(n) > 5 { | 292 | if len(n) == 0 || len(n) > 5 { |
293 | - msg = protocol.BadRequestParam("10107") | 293 | + msg = protocol.BadRequestParam("11007") |
294 | return | 294 | return |
295 | } | 295 | } |
296 | ok := serverank.RankRangeNameOnlyOne(param.RankTypeId, 0, param.Name) | 296 | ok := serverank.RankRangeNameOnlyOne(param.RankTypeId, 0, param.Name) |
297 | if !ok { | 297 | if !ok { |
298 | - msg = protocol.BadRequestParam("10125") | 298 | + msg = protocol.BadRequestParam("11009") |
299 | return | 299 | return |
300 | } | 300 | } |
301 | switch param.RangeType { | 301 | switch param.RangeType { |
@@ -339,7 +339,7 @@ func (c RankController) RankRangeEdit() { | @@ -339,7 +339,7 @@ func (c RankController) RankRangeEdit() { | ||
339 | param.Name = strings.TrimSpace(param.Name) | 339 | param.Name = strings.TrimSpace(param.Name) |
340 | n := []rune(param.Name) | 340 | n := []rune(param.Name) |
341 | if len(n) == 0 || len(n) > 5 { | 341 | if len(n) == 0 || len(n) > 5 { |
342 | - msg = protocol.BadRequestParam("10107") | 342 | + msg = protocol.BadRequestParam("11007") |
343 | return | 343 | return |
344 | } | 344 | } |
345 | 345 | ||
@@ -488,7 +488,7 @@ func (c RankController) RankItemEdit() { | @@ -488,7 +488,7 @@ func (c RankController) RankItemEdit() { | ||
488 | return | 488 | return |
489 | } | 489 | } |
490 | if len(param.ItemKey) > 4 { | 490 | if len(param.ItemKey) > 4 { |
491 | - msg = protocol.BadRequestParam("10123") | 491 | + msg = protocol.BadRequestParam("11008") |
492 | return | 492 | return |
493 | } | 493 | } |
494 | companyid := c.GetCompanyId() | 494 | companyid := c.GetCompanyId() |
@@ -517,7 +517,7 @@ func (c RankController) RankRangeMove() { | @@ -517,7 +517,7 @@ func (c RankController) RankRangeMove() { | ||
517 | } | 517 | } |
518 | companyid := c.GetCompanyId() | 518 | companyid := c.GetCompanyId() |
519 | if len(param.RelationId) == 0 { | 519 | if len(param.RelationId) == 0 { |
520 | - msg = protocol.BadRequestParam("10126") | 520 | + msg = protocol.BadRequestParam("11010") |
521 | return | 521 | return |
522 | } | 522 | } |
523 | err := serverank.RankRangeMove(param.FromId, param.ToId, param.RelationId, companyid) | 523 | err := serverank.RankRangeMove(param.FromId, param.ToId, param.RelationId, companyid) |
@@ -40,22 +40,22 @@ func (this *TemplateController) TemplateAdd() { | @@ -40,22 +40,22 @@ func (this *TemplateController) TemplateAdd() { | ||
40 | return | 40 | return |
41 | } | 41 | } |
42 | if len([]rune(request.Template.Name)) > 30 { | 42 | if len([]rune(request.Template.Name)) > 30 { |
43 | - msg = protocol.BadRequestParam("10070") | 43 | + msg = protocol.BadRequestParam("10610") |
44 | return | 44 | return |
45 | } | 45 | } |
46 | if len([]rune(request.Template.Doc)) > 30 { | 46 | if len([]rune(request.Template.Doc)) > 30 { |
47 | - msg = protocol.BadRequestParam("10272") | 47 | + msg = protocol.BadRequestParam("10612") |
48 | return | 48 | return |
49 | } | 49 | } |
50 | { | 50 | { |
51 | //审批人配置 | 51 | //审批人配置 |
52 | v := request.AuditFlowConfig.NoApprover | 52 | v := request.AuditFlowConfig.NoApprover |
53 | if !(v == models.NoApproverPass || v == models.NoApproverToAdmin) { | 53 | if !(v == models.NoApproverPass || v == models.NoApproverToAdmin) { |
54 | - msg = protocol.BadRequestParam("10068") | 54 | + msg = protocol.BadRequestParam("10608") |
55 | return | 55 | return |
56 | } | 56 | } |
57 | if len(request.AuditFlowConfig.ProcessConfig) == 0 { | 57 | if len(request.AuditFlowConfig.ProcessConfig) == 0 { |
58 | - msg = protocol.BadRequestParam("10069") | 58 | + msg = protocol.BadRequestParam("10609") |
59 | return | 59 | return |
60 | } | 60 | } |
61 | } | 61 | } |
@@ -116,11 +116,11 @@ func (this *TemplateController) TemplateUpdate() { | @@ -116,11 +116,11 @@ func (this *TemplateController) TemplateUpdate() { | ||
116 | return | 116 | return |
117 | } | 117 | } |
118 | if len([]rune(request.Template.Name)) > 30 { | 118 | if len([]rune(request.Template.Name)) > 30 { |
119 | - msg = protocol.BadRequestParam("10070") | 119 | + msg = protocol.BadRequestParam("10610") |
120 | return | 120 | return |
121 | } | 121 | } |
122 | if len([]rune(request.Template.Doc)) > 30 { | 122 | if len([]rune(request.Template.Doc)) > 30 { |
123 | - msg = protocol.BadRequestParam("10272") | 123 | + msg = protocol.BadRequestParam("10612") |
124 | return | 124 | return |
125 | } | 125 | } |
126 | { | 126 | { |
@@ -304,7 +304,7 @@ func (this *TemplateController) TemplateOperateCategory() { | @@ -304,7 +304,7 @@ func (this *TemplateController) TemplateOperateCategory() { | ||
304 | return | 304 | return |
305 | } | 305 | } |
306 | if len([]rune(request.Name)) > 10 { | 306 | if len([]rune(request.Name)) > 10 { |
307 | - msg = protocol.BadRequestParam("10070") | 307 | + msg = protocol.BadRequestParam("10610") |
308 | return | 308 | return |
309 | } | 309 | } |
310 | rsp, err := audit.TemplateOperateCategory(uid, companyId, request) | 310 | rsp, err := audit.TemplateOperateCategory(uid, companyId, request) |
@@ -448,10 +448,10 @@ func checkSelfCheckData(data []protocol.TemplateSelfCheck) error { | @@ -448,10 +448,10 @@ func checkSelfCheckData(data []protocol.TemplateSelfCheck) error { | ||
448 | for i, v := range data { | 448 | for i, v := range data { |
449 | s := []rune(v.Title) | 449 | s := []rune(v.Title) |
450 | if len(s) == 0 || len(s) > 50 { | 450 | if len(s) == 0 || len(s) > 50 { |
451 | - return protocol.NewErrWithMessage("10127") | 451 | + return protocol.NewErrWithMessage("11106") |
452 | } | 452 | } |
453 | if _, ok := titleMap[v.Title]; ok { | 453 | if _, ok := titleMap[v.Title]; ok { |
454 | - return protocol.NewErrWithMessage("10130") | 454 | + return protocol.NewErrWithMessage("11109") |
455 | } else { | 455 | } else { |
456 | titleMap[v.Title] = 1 | 456 | titleMap[v.Title] = 1 |
457 | } | 457 | } |
@@ -460,10 +460,10 @@ func checkSelfCheckData(data []protocol.TemplateSelfCheck) error { | @@ -460,10 +460,10 @@ func checkSelfCheckData(data []protocol.TemplateSelfCheck) error { | ||
460 | for _, vv := range data[i].Child { | 460 | for _, vv := range data[i].Child { |
461 | ss := []rune(vv.Title) | 461 | ss := []rune(vv.Title) |
462 | if len(ss) == 0 || len(ss) > 50 { | 462 | if len(ss) == 0 || len(ss) > 50 { |
463 | - return protocol.NewErrWithMessage("10127") | 463 | + return protocol.NewErrWithMessage("11106") |
464 | } | 464 | } |
465 | if _, ok := childTitleMap[vv.Title]; ok { | 465 | if _, ok := childTitleMap[vv.Title]; ok { |
466 | - return protocol.NewErrWithMessage("10130") | 466 | + return protocol.NewErrWithMessage("11109") |
467 | } else { | 467 | } else { |
468 | childTitleMap[vv.Title] = 1 | 468 | childTitleMap[vv.Title] = 1 |
469 | } | 469 | } |
@@ -471,7 +471,7 @@ func checkSelfCheckData(data []protocol.TemplateSelfCheck) error { | @@ -471,7 +471,7 @@ func checkSelfCheckData(data []protocol.TemplateSelfCheck) error { | ||
471 | } | 471 | } |
472 | } | 472 | } |
473 | if cnt > 30 { | 473 | if cnt > 30 { |
474 | - return protocol.NewErrWithMessage("10128") | 474 | + return protocol.NewErrWithMessage("11107") |
475 | } | 475 | } |
476 | return nil | 476 | return nil |
477 | } | 477 | } |
@@ -482,7 +482,7 @@ func auditFlowMustActionTypeOr(auditflow protocol.AuditFlowConfig) error { | @@ -482,7 +482,7 @@ func auditFlowMustActionTypeOr(auditflow protocol.AuditFlowConfig) error { | ||
482 | continue | 482 | continue |
483 | } | 483 | } |
484 | if v.AcitonType != models.ActionTypeOr { | 484 | if v.AcitonType != models.ActionTypeOr { |
485 | - return protocol.NewErrWithMessage("10129") | 485 | + return protocol.NewErrWithMessage("11108") |
486 | } | 486 | } |
487 | } | 487 | } |
488 | return nil | 488 | return nil |
@@ -59,14 +59,14 @@ var AuthToken = func(ctx *context.Context) { | @@ -59,14 +59,14 @@ var AuthToken = func(ctx *context.Context) { | ||
59 | storetoken, err = redisdata.GetLoginToken(mtoken.UID, mtoken.CompanyID) | 59 | storetoken, err = redisdata.GetLoginToken(mtoken.UID, mtoken.CompanyID) |
60 | if err != nil { | 60 | if err != nil { |
61 | log.Error("redisdata.GetLoginToken err:%s", err) | 61 | log.Error("redisdata.GetLoginToken err:%s", err) |
62 | - msg = protocol.NewMessage("10024") | 62 | + msg = protocol.NewMessage("10204") |
63 | ctx.Output.JSON(msg, false, false) | 63 | ctx.Output.JSON(msg, false, false) |
64 | return | 64 | return |
65 | } | 65 | } |
66 | if beego.BConfig.RunMode == "prod" { | 66 | if beego.BConfig.RunMode == "prod" { |
67 | //校验是否是单客户端操作 | 67 | //校验是否是单客户端操作 |
68 | if storetoken.AccessToken != accesstoken { | 68 | if storetoken.AccessToken != accesstoken { |
69 | - msg = protocol.NewMessage("10025") | 69 | + msg = protocol.NewMessage("10205") |
70 | ctx.Output.JSON(msg, false, false) | 70 | ctx.Output.JSON(msg, false, false) |
71 | return | 71 | return |
72 | } | 72 | } |
@@ -79,12 +79,12 @@ var AuthToken = func(ctx *context.Context) { | @@ -79,12 +79,12 @@ var AuthToken = func(ctx *context.Context) { | ||
79 | return | 79 | return |
80 | } | 80 | } |
81 | if ok := serveauth.IsJwtErrorExpired(err); ok { | 81 | if ok := serveauth.IsJwtErrorExpired(err); ok { |
82 | - msg := protocol.NewMessage("10024") | 82 | + msg := protocol.NewMessage("10204") |
83 | ctx.Output.JSON(msg, false, false) | 83 | ctx.Output.JSON(msg, false, false) |
84 | return | 84 | return |
85 | } | 85 | } |
86 | log.Error("token 校验失败:%s", err) | 86 | log.Error("token 校验失败:%s", err) |
87 | - msg = protocol.NewMessage("10024") | 87 | + msg = protocol.NewMessage("10204") |
88 | ctx.Output.JSON(msg, false, false) | 88 | ctx.Output.JSON(msg, false, false) |
89 | return | 89 | return |
90 | } | 90 | } |
@@ -4,7 +4,7 @@ var errmessge ErrorMap = map[string]string{ | @@ -4,7 +4,7 @@ var errmessge ErrorMap = map[string]string{ | ||
4 | //操作 | 4 | //操作 |
5 | "0": "ok", | 5 | "0": "ok", |
6 | "1": "网络连接无响应", | 6 | "1": "网络连接无响应", |
7 | - //角色相关 | 7 | + //角色相关 100xx |
8 | "10001": "请先删除该分组下的其他角色", | 8 | "10001": "请先删除该分组下的其他角色", |
9 | "10002": "请先删除该角色下的人员", | 9 | "10002": "请先删除该角色下的人员", |
10 | "10003": "无效角色", | 10 | "10003": "无效角色", |
@@ -18,120 +18,126 @@ var errmessge ErrorMap = map[string]string{ | @@ -18,120 +18,126 @@ var errmessge ErrorMap = map[string]string{ | ||
18 | "10082": "管理员组角色不能移出", | 18 | "10082": "管理员组角色不能移出", |
19 | "10083": "不能将角色添加进管理员组", | 19 | "10083": "不能将角色添加进管理员组", |
20 | "10084": "角色组已存在", | 20 | "10084": "角色组已存在", |
21 | - //职位相关 | ||
22 | - "10011": "该职位已被使用无法删除", | ||
23 | - "10012": "超过10级的职位限制,请重新选择", | ||
24 | - "10013": "同一级职位名称不允许重复", | ||
25 | - "10014": "职位名称最多10个字符", | ||
26 | - "10015": "上级职位不能选择当前职位及其下级职位", | ||
27 | - //安全认证相关 | ||
28 | - "10020": "验证码过期", | ||
29 | - "10021": "账号或密码不正确", | ||
30 | - "10022": "账号已被禁用", | ||
31 | - "10023": "用户无使用权限", | ||
32 | - "10024": "登录凭证失效", | ||
33 | - "10025": "该账号已在其他地方登录", | ||
34 | - "10026": "验证码校验失败", | ||
35 | - "10027": "无操作权限", | ||
36 | - "10028": "请输入正确的验证码", | ||
37 | - "10029": "获取验证码失败", | ||
38 | - "10080": "无操作权限", | ||
39 | - "10111": "获取公司信息失败", | ||
40 | 21 | ||
41 | - //用户相关 | ||
42 | - "10031": "无效角色", | ||
43 | - "10032": "无效部门", | ||
44 | - "10033": "无效职位", | ||
45 | - "10034": "名字限制10个字符以内", | ||
46 | - "10035": "名字是必填项", | ||
47 | - "10036": "请输入正确的手机格式", | ||
48 | - "10037": "用户的部门必填", | ||
49 | - "10038": "用户的角色必填", | ||
50 | - "10039": "用户已存在", | ||
51 | - "10071": "不能删除主管理员", | ||
52 | - "10072": "不能禁用主管理员", | ||
53 | - "10073": "角色组已存在", | ||
54 | - "10074": "删除失败,存在需要用户审批的单子", | ||
55 | - "10075": "禁用失败,存在需要用户审批的单子", | ||
56 | - //部门相关 | ||
57 | - "10041": "无效的主管设置", | ||
58 | - "10042": "上级部门不能选择当前部门及其子部门", | ||
59 | - "10043": "部门名称限制不超过20个字符", | ||
60 | - "10044": "部门名称必填", | ||
61 | - "10045": "同一级部门名称不允许重复", | ||
62 | - "10046": "超过10级的部门限制,请重新选择", | ||
63 | - "10047": "只能删除没有成员的部门,需要先删除部门下的员工,再删除该部门", | ||
64 | - "10048": "请设置上级部门", | ||
65 | - //用户中心相关 | ||
66 | - "10051": "无法从远端接口获取公司数据", | ||
67 | - "10052": "服务调用失败", | ||
68 | - //模板相关 | ||
69 | - "10061": "请先删除该分类下的二级分类", | ||
70 | - "10062": "该分类已被使用无法删除", | ||
71 | - "10063": "该分类已被使用无法禁用", | ||
72 | - "10064": "编码已存在", | ||
73 | - "10065": "编码长度最多6个字符", | ||
74 | - "10067": "一级分类不存在", | ||
75 | - "10068": "审核人为空参数有误", | ||
76 | - "10069": "未设置审核人", | ||
77 | - "10070": "分类名称输入大于10个字符", | ||
78 | - "10271": "模板已存在", | ||
79 | - "10272": "说明信息输入大于30个字符", | ||
80 | - "10273": "表单列最多20个字符", | ||
81 | - "10274": "最多添加10个字段", | ||
82 | - "10275": "最多添加1个节点", | ||
83 | - "10276": "最多选择1个角色", | ||
84 | - "10277": "最多一个小数", | ||
85 | - "10278": "公告标题大于30个字符", | ||
86 | - "10279": "该子分类名称已存在", | ||
87 | - "10280": "请为您选择的特殊人员设置审批流程", | ||
88 | - "10281": "请您选择的审批人员", | ||
89 | - "10282": "请您选择的审批角色", | ||
90 | - "10283": "特殊审批流程被审批人不可重复", | ||
91 | - "10284": "表单字段已经重复", | ||
92 | - "10285": "未设置基础内容", | ||
93 | - "10286": "未设置特殊审批人", | 22 | + //职位相关 101xx |
23 | + "10101": "该职位已被使用无法删除", | ||
24 | + "10102": "超过10级的职位限制,请重新选择", | ||
25 | + "10103": "同一级职位名称不允许重复", | ||
26 | + "10104": "职位名称最多10个字符", | ||
27 | + "10105": "上级职位不能选择当前职位及其下级职位", | ||
94 | 28 | ||
95 | - "10170": "请选择指定成员", | ||
96 | - "10171": "请选择审批人类别", | ||
97 | - "10172": "请选择审批方式", | ||
98 | - "10173": "请选择指定角色", | ||
99 | - "10174": "人数不能超过10个", | ||
100 | - "10175": "请选择一个角色", | ||
101 | - "10176": "至多添加一个审批人", | ||
102 | - //公司相关 | ||
103 | - "12001": "未找到公司信息", | 29 | + //安全认证相关 102xx |
30 | + "10200": "验证码过期", | ||
31 | + "10201": "账号或密码不正确", | ||
32 | + "10202": "账号已被禁用", | ||
33 | + "10203": "用户无使用权限", | ||
34 | + "10204": "登录凭证失效", | ||
35 | + "10205": "该账号已在其他地方登录", | ||
36 | + "10206": "验证码校验失败", | ||
37 | + "10207": "无操作权限", | ||
38 | + "10208": "请输入正确的验证码", | ||
39 | + "10209": "获取验证码失败", | ||
40 | + "10210": "无操作权限", | ||
41 | + "10211": "获取公司信息失败", | ||
42 | + "10212": "公司未启用该模块", | ||
104 | 43 | ||
105 | - //评分配置相关 | ||
106 | - "12101": "分值范围不符合要求", | ||
107 | - "12102": "评分规则不符合要求", | ||
108 | - //权限配置相关 | ||
109 | - "10091": "至少选择一个特定部门", | 44 | + //用户相关 103xx |
45 | + "10301": "无效角色", | ||
46 | + "10302": "无效部门", | ||
47 | + "10303": "无效职位", | ||
48 | + "10304": "名字限制10个字符以内", | ||
49 | + "10305": "名字是必填项", | ||
50 | + "10306": "请输入正确的手机格式", | ||
51 | + "10307": "用户的部门必填", | ||
52 | + "10308": "用户的角色必填", | ||
53 | + "10309": "用户已存在", | ||
54 | + "10310": "不能删除主管理员", | ||
55 | + "10311": "不能禁用主管理员", | ||
56 | + "10312": "角色组已存在", | ||
57 | + "10313": "删除失败,存在需要用户审批的单子", | ||
58 | + "10314": "禁用失败,存在需要用户审批的单子", | ||
59 | + //部门相关 104xx | ||
60 | + "10400": "无效的主管设置", | ||
61 | + "10401": "上级部门不能选择当前部门及其子部门", | ||
62 | + "10402": "部门名称限制不超过20个字符", | ||
63 | + "10403": "部门名称必填", | ||
64 | + "10404": "同一级部门名称不允许重复", | ||
65 | + "10405": "超过10级的部门限制,请重新选择", | ||
66 | + "10406": "只能删除没有成员的部门,需要先删除部门下的员工,再删除该部门", | ||
67 | + "10407": "请设置上级部门", | ||
110 | 68 | ||
111 | - "10101": "赛季周期设置与其他赛季重叠", | ||
112 | - "10102": "参与人类型不一致", | ||
113 | - "10103": "排行榜名称最多5个字符", | ||
114 | - "10104": "赛季名称最多输入20个字符", | ||
115 | - "10105": "赛季开始时间必填", | ||
116 | - "10106": "赛季结束时间必填", | ||
117 | - "10107": "参与范围名称最多输入5个字符", | ||
118 | - "10108": "成果一级分类必填", | ||
119 | - "10109": "成果来源必填", | ||
120 | - "10110": "把握人得分不可大于把握得分", | ||
121 | - "10121": "把握得分必填,0.1-100", | ||
122 | - "10122": "分配的总分不可大于把握分", | ||
123 | - "10123": "排行榜评比项最多4项", | ||
124 | - "10124": "公司未启用该模块", | ||
125 | - "10125": "参与范围名称不能重复", | ||
126 | - "10126": "被转移人员不能为空", | ||
127 | - "10127": "自查内容维度名称最多输入50个字符", | ||
128 | - "10128": "自查内容维度最多输入30个字段", | ||
129 | - "10129": "存在自查内容时只能进行或签设置", | ||
130 | - "10130": "同一级的自查内容不能重复", | ||
131 | - "10131": "储备池分类名称已存在", | ||
132 | - "10132": "无法删除已使用的储备池分类", | ||
133 | - "10133": "储备池分类名称必填", | ||
134 | - "10134": "储备池分类名称最多20个字", | 69 | + // 请求统一用户中心相关 105xx |
70 | + "10501": "无法从远端接口获取公司数据", | ||
71 | + "10502": "服务调用失败", | ||
72 | + | ||
73 | + //模板相关 106xx | ||
74 | + "10601": "请先删除该分类下的二级分类", | ||
75 | + "10602": "该分类已被使用无法删除", | ||
76 | + "10603": "该分类已被使用无法禁用", | ||
77 | + "10604": "编码已存在", | ||
78 | + "10605": "编码长度最多6个字符", | ||
79 | + "10607": "一级分类不存在", | ||
80 | + "10608": "审核人为空参数有误", | ||
81 | + "10609": "未设置审核人", | ||
82 | + "10610": "分类名称输入大于10个字符", | ||
83 | + "10611": "模板已存在", | ||
84 | + "10612": "说明信息输入大于30个字符", | ||
85 | + "10613": "表单列最多20个字符", | ||
86 | + "10614": "最多添加10个字段", | ||
87 | + "10615": "最多添加1个节点", | ||
88 | + "10616": "最多选择1个角色", | ||
89 | + "10617": "最多一个小数", | ||
90 | + "10618": "公告标题大于30个字符", | ||
91 | + "10619": "该子分类名称已存在", | ||
92 | + "10620": "请为您选择的特殊人员设置审批流程", | ||
93 | + "10621": "请您选择的审批人员", | ||
94 | + "10622": "请您选择的审批角色", | ||
95 | + "10623": "特殊审批流程被审批人不可重复", | ||
96 | + "10624": "表单字段已经重复", | ||
97 | + "10625": "未设置基础内容", | ||
98 | + "10626": "未设置特殊审批人", | ||
99 | + "10627": "请选择指定成员", | ||
100 | + "10628": "请选择审批人类别", | ||
101 | + "10629": "请选择审批方式", | ||
102 | + "10630": "请选择指定角色", | ||
103 | + "10631": "人数不能超过10个", | ||
104 | + "10632": "请选择一个角色", | ||
105 | + "10633": "至多添加一个审批人", | ||
106 | + //公司相关 107xx | ||
107 | + "10701": "未找到公司信息", | ||
108 | + | ||
109 | + //评分配置相关 108xx | ||
110 | + "10801": "分值范围不符合要求", | ||
111 | + "10802": "评分规则不符合要求", | ||
112 | + | ||
113 | + //权限配置相关 109xx | ||
114 | + "10901": "至少选择一个特定部门", | ||
115 | + | ||
116 | + //赛季配置相关 110xx | ||
117 | + "11001": "赛季周期设置与其他赛季重叠", | ||
118 | + "11002": "参与人类型不一致", | ||
119 | + "11003": "排行榜名称最多5个字符", | ||
120 | + "11004": "赛季名称最多输入20个字符", | ||
121 | + "11005": "赛季开始时间必填", | ||
122 | + "11006": "赛季结束时间必填", | ||
123 | + "11007": "参与范围名称最多输入5个字符", | ||
124 | + "11008": "排行榜评比项最多4项", | ||
125 | + "11009": "参与范围名称不能重复", | ||
126 | + "11010": "被转移人员不能为空", | ||
127 | + //成果相关 111xx | ||
128 | + "11101": "成果一级分类必填", | ||
129 | + "11102": "成果来源必填", | ||
130 | + "11103": "把握人得分不可大于把握得分", | ||
131 | + "11104": "把握得分必填,0.1-100", | ||
132 | + "11105": "分配的总分不可大于把握分", | ||
133 | + "11106": "自查内容维度名称最多输入50个字符", | ||
134 | + "11107": "自查内容维度最多输入30个字段", | ||
135 | + "11108": "存在自查内容时只能进行或签设置", | ||
136 | + "11109": "同一级的自查内容不能重复", | ||
137 | + "11110": "储备池分类名称已存在", | ||
138 | + "11111": "无法删除已使用的储备池分类", | ||
139 | + "11112": "储备池分类名称必填", | ||
140 | + "11113": "储备池分类名称最多20个字", | ||
135 | } | 141 | } |
136 | 142 | ||
137 | //错误码转换 ,兼容需要 | 143 | //错误码转换 ,兼容需要 |
@@ -139,7 +145,7 @@ func transformCode(code string) int { | @@ -139,7 +145,7 @@ func transformCode(code string) int { | ||
139 | switch code { | 145 | switch code { |
140 | case "0": | 146 | case "0": |
141 | return 0 //登录成功 | 147 | return 0 //登录成功 |
142 | - case "10026", "10024": | 148 | + case "10206", "10204": |
143 | return 2 //token过期 | 149 | return 2 //token过期 |
144 | } | 150 | } |
145 | return -1 //请求成功,但业务检查不通过 | 151 | return -1 //请求成功,但业务检查不通过 |
@@ -53,7 +53,7 @@ func GetReserveTypeLsit(pageIndex int, pageSize int, companyid int64) protocol.R | @@ -53,7 +53,7 @@ func GetReserveTypeLsit(pageIndex int, pageSize int, companyid int64) protocol.R | ||
53 | func AddReserveType(name string, companyid int64) error { | 53 | func AddReserveType(name string, companyid int64) error { |
54 | has := models.HasChanceReserveTypeName(name, companyid, 0) | 54 | has := models.HasChanceReserveTypeName(name, companyid, 0) |
55 | if has { | 55 | if has { |
56 | - return protocol.NewErrWithMessage("10131") | 56 | + return protocol.NewErrWithMessage("11110") |
57 | } | 57 | } |
58 | m := &models.ChanceReserveType{ | 58 | m := &models.ChanceReserveType{ |
59 | Name: name, | 59 | Name: name, |
@@ -69,7 +69,7 @@ func AddReserveType(name string, companyid int64) error { | @@ -69,7 +69,7 @@ func AddReserveType(name string, companyid int64) error { | ||
69 | func EditReserveType(id int, name string, companyid int64) error { | 69 | func EditReserveType(id int, name string, companyid int64) error { |
70 | has := models.HasChanceReserveTypeName(name, companyid, id) | 70 | has := models.HasChanceReserveTypeName(name, companyid, id) |
71 | if has { | 71 | if has { |
72 | - return protocol.NewErrWithMessage("10131") | 72 | + return protocol.NewErrWithMessage("11110") |
73 | } | 73 | } |
74 | m := &models.ChanceReserveType{} | 74 | m := &models.ChanceReserveType{} |
75 | var err error | 75 | var err error |
@@ -106,7 +106,7 @@ func DeleteReserveType(id int, companyid int64) error { | @@ -106,7 +106,7 @@ func DeleteReserveType(id int, companyid int64) error { | ||
106 | o := orm.NewOrm() | 106 | o := orm.NewOrm() |
107 | has := o.QueryTable(&models.Chance{}).Filter("reserve_type_id", id).Exist() | 107 | has := o.QueryTable(&models.Chance{}).Filter("reserve_type_id", id).Exist() |
108 | if has { | 108 | if has { |
109 | - return protocol.NewErrWithMessage("10132") | 109 | + return protocol.NewErrWithMessage("11111") |
110 | } | 110 | } |
111 | err = models.DeleteChanceReserveType(id) | 111 | err = models.DeleteChanceReserveType(id) |
112 | if err != nil { | 112 | if err != nil { |
@@ -28,15 +28,15 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs | @@ -28,15 +28,15 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs | ||
28 | return | 28 | return |
29 | } | 29 | } |
30 | if len([]rune(request.Template.Code)) > 6 { | 30 | if len([]rune(request.Template.Code)) > 6 { |
31 | - err = protocol.NewErrWithMessage("10065") | 31 | + err = protocol.NewErrWithMessage("10605") |
32 | return | 32 | return |
33 | } | 33 | } |
34 | if _, err = models.GetAuditTemplateByCode(companyId, request.Template.Code, request.Template.ChanceTypeId); err == nil { | 34 | if _, err = models.GetAuditTemplateByCode(companyId, request.Template.Code, request.Template.ChanceTypeId); err == nil { |
35 | - err = protocol.NewErrWithMessage("10064") | 35 | + err = protocol.NewErrWithMessage("10604") |
36 | return | 36 | return |
37 | } | 37 | } |
38 | if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name, request.Template.ChanceTypeId); err == nil { | 38 | if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name, request.Template.ChanceTypeId); err == nil { |
39 | - err = protocol.NewErrWithMessage("10279") | 39 | + err = protocol.NewErrWithMessage("10619") |
40 | return | 40 | return |
41 | } | 41 | } |
42 | orm := orm2.NewOrm() | 42 | orm := orm2.NewOrm() |
@@ -390,7 +390,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques | @@ -390,7 +390,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques | ||
390 | } | 390 | } |
391 | if template.Name != request.Template.Name { | 391 | if template.Name != request.Template.Name { |
392 | if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name, request.Template.ChanceTypeId); err == nil { | 392 | if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name, request.Template.ChanceTypeId); err == nil { |
393 | - err = protocol.NewErrWithMessage("10279") | 393 | + err = protocol.NewErrWithMessage("10619") |
394 | return | 394 | return |
395 | } | 395 | } |
396 | } | 396 | } |
@@ -604,7 +604,7 @@ func TemplateEditVisible(uid, companyId int64, request *protocol.TemplateEditVis | @@ -604,7 +604,7 @@ func TemplateEditVisible(uid, companyId int64, request *protocol.TemplateEditVis | ||
604 | return | 604 | return |
605 | } | 605 | } |
606 | if template.CompanyId != int(companyId) { | 606 | if template.CompanyId != int(companyId) { |
607 | - err = protocol.NewErrWithMessage("10027") | 607 | + err = protocol.NewErrWithMessage("10207") |
608 | log.Error("template_id:%v companyId:%v want:%v not equal.", request.Id, companyId, template.CompanyId) | 608 | log.Error("template_id:%v companyId:%v want:%v not equal.", request.Id, companyId, template.CompanyId) |
609 | return | 609 | return |
610 | } | 610 | } |
@@ -646,7 +646,7 @@ func TemplateEditSort(uid, companyId int64, request *protocol.TemplateEditSortRe | @@ -646,7 +646,7 @@ func TemplateEditSort(uid, companyId int64, request *protocol.TemplateEditSortRe | ||
646 | } | 646 | } |
647 | if template.CompanyId != int(companyId) { | 647 | if template.CompanyId != int(companyId) { |
648 | log.Debug(fmt.Sprintf("template.companyId input:%v want:%v not equal.", companyId, template.CompanyId)) | 648 | log.Debug(fmt.Sprintf("template.companyId input:%v want:%v not equal.", companyId, template.CompanyId)) |
649 | - err = protocol.NewErrWithMessage("10027") | 649 | + err = protocol.NewErrWithMessage("10207") |
650 | return | 650 | return |
651 | } | 651 | } |
652 | if item.SortNum == template.SortNum { | 652 | if item.SortNum == template.SortNum { |
@@ -751,17 +751,17 @@ func TemplateDelete(uid, companyId int64, request *protocol.TemplateDeleteReques | @@ -751,17 +751,17 @@ func TemplateDelete(uid, companyId int64, request *protocol.TemplateDeleteReques | ||
751 | return | 751 | return |
752 | } | 752 | } |
753 | if template.CompanyId != int(companyId) { | 753 | if template.CompanyId != int(companyId) { |
754 | - err = protocol.NewErrWithMessage("10027") | 754 | + err = protocol.NewErrWithMessage("10207") |
755 | return | 755 | return |
756 | } | 756 | } |
757 | //2.判断是否有对应已经发布的机会 | 757 | //2.判断是否有对应已经发布的机会 |
758 | if err = utils.ExecuteQueryOne(&num, sql1, request.TemplateId); err == nil && num > 0 { | 758 | if err = utils.ExecuteQueryOne(&num, sql1, request.TemplateId); err == nil && num > 0 { |
759 | - err = protocol.NewErrWithMessage("10062") | 759 | + err = protocol.NewErrWithMessage("10602") |
760 | return | 760 | return |
761 | } | 761 | } |
762 | //3.判断是否有对应发布的成果 | 762 | //3.判断是否有对应发布的成果 |
763 | if err = utils.ExecuteQueryOne(&num, sql2, request.TemplateId); err == nil && num > 0 { | 763 | if err = utils.ExecuteQueryOne(&num, sql2, request.TemplateId); err == nil && num > 0 { |
764 | - err = protocol.NewErrWithMessage("10062") | 764 | + err = protocol.NewErrWithMessage("10602") |
765 | return | 765 | return |
766 | } | 766 | } |
767 | 767 | ||
@@ -802,13 +802,13 @@ func TemplateEditEnable(uid, companyId int64, request *protocol.TemplateEditEnab | @@ -802,13 +802,13 @@ func TemplateEditEnable(uid, companyId int64, request *protocol.TemplateEditEnab | ||
802 | return | 802 | return |
803 | } | 803 | } |
804 | if template.CompanyId != int(companyId) { | 804 | if template.CompanyId != int(companyId) { |
805 | - err = protocol.NewErrWithMessage("10027") | 805 | + err = protocol.NewErrWithMessage("10207") |
806 | return | 806 | return |
807 | } | 807 | } |
808 | //2.判断是否有对应已经发布的机会 | 808 | //2.判断是否有对应已经发布的机会 |
809 | if request.Enabled == 0 { | 809 | if request.Enabled == 0 { |
810 | if err = utils.ExecuteQueryOne(&num, sql1, request.TemplateId); err == nil && num > 0 { | 810 | if err = utils.ExecuteQueryOne(&num, sql1, request.TemplateId); err == nil && num > 0 { |
811 | - err = protocol.NewErrWithMessage("10063") | 811 | + err = protocol.NewErrWithMessage("10603") |
812 | return | 812 | return |
813 | } | 813 | } |
814 | } | 814 | } |
@@ -832,13 +832,13 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe | @@ -832,13 +832,13 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe | ||
832 | return | 832 | return |
833 | } | 833 | } |
834 | if chanceType.CompanyId != int(companyId) { | 834 | if chanceType.CompanyId != int(companyId) { |
835 | - err = protocol.NewErrWithMessage("10027") | 835 | + err = protocol.NewErrWithMessage("10207") |
836 | log.Error("template_id:%v companyId:%v want:%v not equal.", request.Id, companyId, chanceType.CompanyId) | 836 | log.Error("template_id:%v companyId:%v want:%v not equal.", request.Id, companyId, chanceType.CompanyId) |
837 | return | 837 | return |
838 | } | 838 | } |
839 | if chanceType.Name != request.Name { | 839 | if chanceType.Name != request.Name { |
840 | if _, err = models.GetChanceTypeByName(companyId, request.Name); err == nil { | 840 | if _, err = models.GetChanceTypeByName(companyId, request.Name); err == nil { |
841 | - err = protocol.NewErrWithMessage("10271") | 841 | + err = protocol.NewErrWithMessage("10611") |
842 | return | 842 | return |
843 | } | 843 | } |
844 | } | 844 | } |
@@ -850,7 +850,7 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe | @@ -850,7 +850,7 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe | ||
850 | return | 850 | return |
851 | } | 851 | } |
852 | if len([]rune(request.Code)) > 6 { | 852 | if len([]rune(request.Code)) > 6 { |
853 | - err = protocol.NewErrWithMessage("10065") | 853 | + err = protocol.NewErrWithMessage("10605") |
854 | return | 854 | return |
855 | } | 855 | } |
856 | chanceType = &models.ChanceType{ | 856 | chanceType = &models.ChanceType{ |
@@ -862,11 +862,11 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe | @@ -862,11 +862,11 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe | ||
862 | UpdateAt: time.Now(), | 862 | UpdateAt: time.Now(), |
863 | } | 863 | } |
864 | if _, err = models.GetChanceTypeByCode(companyId, chanceType.Code); err == nil { | 864 | if _, err = models.GetChanceTypeByCode(companyId, chanceType.Code); err == nil { |
865 | - err = protocol.NewErrWithMessage("10064") | 865 | + err = protocol.NewErrWithMessage("10604") |
866 | return | 866 | return |
867 | } | 867 | } |
868 | if _, err = models.GetChanceTypeByName(companyId, chanceType.Name); err == nil { | 868 | if _, err = models.GetChanceTypeByName(companyId, chanceType.Name); err == nil { |
869 | - err = protocol.NewErrWithMessage("10271") | 869 | + err = protocol.NewErrWithMessage("10611") |
870 | return | 870 | return |
871 | } | 871 | } |
872 | if c, e := models.GetChanceTypeMaxSort(companyId); e == nil { | 872 | if c, e := models.GetChanceTypeMaxSort(companyId); e == nil { |
@@ -894,28 +894,28 @@ func TemplateDeleteCategory(uid, companyId int64, request *protocol.TemplateDele | @@ -894,28 +894,28 @@ func TemplateDeleteCategory(uid, companyId int64, request *protocol.TemplateDele | ||
894 | if chanceType, err = models.GetChanceTypeById(request.ChanceTypeId); err != nil { | 894 | if chanceType, err = models.GetChanceTypeById(request.ChanceTypeId); err != nil { |
895 | log.Error(err.Error()) | 895 | log.Error(err.Error()) |
896 | if err == orm2.ErrNoRows { | 896 | if err == orm2.ErrNoRows { |
897 | - err = protocol.NewErrWithMessage("10067") | 897 | + err = protocol.NewErrWithMessage("10607") |
898 | } | 898 | } |
899 | return | 899 | return |
900 | } | 900 | } |
901 | if chanceType.CompanyId != int(companyId) { | 901 | if chanceType.CompanyId != int(companyId) { |
902 | - err = protocol.NewErrWithMessage("10027") | 902 | + err = protocol.NewErrWithMessage("10207") |
903 | return | 903 | return |
904 | } | 904 | } |
905 | 905 | ||
906 | //1.判断分类下面是否有模板 | 906 | //1.判断分类下面是否有模板 |
907 | if err = utils.ExecuteQueryOne(&num, sql1, request.ChanceTypeId); err == nil && num > 0 { | 907 | if err = utils.ExecuteQueryOne(&num, sql1, request.ChanceTypeId); err == nil && num > 0 { |
908 | - err = protocol.NewErrWithMessage("10061") | 908 | + err = protocol.NewErrWithMessage("10601") |
909 | return | 909 | return |
910 | } | 910 | } |
911 | //2.判断是否有对应已经发布的机会 | 911 | //2.判断是否有对应已经发布的机会 |
912 | if err = utils.ExecuteQueryOne(&num, sql2, request.ChanceTypeId); err == nil && num > 0 { | 912 | if err = utils.ExecuteQueryOne(&num, sql2, request.ChanceTypeId); err == nil && num > 0 { |
913 | - err = protocol.NewErrWithMessage("10062") | 913 | + err = protocol.NewErrWithMessage("10602") |
914 | return | 914 | return |
915 | } | 915 | } |
916 | //3.判断是否有对应发布的成果 | 916 | //3.判断是否有对应发布的成果 |
917 | if err = utils.ExecuteQueryOne(&num, sql3, request.ChanceTypeId); err == nil && num > 0 { | 917 | if err = utils.ExecuteQueryOne(&num, sql3, request.ChanceTypeId); err == nil && num > 0 { |
918 | - err = protocol.NewErrWithMessage("10062") | 918 | + err = protocol.NewErrWithMessage("10602") |
919 | return | 919 | return |
920 | } | 920 | } |
921 | 921 | ||
@@ -941,7 +941,7 @@ func CategoryEditSort(uid, companyId int64, request *protocol.CategoryEditSortRe | @@ -941,7 +941,7 @@ func CategoryEditSort(uid, companyId int64, request *protocol.CategoryEditSortRe | ||
941 | } | 941 | } |
942 | if template.CompanyId != int(companyId) { | 942 | if template.CompanyId != int(companyId) { |
943 | log.Debug(fmt.Sprintf("template.companyId input:%v want:%v not equal.", companyId, template.CompanyId)) | 943 | log.Debug(fmt.Sprintf("template.companyId input:%v want:%v not equal.", companyId, template.CompanyId)) |
944 | - err = protocol.NewErrWithMessage("10027") | 944 | + err = protocol.NewErrWithMessage("10207") |
945 | return | 945 | return |
946 | } | 946 | } |
947 | if item.SortNum == template.SortNum { | 947 | if item.SortNum == template.SortNum { |
@@ -968,49 +968,49 @@ func ValidAuditFlowConfig(flowConfig protocol.AuditFlowConfig) (msg *protocol.Re | @@ -968,49 +968,49 @@ func ValidAuditFlowConfig(flowConfig protocol.AuditFlowConfig) (msg *protocol.Re | ||
968 | for i := range flowConfig.ProcessConfig { | 968 | for i := range flowConfig.ProcessConfig { |
969 | config := flowConfig.ProcessConfig[i] | 969 | config := flowConfig.ProcessConfig[i] |
970 | if !(config.ApproveType == models.AuditByDepartmentor || config.ApproveType == models.AuditByUser || config.ApproveType == models.AuditByRole) { | 970 | if !(config.ApproveType == models.AuditByDepartmentor || config.ApproveType == models.AuditByUser || config.ApproveType == models.AuditByRole) { |
971 | - msg = protocol.BadRequestParam("10171") | 971 | + msg = protocol.BadRequestParam("10628") |
972 | return | 972 | return |
973 | } | 973 | } |
974 | if !(config.AcitonType == models.ActionTypeOr || config.AcitonType == models.ActionTypeAnd) { | 974 | if !(config.AcitonType == models.ActionTypeOr || config.AcitonType == models.ActionTypeAnd) { |
975 | - msg = protocol.BadRequestParam("10172") | 975 | + msg = protocol.BadRequestParam("10629") |
976 | return | 976 | return |
977 | } | 977 | } |
978 | if config.ApproveType == models.AuditByUser { | 978 | if config.ApproveType == models.AuditByUser { |
979 | if len(config.ToUser) == 0 { | 979 | if len(config.ToUser) == 0 { |
980 | - msg = protocol.BadRequestParam("10170") | 980 | + msg = protocol.BadRequestParam("10627") |
981 | return | 981 | return |
982 | } | 982 | } |
983 | if len(config.ToUser) > 10 { | 983 | if len(config.ToUser) > 10 { |
984 | - msg = protocol.BadRequestParam("10174") | 984 | + msg = protocol.BadRequestParam("10631") |
985 | return | 985 | return |
986 | } | 986 | } |
987 | } | 987 | } |
988 | if config.ApproveType == models.AuditByRole { | 988 | if config.ApproveType == models.AuditByRole { |
989 | if len(config.ToRole) == 0 { | 989 | if len(config.ToRole) == 0 { |
990 | - msg = protocol.BadRequestParam("10173") | 990 | + msg = protocol.BadRequestParam("10630") |
991 | return | 991 | return |
992 | } | 992 | } |
993 | if len(config.ToRole) > 1 { | 993 | if len(config.ToRole) > 1 { |
994 | - msg = protocol.BadRequestParam("10175") | 994 | + msg = protocol.BadRequestParam("10632") |
995 | return | 995 | return |
996 | } | 996 | } |
997 | } | 997 | } |
998 | if config.ProcessType == models.FlowTypeNormal { | 998 | if config.ProcessType == models.FlowTypeNormal { |
999 | count++ | 999 | count++ |
1000 | if count > 1 { | 1000 | if count > 1 { |
1001 | - msg = protocol.BadRequestParam("10176") | 1001 | + msg = protocol.BadRequestParam("10633") |
1002 | return | 1002 | return |
1003 | } | 1003 | } |
1004 | } | 1004 | } |
1005 | if config.ProcessType == models.FlowTypeSpecail { | 1005 | if config.ProcessType == models.FlowTypeSpecail { |
1006 | if len(config.FromSpecialUser) == 0 { //特殊人为空 | 1006 | if len(config.FromSpecialUser) == 0 { //特殊人为空 |
1007 | - msg = protocol.BadRequestParam("10286") | 1007 | + msg = protocol.BadRequestParam("10626") |
1008 | return | 1008 | return |
1009 | } | 1009 | } |
1010 | for i := range config.FromSpecialUser { | 1010 | for i := range config.FromSpecialUser { |
1011 | u := config.FromSpecialUser[i] | 1011 | u := config.FromSpecialUser[i] |
1012 | if _, ok := specailUser[u.Id]; ok { | 1012 | if _, ok := specailUser[u.Id]; ok { |
1013 | - msg = protocol.BadRequestParam("10283") | 1013 | + msg = protocol.BadRequestParam("10623") |
1014 | return | 1014 | return |
1015 | } else { | 1015 | } else { |
1016 | specailUser[u.Id] = u.Id | 1016 | specailUser[u.Id] = u.Id |
@@ -1029,13 +1029,13 @@ func ValidProcessConfig(config *protocol.ProcessConfig) (msg *protocol.ResponseM | @@ -1029,13 +1029,13 @@ func ValidProcessConfig(config *protocol.ProcessConfig) (msg *protocol.ResponseM | ||
1029 | break | 1029 | break |
1030 | case models.AuditByUser: | 1030 | case models.AuditByUser: |
1031 | if len(config.ToUser) == 0 { | 1031 | if len(config.ToUser) == 0 { |
1032 | - msg = protocol.BadRequestParam("10281") | 1032 | + msg = protocol.BadRequestParam("10621") |
1033 | return | 1033 | return |
1034 | } | 1034 | } |
1035 | break | 1035 | break |
1036 | case models.AuditByRole: | 1036 | case models.AuditByRole: |
1037 | if len(config.ToRole) == 0 { | 1037 | if len(config.ToRole) == 0 { |
1038 | - msg = protocol.BadRequestParam("10282") | 1038 | + msg = protocol.BadRequestParam("10622") |
1039 | return | 1039 | return |
1040 | } | 1040 | } |
1041 | break | 1041 | break |
@@ -1056,12 +1056,12 @@ func ValidFormList(inputs []*protocol.InputElement) (msg *protocol.ResponseMessa | @@ -1056,12 +1056,12 @@ func ValidFormList(inputs []*protocol.InputElement) (msg *protocol.ResponseMessa | ||
1056 | for i := range inputs { | 1056 | for i := range inputs { |
1057 | input := inputs[i] | 1057 | input := inputs[i] |
1058 | if len([]rune(input.Label)) > 50 { | 1058 | if len([]rune(input.Label)) > 50 { |
1059 | - msg = protocol.BadRequestParam("10273") | 1059 | + msg = protocol.BadRequestParam("10613") |
1060 | return | 1060 | return |
1061 | } | 1061 | } |
1062 | key := fmt.Sprintf("%v-%v", input.SectionType, input.Label) | 1062 | key := fmt.Sprintf("%v-%v", input.SectionType, input.Label) |
1063 | if _, ok := mapCheckRe[key]; ok { | 1063 | if _, ok := mapCheckRe[key]; ok { |
1064 | - msg = protocol.BadRequestParam("10284") | 1064 | + msg = protocol.BadRequestParam("10624") |
1065 | return | 1065 | return |
1066 | } else { | 1066 | } else { |
1067 | mapCheckRe[key] = key | 1067 | mapCheckRe[key] = key |
@@ -1077,11 +1077,11 @@ func ValidFormList(inputs []*protocol.InputElement) (msg *protocol.ResponseMessa | @@ -1077,11 +1077,11 @@ func ValidFormList(inputs []*protocol.InputElement) (msg *protocol.ResponseMessa | ||
1077 | } | 1077 | } |
1078 | } | 1078 | } |
1079 | if countBasic == 0 { | 1079 | if countBasic == 0 { |
1080 | - msg = protocol.BadRequestParam("10285") | 1080 | + msg = protocol.BadRequestParam("10625") |
1081 | return | 1081 | return |
1082 | } | 1082 | } |
1083 | if countBasic > 10 || countExtral > 10 { | 1083 | if countBasic > 10 || countExtral > 10 { |
1084 | - msg = protocol.BadRequestParam("10274") | 1084 | + msg = protocol.BadRequestParam("10614") |
1085 | return | 1085 | return |
1086 | } | 1086 | } |
1087 | return | 1087 | return |
@@ -121,11 +121,11 @@ func ChangeLoginToken(userid, companyid int64) (protocol.LoginAuthToken, error) | @@ -121,11 +121,11 @@ func ChangeLoginToken(userid, companyid int64) (protocol.LoginAuthToken, error) | ||
121 | } | 121 | } |
122 | if ok := usercompany.IsEnable(); !ok { | 122 | if ok := usercompany.IsEnable(); !ok { |
123 | log.Debug("公司禁用此用户") | 123 | log.Debug("公司禁用此用户") |
124 | - return logintoken, protocol.NewErrWithMessage("10027") | 124 | + return logintoken, protocol.NewErrWithMessage("10207") |
125 | } | 125 | } |
126 | if ok := usercompany.IsDelete(); ok { | 126 | if ok := usercompany.IsDelete(); ok { |
127 | log.Debug("公司删除此用户") | 127 | log.Debug("公司删除此用户") |
128 | - return logintoken, protocol.NewErrWithMessage("10027") | 128 | + return logintoken, protocol.NewErrWithMessage("10207") |
129 | } | 129 | } |
130 | companydata, err = models.GetCompanyById(usercompany.CompanyId) | 130 | companydata, err = models.GetCompanyById(usercompany.CompanyId) |
131 | if err != nil { | 131 | if err != nil { |
@@ -134,7 +134,7 @@ func ChangeLoginToken(userid, companyid int64) (protocol.LoginAuthToken, error) | @@ -134,7 +134,7 @@ func ChangeLoginToken(userid, companyid int64) (protocol.LoginAuthToken, error) | ||
134 | } | 134 | } |
135 | if ok := companydata.IsEnable(); !ok { | 135 | if ok := companydata.IsEnable(); !ok { |
136 | log.Debug("无效公司") | 136 | log.Debug("无效公司") |
137 | - return logintoken, protocol.NewErrWithMessage("10027") | 137 | + return logintoken, protocol.NewErrWithMessage("10207") |
138 | } | 138 | } |
139 | logintoken, err = GenerateAuthToken(userid, companydata.Id, usercompany.Id) | 139 | logintoken, err = GenerateAuthToken(userid, companydata.Id, usercompany.Id) |
140 | if err != nil { | 140 | if err != nil { |
@@ -157,28 +157,28 @@ func LoginAuthByUCenter(account, password string) ( | @@ -157,28 +157,28 @@ func LoginAuthByUCenter(account, password string) ( | ||
157 | var uclientReturn *ucenter.ResponseLogin | 157 | var uclientReturn *ucenter.ResponseLogin |
158 | uclientReturn, err = ucenter.RequestUCenterLogin(account, password) | 158 | uclientReturn, err = ucenter.RequestUCenterLogin(account, password) |
159 | if err != nil { | 159 | if err != nil { |
160 | - return logintoken, protocol.NewErrWithMessage("10021") | 160 | + return logintoken, protocol.NewErrWithMessage("10201") |
161 | } | 161 | } |
162 | userdata, err = models.GetUserByUCenter(uclientReturn.Data.Id) | 162 | userdata, err = models.GetUserByUCenter(uclientReturn.Data.Id) |
163 | if err != nil { | 163 | if err != nil { |
164 | log.Debug("GetUserByUCenter(%d) err:%s", uclientReturn.Data.Id, err) | 164 | log.Debug("GetUserByUCenter(%d) err:%s", uclientReturn.Data.Id, err) |
165 | - return logintoken, protocol.NewErrWithMessage("10021") | 165 | + return logintoken, protocol.NewErrWithMessage("10201") |
166 | } | 166 | } |
167 | if ok := userdata.IsDelete(); ok { | 167 | if ok := userdata.IsDelete(); ok { |
168 | log.Debug("userdata.IsDelete()==true") | 168 | log.Debug("userdata.IsDelete()==true") |
169 | - return logintoken, protocol.NewErrWithMessage("10021") | 169 | + return logintoken, protocol.NewErrWithMessage("10201") |
170 | } | 170 | } |
171 | if ok := userdata.IsEnable(); !ok { | 171 | if ok := userdata.IsEnable(); !ok { |
172 | log.Debug("userdata.IsEnable()==false") | 172 | log.Debug("userdata.IsEnable()==false") |
173 | - return logintoken, protocol.NewErrWithMessage("10022") | 173 | + return logintoken, protocol.NewErrWithMessage("10202") |
174 | } | 174 | } |
175 | if companys, err = getUserCompanyReal(userdata.Id); err != nil { | 175 | if companys, err = getUserCompanyReal(userdata.Id); err != nil { |
176 | log.Error("getUserCompanyReal err:%s", err) | 176 | log.Error("getUserCompanyReal err:%s", err) |
177 | - return logintoken, protocol.NewErrWithMessage("10021") | 177 | + return logintoken, protocol.NewErrWithMessage("10201") |
178 | } | 178 | } |
179 | if len(companys) == 0 { | 179 | if len(companys) == 0 { |
180 | log.Debug("no company") | 180 | log.Debug("no company") |
181 | - return logintoken, protocol.NewErrWithMessage("10022") | 181 | + return logintoken, protocol.NewErrWithMessage("10202") |
182 | } | 182 | } |
183 | //获取上一次登录的公司 | 183 | //获取上一次登录的公司 |
184 | uAuth, err := models.GetUserAuthByUser(userdata.Id) | 184 | uAuth, err := models.GetUserAuthByUser(userdata.Id) |
@@ -201,7 +201,7 @@ func LoginAuthByUCenter(account, password string) ( | @@ -201,7 +201,7 @@ func LoginAuthByUCenter(account, password string) ( | ||
201 | ucompany, err := models.GetUserCompanyBy(userdata.Id, companyid) | 201 | ucompany, err := models.GetUserCompanyBy(userdata.Id, companyid) |
202 | if err != nil { | 202 | if err != nil { |
203 | log.Error("获取user_company失败;%s", err) | 203 | log.Error("获取user_company失败;%s", err) |
204 | - return logintoken, protocol.NewErrWithMessage("10022") | 204 | + return logintoken, protocol.NewErrWithMessage("10202") |
205 | } | 205 | } |
206 | usercompanyid = ucompany.Id | 206 | usercompanyid = ucompany.Id |
207 | logintoken, _ = GenerateAuthToken(userdata.Id, companyid, usercompanyid) | 207 | logintoken, _ = GenerateAuthToken(userdata.Id, companyid, usercompanyid) |
@@ -441,23 +441,23 @@ func LoginAuthBySmsCode(uclientReturn *ucenter.ResponseLoginSms) ( | @@ -441,23 +441,23 @@ func LoginAuthBySmsCode(uclientReturn *ucenter.ResponseLoginSms) ( | ||
441 | userdata, err = models.GetUserByUCenter(uclientReturn.Data.Cuid) | 441 | userdata, err = models.GetUserByUCenter(uclientReturn.Data.Cuid) |
442 | if err != nil { | 442 | if err != nil { |
443 | log.Debug("GetUserByUCenter(%s) err:%s", uclientReturn.Data.Cuid, err) | 443 | log.Debug("GetUserByUCenter(%s) err:%s", uclientReturn.Data.Cuid, err) |
444 | - return logintoken, protocol.NewErrWithMessage("10021") | 444 | + return logintoken, protocol.NewErrWithMessage("10201") |
445 | } | 445 | } |
446 | if ok := userdata.IsDelete(); ok { | 446 | if ok := userdata.IsDelete(); ok { |
447 | log.Debug("userdata.IsDelete()==true") | 447 | log.Debug("userdata.IsDelete()==true") |
448 | - return logintoken, protocol.NewErrWithMessage("10021") | 448 | + return logintoken, protocol.NewErrWithMessage("10201") |
449 | } | 449 | } |
450 | if ok := userdata.IsEnable(); !ok { | 450 | if ok := userdata.IsEnable(); !ok { |
451 | log.Debug("userdata.IsEnable()==false") | 451 | log.Debug("userdata.IsEnable()==false") |
452 | - return logintoken, protocol.NewErrWithMessage("10022") | 452 | + return logintoken, protocol.NewErrWithMessage("10202") |
453 | } | 453 | } |
454 | if companys, err = getUserCompanyReal(userdata.Id); err != nil { | 454 | if companys, err = getUserCompanyReal(userdata.Id); err != nil { |
455 | log.Error("getUserCompanyReal err:%s", err) | 455 | log.Error("getUserCompanyReal err:%s", err) |
456 | - return logintoken, protocol.NewErrWithMessage("10021") | 456 | + return logintoken, protocol.NewErrWithMessage("10201") |
457 | } | 457 | } |
458 | if len(companys) == 0 { | 458 | if len(companys) == 0 { |
459 | log.Debug("no company") | 459 | log.Debug("no company") |
460 | - return logintoken, protocol.NewErrWithMessage("10022") | 460 | + return logintoken, protocol.NewErrWithMessage("10202") |
461 | } | 461 | } |
462 | //获取上一次登录的公司 | 462 | //获取上一次登录的公司 |
463 | uAuth, err := models.GetUserAuthByUser(userdata.Id) | 463 | uAuth, err := models.GetUserAuthByUser(userdata.Id) |
@@ -504,11 +504,11 @@ func SmsCodeSend(phone string) error { | @@ -504,11 +504,11 @@ func SmsCodeSend(phone string) error { | ||
504 | _, err = models.GetUserByPhone(phone) | 504 | _, err = models.GetUserByPhone(phone) |
505 | if err != nil { | 505 | if err != nil { |
506 | log.Error("GetUserByPhone(%s) err:%s", phone, err) | 506 | log.Error("GetUserByPhone(%s) err:%s", phone, err) |
507 | - return protocol.NewErrWithMessage("10027") | 507 | + return protocol.NewErrWithMessage("10207") |
508 | } | 508 | } |
509 | err = ucenter.RequestUCenterSmsCode(phone) | 509 | err = ucenter.RequestUCenterSmsCode(phone) |
510 | if err != nil { | 510 | if err != nil { |
511 | - return protocol.NewErrWithMessage("10029") | 511 | + return protocol.NewErrWithMessage("10209") |
512 | } | 512 | } |
513 | return nil | 513 | return nil |
514 | } | 514 | } |
@@ -516,7 +516,7 @@ func SmsCodeSend(phone string) error { | @@ -516,7 +516,7 @@ func SmsCodeSend(phone string) error { | ||
516 | func SmsCodeCheck(phone string, code string) error { | 516 | func SmsCodeCheck(phone string, code string) error { |
517 | resp, err := ucenter.RequestUCenterSmsCodeCheck(phone, code) | 517 | resp, err := ucenter.RequestUCenterSmsCodeCheck(phone, code) |
518 | if err != nil { | 518 | if err != nil { |
519 | - return protocol.NewErrWithMessage("10026") | 519 | + return protocol.NewErrWithMessage("10206") |
520 | } | 520 | } |
521 | //redis 缓存设置 | 521 | //redis 缓存设置 |
522 | redisdata.SetCaptchAuth(phone, resp.Data.CaptchaCertificate) | 522 | redisdata.SetCaptchAuth(phone, resp.Data.CaptchaCertificate) |
@@ -598,21 +598,21 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { | @@ -598,21 +598,21 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { | ||
598 | userdata, err = models.GetUserByPhone(uclientReturn.Data.Phone) | 598 | userdata, err = models.GetUserByPhone(uclientReturn.Data.Phone) |
599 | if err != nil { | 599 | if err != nil { |
600 | log.Debug("GetUserByPhone(%d) err:%s", uclientReturn.Data.Phone, err) | 600 | log.Debug("GetUserByPhone(%d) err:%s", uclientReturn.Data.Phone, err) |
601 | - return logintoken, protocol.NewErrWithMessage("10021") | 601 | + return logintoken, protocol.NewErrWithMessage("10201") |
602 | } | 602 | } |
603 | companyData, err = models.GetCompanyByUCenter(uclientReturn.Data.CompanyId) | 603 | companyData, err = models.GetCompanyByUCenter(uclientReturn.Data.CompanyId) |
604 | if err != nil { | 604 | if err != nil { |
605 | log.Error("获取company数据失败:%s", err) | 605 | log.Error("获取company数据失败:%s", err) |
606 | - return logintoken, protocol.NewErrWithMessage("10111") | 606 | + return logintoken, protocol.NewErrWithMessage("10211") |
607 | } | 607 | } |
608 | if companyData.Enable == models.COMPANY_ENABLE_NO { | 608 | if companyData.Enable == models.COMPANY_ENABLE_NO { |
609 | log.Error("公司未启用机会模块") | 609 | log.Error("公司未启用机会模块") |
610 | - return logintoken, protocol.NewErrWithMessage("10124") | 610 | + return logintoken, protocol.NewErrWithMessage("10212") |
611 | } | 611 | } |
612 | ucompany, err := models.GetUserCompanyBy(userdata.Id, companyData.Id) | 612 | ucompany, err := models.GetUserCompanyBy(userdata.Id, companyData.Id) |
613 | if err != nil { | 613 | if err != nil { |
614 | log.Error("获取user_company失败;%s", err) | 614 | log.Error("获取user_company失败;%s", err) |
615 | - return logintoken, protocol.NewErrWithMessage("10022") | 615 | + return logintoken, protocol.NewErrWithMessage("10202") |
616 | } | 616 | } |
617 | 617 | ||
618 | businessAdminResp, err := serverplatform.GetuserAuthDo(ucompany.Id) | 618 | businessAdminResp, err := serverplatform.GetuserAuthDo(ucompany.Id) |
@@ -630,7 +630,7 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { | @@ -630,7 +630,7 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { | ||
630 | } | 630 | } |
631 | if !businessAdminResp.Data.UserAuth { | 631 | if !businessAdminResp.Data.UserAuth { |
632 | log.Error("用户没有权限进行操作") | 632 | log.Error("用户没有权限进行操作") |
633 | - return logintoken, protocol.NewErrWithMessage("10080") | 633 | + return logintoken, protocol.NewErrWithMessage("10210") |
634 | } | 634 | } |
635 | logintoken, _ = GenerateAuthToken(userdata.Id, companyData.Id, ucompany.Id) | 635 | logintoken, _ = GenerateAuthToken(userdata.Id, companyData.Id, ucompany.Id) |
636 | //更新用户数据 | 636 | //更新用户数据 |
@@ -460,7 +460,7 @@ func OperateBulletin(companyId int64, request *protocol.OperateBulletinRequest) | @@ -460,7 +460,7 @@ func OperateBulletin(companyId int64, request *protocol.OperateBulletinRequest) | ||
460 | return | 460 | return |
461 | } | 461 | } |
462 | if bulletin.CompanyId != companyId { | 462 | if bulletin.CompanyId != companyId { |
463 | - err = protocol.NewErrWithMessage("10027") | 463 | + err = protocol.NewErrWithMessage("10207") |
464 | log.Error("company_id:%v want:%v", companyId, bulletin.CompanyId) | 464 | log.Error("company_id:%v want:%v", companyId, bulletin.CompanyId) |
465 | return | 465 | return |
466 | } | 466 | } |
@@ -527,7 +527,7 @@ func ForbidCompany(ucenterCompany int64) error { | @@ -527,7 +527,7 @@ func ForbidCompany(ucenterCompany int64) error { | ||
527 | companyData, err = models.GetCompanyByUCenter(ucenterCompany) | 527 | companyData, err = models.GetCompanyByUCenter(ucenterCompany) |
528 | if err == orm.ErrNoRows { | 528 | if err == orm.ErrNoRows { |
529 | log.Warn("未查找到公司数据") | 529 | log.Warn("未查找到公司数据") |
530 | - return protocol.NewErrWithMessage("12001") | 530 | + return protocol.NewErrWithMessage("10701") |
531 | } | 531 | } |
532 | if err != nil && err != orm.ErrNoRows { | 532 | if err != nil && err != orm.ErrNoRows { |
533 | log.Error(err.Error()) | 533 | log.Error(err.Error()) |
@@ -553,7 +553,7 @@ func AllowCompany(ucenterCompany int64) error { | @@ -553,7 +553,7 @@ func AllowCompany(ucenterCompany int64) error { | ||
553 | companyData, err = models.GetCompanyByUCenter(ucenterCompany) | 553 | companyData, err = models.GetCompanyByUCenter(ucenterCompany) |
554 | if err == orm.ErrNoRows { | 554 | if err == orm.ErrNoRows { |
555 | log.Warn("未查找到公司数据") | 555 | log.Warn("未查找到公司数据") |
556 | - return protocol.NewErrWithMessage("12001") | 556 | + return protocol.NewErrWithMessage("10701") |
557 | } | 557 | } |
558 | if err != nil && err != orm.ErrNoRows { | 558 | if err != nil && err != orm.ErrNoRows { |
559 | log.Error(err.Error()) | 559 | log.Error(err.Error()) |
@@ -21,7 +21,7 @@ func DepartmentAdd(param protocol.RequestDepartmentAdd) (protocol.ResponseDepart | @@ -21,7 +21,7 @@ func DepartmentAdd(param protocol.RequestDepartmentAdd) (protocol.ResponseDepart | ||
21 | 21 | ||
22 | ok := models.ExistDepartmentName(param.ParentID, param.Name) | 22 | ok := models.ExistDepartmentName(param.ParentID, param.Name) |
23 | if ok { | 23 | if ok { |
24 | - return returndata, protocol.NewErrWithMessage("10045") | 24 | + return returndata, protocol.NewErrWithMessage("10404") |
25 | } | 25 | } |
26 | if param.ParentID > 0 { | 26 | if param.ParentID > 0 { |
27 | parentDepart, err = models.GetDepartmentById(param.ParentID) | 27 | parentDepart, err = models.GetDepartmentById(param.ParentID) |
@@ -39,7 +39,7 @@ func DepartmentAdd(param protocol.RequestDepartmentAdd) (protocol.ResponseDepart | @@ -39,7 +39,7 @@ func DepartmentAdd(param protocol.RequestDepartmentAdd) (protocol.ResponseDepart | ||
39 | r := parentDepart.Relation | 39 | r := parentDepart.Relation |
40 | rs := strings.Split(r, "/") | 40 | rs := strings.Split(r, "/") |
41 | if len(rs) >= 10 { //层级不能超过10级 | 41 | if len(rs) >= 10 { //层级不能超过10级 |
42 | - return returndata, protocol.NewErrWithMessage("10046") | 42 | + return returndata, protocol.NewErrWithMessage("10405") |
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
@@ -107,13 +107,13 @@ func DepartmentEdit(param protocol.RequestDepartmentEdit) error { | @@ -107,13 +107,13 @@ func DepartmentEdit(param protocol.RequestDepartmentEdit) error { | ||
107 | param.ParentID = departUpdate.ParentId | 107 | param.ParentID = departUpdate.ParentId |
108 | } else { | 108 | } else { |
109 | if param.ParentID <= 0 { | 109 | if param.ParentID <= 0 { |
110 | - return protocol.NewErrWithMessage("10048") | 110 | + return protocol.NewErrWithMessage("10407") |
111 | } | 111 | } |
112 | } | 112 | } |
113 | if param.Name != departUpdate.Name { | 113 | if param.Name != departUpdate.Name { |
114 | ok := models.ExistDepartmentName(param.ParentID, param.Name) | 114 | ok := models.ExistDepartmentName(param.ParentID, param.Name) |
115 | if ok { | 115 | if ok { |
116 | - return protocol.NewErrWithMessage("10045") | 116 | + return protocol.NewErrWithMessage("10404") |
117 | } | 117 | } |
118 | } | 118 | } |
119 | //确认部门主管变更情况 | 119 | //确认部门主管变更情况 |
@@ -126,19 +126,19 @@ func DepartmentEdit(param protocol.RequestDepartmentEdit) error { | @@ -126,19 +126,19 @@ func DepartmentEdit(param protocol.RequestDepartmentEdit) error { | ||
126 | if err != nil { | 126 | if err != nil { |
127 | e := fmt.Errorf("GetUserCompanyReal err:%s", err) | 127 | e := fmt.Errorf("GetUserCompanyReal err:%s", err) |
128 | log.Error(e.Error()) | 128 | log.Error(e.Error()) |
129 | - return protocol.NewErrWithMessage("10041") | 129 | + return protocol.NewErrWithMessage("10400") |
130 | } | 130 | } |
131 | for i := range uc { | 131 | for i := range uc { |
132 | if uc[i].CompanyId != param.CompanyID { | 132 | if uc[i].CompanyId != param.CompanyID { |
133 | e := fmt.Errorf("managers err") | 133 | e := fmt.Errorf("managers err") |
134 | log.Error(e.Error()) | 134 | log.Error(e.Error()) |
135 | - return protocol.NewErrWithMessage("10041") | 135 | + return protocol.NewErrWithMessage("10400") |
136 | } | 136 | } |
137 | //检查设置的主管是否是部门下的人员 | 137 | //检查设置的主管是否是部门下的人员 |
138 | ok := models.ExistUserDepart(param.ID, uc[i].Id) | 138 | ok := models.ExistUserDepart(param.ID, uc[i].Id) |
139 | if !ok { | 139 | if !ok { |
140 | log.Error("false=aExistUserDepart(departid,usercompanyid) [%d,%d]", param.ID, uc[i].Id) | 140 | log.Error("false=aExistUserDepart(departid,usercompanyid) [%d,%d]", param.ID, uc[i].Id) |
141 | - return protocol.NewErrWithMessage("10041") | 141 | + return protocol.NewErrWithMessage("10400") |
142 | } | 142 | } |
143 | newManage = append(newManage, uc[i].Id) | 143 | newManage = append(newManage, uc[i].Id) |
144 | } | 144 | } |
@@ -231,7 +231,7 @@ func departmentRelationUpdate(departUpdate *models.Department, newparent *models | @@ -231,7 +231,7 @@ func departmentRelationUpdate(departUpdate *models.Department, newparent *models | ||
231 | o.Rollback() | 231 | o.Rollback() |
232 | e := fmt.Errorf("departSubset[i].Id == newparent.Id") | 232 | e := fmt.Errorf("departSubset[i].Id == newparent.Id") |
233 | log.Error(e.Error()) | 233 | log.Error(e.Error()) |
234 | - return protocol.NewErrWithMessage("10042") | 234 | + return protocol.NewErrWithMessage("10401") |
235 | } | 235 | } |
236 | s := strings.TrimPrefix(departSubset[i].Relation, oldRelation) | 236 | s := strings.TrimPrefix(departSubset[i].Relation, oldRelation) |
237 | //重建关系树 | 237 | //重建关系树 |
@@ -240,7 +240,7 @@ func departmentRelationUpdate(departUpdate *models.Department, newparent *models | @@ -240,7 +240,7 @@ func departmentRelationUpdate(departUpdate *models.Department, newparent *models | ||
240 | n := strings.Split(departSubset[i].Relation, "/") | 240 | n := strings.Split(departSubset[i].Relation, "/") |
241 | if len(n) > 10 { | 241 | if len(n) > 10 { |
242 | o.Rollback() | 242 | o.Rollback() |
243 | - return protocol.NewErrWithMessage("10046") | 243 | + return protocol.NewErrWithMessage("10405") |
244 | } | 244 | } |
245 | err = utils.ExecuteSQLWithOrmer(o, dataSql2, departSubset[i].Relation, departSubset[i].Id) | 245 | err = utils.ExecuteSQLWithOrmer(o, dataSql2, departSubset[i].Relation, departSubset[i].Id) |
246 | if err != nil { | 246 | if err != nil { |
@@ -306,7 +306,7 @@ func DepartmentDelete(param protocol.RequestDepartmentDelete) error { | @@ -306,7 +306,7 @@ func DepartmentDelete(param protocol.RequestDepartmentDelete) error { | ||
306 | if cnt > 0 { | 306 | if cnt > 0 { |
307 | e := fmt.Errorf("user in department,relation:%s", subset.Relation) | 307 | e := fmt.Errorf("user in department,relation:%s", subset.Relation) |
308 | log.Error(e.Error()) | 308 | log.Error(e.Error()) |
309 | - return protocol.NewErrWithMessage("10047", e) | 309 | + return protocol.NewErrWithMessage("10406", e) |
310 | } | 310 | } |
311 | if _, ok := toDelete[subset.Id]; ok && subset.Id != pos.Id { | 311 | if _, ok := toDelete[subset.Id]; ok && subset.Id != pos.Id { |
312 | delete(toDelete, subset.Id) | 312 | delete(toDelete, subset.Id) |
@@ -30,7 +30,7 @@ func PositionAdd(param protocol.RequestPositionAdd) (*protocol.ResponsePositionI | @@ -30,7 +30,7 @@ func PositionAdd(param protocol.RequestPositionAdd) (*protocol.ResponsePositionI | ||
30 | } | 30 | } |
31 | ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name) | 31 | ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name) |
32 | if ok { | 32 | if ok { |
33 | - return nil, protocol.NewErrWithMessage("10013") | 33 | + return nil, protocol.NewErrWithMessage("10103") |
34 | } | 34 | } |
35 | //检查上级 | 35 | //检查上级 |
36 | if param.ParentID > 0 { | 36 | if param.ParentID > 0 { |
@@ -48,7 +48,7 @@ func PositionAdd(param protocol.RequestPositionAdd) (*protocol.ResponsePositionI | @@ -48,7 +48,7 @@ func PositionAdd(param protocol.RequestPositionAdd) (*protocol.ResponsePositionI | ||
48 | r := parentPosition.Relation | 48 | r := parentPosition.Relation |
49 | rs := strings.Split(r, "/") | 49 | rs := strings.Split(r, "/") |
50 | if len(rs) >= 10 { //层级不能超过10级 | 50 | if len(rs) >= 10 { //层级不能超过10级 |
51 | - return nil, protocol.NewErrWithMessage("10012") | 51 | + return nil, protocol.NewErrWithMessage("10102") |
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 | ||
@@ -109,7 +109,7 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio | @@ -109,7 +109,7 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio | ||
109 | if positionUpdate.Name != param.Name { | 109 | if positionUpdate.Name != param.Name { |
110 | ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name) | 110 | ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name) |
111 | if ok { | 111 | if ok { |
112 | - return nil, protocol.NewErrWithMessage("10013") | 112 | + return nil, protocol.NewErrWithMessage("10103") |
113 | } | 113 | } |
114 | positionUpdate.Name = param.Name | 114 | positionUpdate.Name = param.Name |
115 | } | 115 | } |
@@ -136,14 +136,14 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio | @@ -136,14 +136,14 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio | ||
136 | r := parentPosition.Relation | 136 | r := parentPosition.Relation |
137 | rs := strings.Split(r, "/") | 137 | rs := strings.Split(r, "/") |
138 | if len(rs) >= 10 { //层级不能超过10级 | 138 | if len(rs) >= 10 { //层级不能超过10级 |
139 | - return nil, protocol.NewErrWithMessage("10012") | 139 | + return nil, protocol.NewErrWithMessage("10102") |
140 | } | 140 | } |
141 | } | 141 | } |
142 | //更新部门关系数据 | 142 | //更新部门关系数据 |
143 | if positionUpdate.ParentId != param.ParentID { | 143 | if positionUpdate.ParentId != param.ParentID { |
144 | ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name) | 144 | ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name) |
145 | if ok { | 145 | if ok { |
146 | - return nil, protocol.NewErrWithMessage("10013") | 146 | + return nil, protocol.NewErrWithMessage("10103") |
147 | } | 147 | } |
148 | err = positionRelationUpdate(positionUpdate, parentPosition) | 148 | err = positionRelationUpdate(positionUpdate, parentPosition) |
149 | if err != nil { | 149 | if err != nil { |
@@ -213,7 +213,7 @@ func positionRelationUpdate(positionUpdate *models.Position, newparent *models.P | @@ -213,7 +213,7 @@ func positionRelationUpdate(positionUpdate *models.Position, newparent *models.P | ||
213 | o.Rollback() | 213 | o.Rollback() |
214 | e := fmt.Errorf("departSubset[i].Id == newparent.Id") | 214 | e := fmt.Errorf("departSubset[i].Id == newparent.Id") |
215 | log.Error(e.Error()) | 215 | log.Error(e.Error()) |
216 | - return protocol.NewErrWithMessage("10015", e) | 216 | + return protocol.NewErrWithMessage("10105", e) |
217 | } | 217 | } |
218 | //重建关系树 | 218 | //重建关系树 |
219 | s := strings.TrimPrefix(positionSubset[i].Relation, oldRelation) | 219 | s := strings.TrimPrefix(positionSubset[i].Relation, oldRelation) |
@@ -221,7 +221,7 @@ func positionRelationUpdate(positionUpdate *models.Position, newparent *models.P | @@ -221,7 +221,7 @@ func positionRelationUpdate(positionUpdate *models.Position, newparent *models.P | ||
221 | rs := strings.Split(positionSubset[i].Relation, "/") | 221 | rs := strings.Split(positionSubset[i].Relation, "/") |
222 | if len(rs) > 10 { //层级不能超过10级 | 222 | if len(rs) > 10 { //层级不能超过10级 |
223 | o.Rollback() | 223 | o.Rollback() |
224 | - return protocol.NewErrWithMessage("10012") | 224 | + return protocol.NewErrWithMessage("10102") |
225 | } | 225 | } |
226 | err = utils.ExecuteSQLWithOrmer(o, dataSql2, positionSubset[i].Relation, positionSubset[i].Id) | 226 | err = utils.ExecuteSQLWithOrmer(o, dataSql2, positionSubset[i].Relation, positionSubset[i].Id) |
227 | if err != nil { | 227 | if err != nil { |
@@ -283,7 +283,7 @@ func PositionDelete(param protocol.RequestPositionDelete) error { | @@ -283,7 +283,7 @@ func PositionDelete(param protocol.RequestPositionDelete) error { | ||
283 | if cnt > 0 { | 283 | if cnt > 0 { |
284 | e := fmt.Errorf("user in position,relation:%s", subset.Relation) | 284 | e := fmt.Errorf("user in position,relation:%s", subset.Relation) |
285 | log.Error(e.Error()) | 285 | log.Error(e.Error()) |
286 | - return protocol.NewErrWithMessage("10011", e) | 286 | + return protocol.NewErrWithMessage("10101", e) |
287 | } | 287 | } |
288 | if _, ok := toDelete[subset.Id]; ok && subset.Id != pos.Id { | 288 | if _, ok := toDelete[subset.Id]; ok && subset.Id != pos.Id { |
289 | delete(toDelete, subset.Id) | 289 | delete(toDelete, subset.Id) |
@@ -103,7 +103,7 @@ func validCompanyRole(companyid int64, roleid []int64) error { | @@ -103,7 +103,7 @@ func validCompanyRole(companyid int64, roleid []int64) error { | ||
103 | if err != nil { | 103 | if err != nil { |
104 | e := fmt.Errorf("ValidCompanyRole err:%s [company:%d,role:%d]", err, companyid, v) | 104 | e := fmt.Errorf("ValidCompanyRole err:%s [company:%d,role:%d]", err, companyid, v) |
105 | log.Error(e.Error()) | 105 | log.Error(e.Error()) |
106 | - return protocol.NewErrWithMessage("10031") | 106 | + return protocol.NewErrWithMessage("10301") |
107 | } | 107 | } |
108 | } | 108 | } |
109 | return nil | 109 | return nil |
@@ -123,7 +123,7 @@ func validCompanyDepart(companyid int64, departid []int64) error { | @@ -123,7 +123,7 @@ func validCompanyDepart(companyid int64, departid []int64) error { | ||
123 | if err != nil { | 123 | if err != nil { |
124 | e := fmt.Errorf("ValidCompanyDepart err:%s [company:%d,department:%d]", err, companyid, v) | 124 | e := fmt.Errorf("ValidCompanyDepart err:%s [company:%d,department:%d]", err, companyid, v) |
125 | log.Error(e.Error()) | 125 | log.Error(e.Error()) |
126 | - return protocol.NewErrWithMessage("10032") | 126 | + return protocol.NewErrWithMessage("10302") |
127 | } | 127 | } |
128 | 128 | ||
129 | } | 129 | } |
@@ -145,7 +145,7 @@ func validCompanyPosition(companyid int64, positionid []int64) error { | @@ -145,7 +145,7 @@ func validCompanyPosition(companyid int64, positionid []int64) error { | ||
145 | if err != nil { | 145 | if err != nil { |
146 | e := fmt.Errorf("ValidCompanyPosition err:%s [company:%d,department:%d]", err, companyid, v) | 146 | e := fmt.Errorf("ValidCompanyPosition err:%s [company:%d,department:%d]", err, companyid, v) |
147 | log.Error(e.Error()) | 147 | log.Error(e.Error()) |
148 | - return protocol.NewErrWithMessage("10033") | 148 | + return protocol.NewErrWithMessage("10303") |
149 | } | 149 | } |
150 | 150 | ||
151 | } | 151 | } |
@@ -164,7 +164,7 @@ func existCompanyUser(companyid int64, phone string) error { | @@ -164,7 +164,7 @@ func existCompanyUser(companyid int64, phone string) error { | ||
164 | 164 | ||
165 | ok := models.ExistUserCompany(userdata.Id, companyid) | 165 | ok := models.ExistUserCompany(userdata.Id, companyid) |
166 | if ok { | 166 | if ok { |
167 | - return protocol.NewErrWithMessage("10039") | 167 | + return protocol.NewErrWithMessage("10309") |
168 | } | 168 | } |
169 | return nil | 169 | return nil |
170 | } | 170 | } |
@@ -470,14 +470,14 @@ func UserDelete(userCompanyids []int64, companyid int64) error { | @@ -470,14 +470,14 @@ func UserDelete(userCompanyids []int64, companyid int64) error { | ||
470 | Filter("review_status__in", models.AuditFlowProcessReviewWait, models.AuditFlowProcessReviewIng). | 470 | Filter("review_status__in", models.AuditFlowProcessReviewWait, models.AuditFlowProcessReviewIng). |
471 | Exist() | 471 | Exist() |
472 | if exist { | 472 | if exist { |
473 | - return protocol.NewErrWithMessage("10074") | 473 | + return protocol.NewErrWithMessage("10313") |
474 | } | 474 | } |
475 | var ( | 475 | var ( |
476 | ids []int64 | 476 | ids []int64 |
477 | ) | 477 | ) |
478 | for _, v := range updateIds { | 478 | for _, v := range updateIds { |
479 | if v.UserId == companyInfo.AdminId { | 479 | if v.UserId == companyInfo.AdminId { |
480 | - return protocol.NewErrWithMessage("10071") | 480 | + return protocol.NewErrWithMessage("10310") |
481 | } | 481 | } |
482 | ids = append(ids, v.Id) | 482 | ids = append(ids, v.Id) |
483 | } | 483 | } |
@@ -671,14 +671,14 @@ func UserForbid(userCompanyids []int64, companyid int64) error { | @@ -671,14 +671,14 @@ func UserForbid(userCompanyids []int64, companyid int64) error { | ||
671 | Filter("review_status__in", models.AuditFlowProcessReviewWait, models.AuditFlowProcessReviewIng). | 671 | Filter("review_status__in", models.AuditFlowProcessReviewWait, models.AuditFlowProcessReviewIng). |
672 | Exist() | 672 | Exist() |
673 | if exist { | 673 | if exist { |
674 | - return protocol.NewErrWithMessage("10075") | 674 | + return protocol.NewErrWithMessage("10314") |
675 | } | 675 | } |
676 | var ( | 676 | var ( |
677 | ids []int64 | 677 | ids []int64 |
678 | ) | 678 | ) |
679 | for _, v := range updateIds { | 679 | for _, v := range updateIds { |
680 | if v.UserId == companyInfo.AdminId { | 680 | if v.UserId == companyInfo.AdminId { |
681 | - return protocol.NewErrWithMessage("10072") | 681 | + return protocol.NewErrWithMessage("10311") |
682 | } | 682 | } |
683 | ids = append(ids, v.Id) | 683 | ids = append(ids, v.Id) |
684 | } | 684 | } |
@@ -30,7 +30,7 @@ func ConfigScore(uid, companyId int64, request *protocol.ConfigScoreRequest) (rs | @@ -30,7 +30,7 @@ func ConfigScore(uid, companyId int64, request *protocol.ConfigScoreRequest) (rs | ||
30 | return | 30 | return |
31 | } | 31 | } |
32 | if scoreConfig.CompanyId != int(companyId) { | 32 | if scoreConfig.CompanyId != int(companyId) { |
33 | - err = protocol.NewErrWithMessage("10027") //无权限 | 33 | + err = protocol.NewErrWithMessage("10207") //无权限 |
34 | return | 34 | return |
35 | } | 35 | } |
36 | goto UPDATE | 36 | goto UPDATE |
@@ -38,26 +38,26 @@ func ConfigScore(uid, companyId int64, request *protocol.ConfigScoreRequest) (rs | @@ -38,26 +38,26 @@ func ConfigScore(uid, companyId int64, request *protocol.ConfigScoreRequest) (rs | ||
38 | return | 38 | return |
39 | } | 39 | } |
40 | if !(checkScoreRange(request.BasicScore) && checkScoreRange(request.ExtraScore) && checkScoreRange(request.ValueScore)) { | 40 | if !(checkScoreRange(request.BasicScore) && checkScoreRange(request.ExtraScore) && checkScoreRange(request.ValueScore)) { |
41 | - err = protocol.NewErrWithMessage("12101") | 41 | + err = protocol.NewErrWithMessage("10801") |
42 | return | 42 | return |
43 | } | 43 | } |
44 | if request.DiscoveryScore != nil { | 44 | if request.DiscoveryScore != nil { |
45 | c := request.DiscoveryScore | 45 | c := request.DiscoveryScore |
46 | if !(checkFactor(c.BasicFactor) && checkFactor(c.ExtraFactor) && checkFactor(c.ValueFactor)) { | 46 | if !(checkFactor(c.BasicFactor) && checkFactor(c.ExtraFactor) && checkFactor(c.ValueFactor)) { |
47 | - err = protocol.NewErrWithMessage("12102") | 47 | + err = protocol.NewErrWithMessage("10802") |
48 | return | 48 | return |
49 | } | 49 | } |
50 | } else { | 50 | } else { |
51 | - err = protocol.NewErrWithMessage("12102") | 51 | + err = protocol.NewErrWithMessage("10802") |
52 | return | 52 | return |
53 | } | 53 | } |
54 | if request.SumScore != nil { | 54 | if request.SumScore != nil { |
55 | if !(checkSumScoreFactor(request.SumScore.DiscoveryFactor) && checkSumScoreFactor(request.SumScore.CatchFactor)) { | 55 | if !(checkSumScoreFactor(request.SumScore.DiscoveryFactor) && checkSumScoreFactor(request.SumScore.CatchFactor)) { |
56 | - err = protocol.NewErrWithMessage("12102") | 56 | + err = protocol.NewErrWithMessage("10802") |
57 | return | 57 | return |
58 | } | 58 | } |
59 | } else { | 59 | } else { |
60 | - err = protocol.NewErrWithMessage("12102") | 60 | + err = protocol.NewErrWithMessage("10802") |
61 | return | 61 | return |
62 | } | 62 | } |
63 | if scoreConfig, err = models.GetSysConfigByCompanyId(int(companyId), models.KeyScore); err != nil { | 63 | if scoreConfig, err = models.GetSysConfigByCompanyId(int(companyId), models.KeyScore); err != nil { |
@@ -113,7 +113,7 @@ func GetConfigScore(uid, companyId int64, request *protocol.GetConfigScoreReques | @@ -113,7 +113,7 @@ func GetConfigScore(uid, companyId int64, request *protocol.GetConfigScoreReques | ||
113 | 113 | ||
114 | //检查分值范围 | 114 | //检查分值范围 |
115 | func checkScoreRange(scoreRange *protocol.ScoreRange) (result bool) { | 115 | func checkScoreRange(scoreRange *protocol.ScoreRange) (result bool) { |
116 | - //err = protocol.NewErrWithMessage("12101") | 116 | + //err = protocol.NewErrWithMessage("10801") |
117 | result = false | 117 | result = false |
118 | if scoreRange.Min < 0 { | 118 | if scoreRange.Min < 0 { |
119 | return | 119 | return |
@@ -135,7 +135,7 @@ func checkScoreRange(scoreRange *protocol.ScoreRange) (result bool) { | @@ -135,7 +135,7 @@ func checkScoreRange(scoreRange *protocol.ScoreRange) (result bool) { | ||
135 | //检查发现分计算规则 | 135 | //检查发现分计算规则 |
136 | func checkFactor(factor float64) (result bool) { | 136 | func checkFactor(factor float64) (result bool) { |
137 | result = false | 137 | result = false |
138 | - //err = protocol.NewErrWithMessage("12102") | 138 | + //err = protocol.NewErrWithMessage("10802") |
139 | if factor < 0.1 || factor > 1 { | 139 | if factor < 0.1 || factor > 1 { |
140 | return | 140 | return |
141 | } | 141 | } |
@@ -147,7 +147,7 @@ func checkFactor(factor float64) (result bool) { | @@ -147,7 +147,7 @@ func checkFactor(factor float64) (result bool) { | ||
147 | //检查总分计算规则 | 147 | //检查总分计算规则 |
148 | func checkSumScoreFactor(factor float64) (result bool) { | 148 | func checkSumScoreFactor(factor float64) (result bool) { |
149 | result = false | 149 | result = false |
150 | - //err = protocol.NewErrWithMessage("12102") | 150 | + //err = protocol.NewErrWithMessage("10802") |
151 | if factor < 0.1 || factor > 10 { | 151 | if factor < 0.1 || factor > 10 { |
152 | return | 152 | return |
153 | } | 153 | } |
@@ -38,7 +38,7 @@ func (client BusinessAdminClient) buildHeader() http.Header { | @@ -38,7 +38,7 @@ func (client BusinessAdminClient) buildHeader() http.Header { | ||
38 | //httpDo post发送json | 38 | //httpDo post发送json |
39 | func (client BusinessAdminClient) httpDo(path string, mathod string, posts []byte) ([]byte, error) { | 39 | func (client BusinessAdminClient) httpDo(path string, mathod string, posts []byte) ([]byte, error) { |
40 | httpclient := http.Client{ | 40 | httpclient := http.Client{ |
41 | - Timeout: 10 * time.Second, //请求超时时间5秒 | 41 | + Timeout: 10 * time.Second, //请求超时时间10秒 |
42 | } | 42 | } |
43 | reqURL := client.baseUrl + path | 43 | reqURL := client.baseUrl + path |
44 | req, err := http.NewRequest(mathod, reqURL, bytes.NewReader(posts)) | 44 | req, err := http.NewRequest(mathod, reqURL, bytes.NewReader(posts)) |
@@ -448,7 +448,7 @@ func EditRankRange(id int64, name string, rangetype int8, relationId []int64, co | @@ -448,7 +448,7 @@ func EditRankRange(id int64, name string, rangetype int8, relationId []int64, co | ||
448 | } | 448 | } |
449 | ok := RankRangeNameOnlyOne(rankRange.RankTypeId, rankRange.Id, name) | 449 | ok := RankRangeNameOnlyOne(rankRange.RankTypeId, rankRange.Id, name) |
450 | if !ok { | 450 | if !ok { |
451 | - return protocol.NewErrWithMessage("10125") | 451 | + return protocol.NewErrWithMessage("11009") |
452 | } | 452 | } |
453 | rankRangeDatas, err = models.GetRankRangeDataByRangeId(rankRange.Id) | 453 | rankRangeDatas, err = models.GetRankRangeDataByRangeId(rankRange.Id) |
454 | if err != nil { | 454 | if err != nil { |
@@ -825,7 +825,7 @@ func RankRangeMove(fromId int64, toId int64, relationId []int64, companyid int64 | @@ -825,7 +825,7 @@ func RankRangeMove(fromId int64, toId int64, relationId []int64, companyid int64 | ||
825 | } | 825 | } |
826 | if fromTypeFlag != ToTypeFlag { | 826 | if fromTypeFlag != ToTypeFlag { |
827 | log.Error("RankRange类型不一致") | 827 | log.Error("RankRange类型不一致") |
828 | - return protocol.NewErrWithMessage("10102") | 828 | + return protocol.NewErrWithMessage("11002") |
829 | } | 829 | } |
830 | 830 | ||
831 | var ( | 831 | var ( |
@@ -221,7 +221,7 @@ func UpdateSetOpportunity(param OptionOpportunity, roleid int64, companyid int64 | @@ -221,7 +221,7 @@ func UpdateSetOpportunity(param OptionOpportunity, roleid int64, companyid int64 | ||
221 | 221 | ||
222 | if param.Check == OpportunityCheckLv3 { | 222 | if param.Check == OpportunityCheckLv3 { |
223 | if len(param.CheckOption.Departments) == 0 { | 223 | if len(param.CheckOption.Departments) == 0 { |
224 | - return protocol.NewErrWithMessage("10091") | 224 | + return protocol.NewErrWithMessage("10901") |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 |
@@ -189,7 +189,7 @@ func RoleGroupEdit(companyid int64, id int64, name string) (*protocol.ResponseRo | @@ -189,7 +189,7 @@ func RoleGroupEdit(companyid int64, id int64, name string) (*protocol.ResponseRo | ||
189 | if roleinfo.Name != name { | 189 | if roleinfo.Name != name { |
190 | ok := models.ExistRoleName(companyid, name, models.ROLETYPES_GROUP) | 190 | ok := models.ExistRoleName(companyid, name, models.ROLETYPES_GROUP) |
191 | if ok { | 191 | if ok { |
192 | - return nil, protocol.NewErrWithMessage("10073") | 192 | + return nil, protocol.NewErrWithMessage("10312") |
193 | } | 193 | } |
194 | roleinfo.Name = name | 194 | roleinfo.Name = name |
195 | } | 195 | } |
@@ -30,7 +30,7 @@ func RequestUCenterLogin(account, password string) (*ResponseLogin, error) { | @@ -30,7 +30,7 @@ func RequestUCenterLogin(account, password string) (*ResponseLogin, error) { | ||
30 | return nil, protocol.NewErrWithMessage("1") | 30 | return nil, protocol.NewErrWithMessage("1") |
31 | } | 31 | } |
32 | if !(uclientReturn.Code == ResponseCodeOk) { | 32 | if !(uclientReturn.Code == ResponseCodeOk) { |
33 | - return nil, protocol.NewErrWithMessage("10052") | 33 | + return nil, protocol.NewErrWithMessage("10502") |
34 | } | 34 | } |
35 | return &uclientReturn, nil | 35 | return &uclientReturn, nil |
36 | } | 36 | } |
@@ -86,7 +86,7 @@ func RequestUCenterAddUser(phone string, nickname string, avatar string) (*Respo | @@ -86,7 +86,7 @@ func RequestUCenterAddUser(phone string, nickname string, avatar string) (*Respo | ||
86 | return nil, protocol.NewErrWithMessage("1") | 86 | return nil, protocol.NewErrWithMessage("1") |
87 | } | 87 | } |
88 | if !(ucenterReturn.Code == ResponseCodeOk) { | 88 | if !(ucenterReturn.Code == ResponseCodeOk) { |
89 | - return nil, protocol.NewErrWithMessage("10052") | 89 | + return nil, protocol.NewErrWithMessage("10502") |
90 | } | 90 | } |
91 | return &ucenterReturn, nil | 91 | return &ucenterReturn, nil |
92 | } | 92 | } |
@@ -112,7 +112,7 @@ func RequestUCenterSmsCode(phone string) error { | @@ -112,7 +112,7 @@ func RequestUCenterSmsCode(phone string) error { | ||
112 | return protocol.NewErrWithMessage("1") | 112 | return protocol.NewErrWithMessage("1") |
113 | } | 113 | } |
114 | if !(ucenterReturn.Code == ResponseCodeOk) { | 114 | if !(ucenterReturn.Code == ResponseCodeOk) { |
115 | - return protocol.NewErrWithMessage("10052") | 115 | + return protocol.NewErrWithMessage("10502") |
116 | } | 116 | } |
117 | return nil | 117 | return nil |
118 | } | 118 | } |
@@ -137,7 +137,7 @@ func RequestUCenterLoginSms(phone string, captcha string) (*ResponseLoginSms, er | @@ -137,7 +137,7 @@ func RequestUCenterLoginSms(phone string, captcha string) (*ResponseLoginSms, er | ||
137 | return nil, protocol.NewErrWithMessage("1") | 137 | return nil, protocol.NewErrWithMessage("1") |
138 | } | 138 | } |
139 | if !(ucenterReturn.Code == ResponseCodeOk) { | 139 | if !(ucenterReturn.Code == ResponseCodeOk) { |
140 | - return &ucenterReturn, protocol.NewErrWithMessage("10052") | 140 | + return &ucenterReturn, protocol.NewErrWithMessage("10502") |
141 | } | 141 | } |
142 | return &ucenterReturn, nil | 142 | return &ucenterReturn, nil |
143 | } | 143 | } |
@@ -160,7 +160,7 @@ func RequestUCenterSmsCodeCheck(phone string, captcha string) (*ResponseSmsCodeC | @@ -160,7 +160,7 @@ func RequestUCenterSmsCodeCheck(phone string, captcha string) (*ResponseSmsCodeC | ||
160 | return nil, protocol.NewErrWithMessage("1") | 160 | return nil, protocol.NewErrWithMessage("1") |
161 | } | 161 | } |
162 | if !(ucenterReturn.Code == ResponseCodeOk) { | 162 | if !(ucenterReturn.Code == ResponseCodeOk) { |
163 | - return &ucenterReturn, protocol.NewErrWithMessage("10026") | 163 | + return &ucenterReturn, protocol.NewErrWithMessage("10206") |
164 | } | 164 | } |
165 | return &ucenterReturn, nil | 165 | return &ucenterReturn, nil |
166 | } | 166 | } |
@@ -185,7 +185,7 @@ func RequestUCenterRestPassword(phone, newPwd, confirmPwd, certificate string) e | @@ -185,7 +185,7 @@ func RequestUCenterRestPassword(phone, newPwd, confirmPwd, certificate string) e | ||
185 | return protocol.NewErrWithMessage("1") | 185 | return protocol.NewErrWithMessage("1") |
186 | } | 186 | } |
187 | if !(ucenterReturn.Code == ResponseCodeOk) { | 187 | if !(ucenterReturn.Code == ResponseCodeOk) { |
188 | - return protocol.NewErrWithMessage("10052") | 188 | + return protocol.NewErrWithMessage("10502") |
189 | } | 189 | } |
190 | 190 | ||
191 | return nil | 191 | return nil |
@@ -17,7 +17,7 @@ func ResetPasswordBySms(phone string, newPwd string, confirmPwd string) error { | @@ -17,7 +17,7 @@ func ResetPasswordBySms(phone string, newPwd string, confirmPwd string) error { | ||
17 | certificate, err = redisdata.GetCaptchAuth(phone) | 17 | certificate, err = redisdata.GetCaptchAuth(phone) |
18 | if err != nil { | 18 | if err != nil { |
19 | log.Error("从redis获取凭证失败:%s", err) | 19 | log.Error("从redis获取凭证失败:%s", err) |
20 | - return protocol.NewErrWithMessage("10020") | 20 | + return protocol.NewErrWithMessage("10200") |
21 | } | 21 | } |
22 | err = ucenter.RequestUCenterRestPassword(phone, newPwd, confirmPwd, certificate) | 22 | err = ucenter.RequestUCenterRestPassword(phone, newPwd, confirmPwd, certificate) |
23 | if err != nil { | 23 | if err != nil { |
-
请 注册 或 登录 后发表评论