|
@@ -49,6 +49,16 @@ func (c AchievementController) AddAchievement() { |
|
@@ -49,6 +49,16 @@ func (c AchievementController) AddAchievement() { |
49
|
msg = protocol.BadRequestParam("1")
|
49
|
msg = protocol.BadRequestParam("1")
|
50
|
return
|
50
|
return
|
51
|
}
|
51
|
}
|
|
|
52
|
+ if len(param.ChanceData) == 0 {
|
|
|
53
|
+ log.Error("len(param.ChanceData) == 0 ")
|
|
|
54
|
+ msg = protocol.BadRequestParam("10109")
|
|
|
55
|
+ return
|
|
|
56
|
+ }
|
|
|
57
|
+ if param.ChanceTypeId == 0 {
|
|
|
58
|
+ log.Error(" param.ChanceTypeId == 0 ")
|
|
|
59
|
+ msg = protocol.BadRequestParam("10108")
|
|
|
60
|
+ return
|
|
|
61
|
+ }
|
52
|
companyid := c.GetCompanyId()
|
62
|
companyid := c.GetCompanyId()
|
53
|
err := serveachievement.AddAchievement(¶m, companyid)
|
63
|
err := serveachievement.AddAchievement(¶m, companyid)
|
54
|
msg = protocol.NewReturnResponse(nil, err)
|
64
|
msg = protocol.NewReturnResponse(nil, err)
|
|
@@ -69,6 +79,16 @@ func (c AchievementController) EditAchievement() { |
|
@@ -69,6 +79,16 @@ func (c AchievementController) EditAchievement() { |
69
|
msg = protocol.BadRequestParam("1")
|
79
|
msg = protocol.BadRequestParam("1")
|
70
|
return
|
80
|
return
|
71
|
}
|
81
|
}
|
|
|
82
|
+ if len(param.ChanceData) == 0 {
|
|
|
83
|
+ log.Error("len(param.ChanceData) == 0 ")
|
|
|
84
|
+ msg = protocol.BadRequestParam("10109")
|
|
|
85
|
+ return
|
|
|
86
|
+ }
|
|
|
87
|
+ if param.ChanceTypeId == 0 {
|
|
|
88
|
+ log.Error(" param.ChanceTypeId == 0 ")
|
|
|
89
|
+ msg = protocol.BadRequestParam("10108")
|
|
|
90
|
+ return
|
|
|
91
|
+ }
|
72
|
companyid := c.GetCompanyId()
|
92
|
companyid := c.GetCompanyId()
|
73
|
err := serveachievement.EditAchievement(¶m, companyid)
|
93
|
err := serveachievement.EditAchievement(¶m, companyid)
|
74
|
msg = protocol.NewReturnResponse(nil, err)
|
94
|
msg = protocol.NewReturnResponse(nil, err)
|