|
@@ -53,12 +53,12 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
case "a": //立即生效
|
|
case "a": //立即生效
|
|
creditDoc["i_score"] = Score[param.Code]
|
|
creditDoc["i_score"] = Score[param.Code]
|
|
if creditlog.Save(creditDoc) {
|
|
if creditlog.Save(creditDoc) {
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
case "d", "e":
|
|
case "d", "e":
|
|
creditDoc["i_score"] = util.If(param.Num > 0, param.Num, Score[param.Code]).(int)
|
|
creditDoc["i_score"] = util.If(param.Num > 0, param.Num, Score[param.Code]).(int)
|
|
if creditlog.Save(creditDoc) {
|
|
if creditlog.Save(creditDoc) {
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
case "b":
|
|
case "b":
|
|
key := param.Code + "_" + param.Uid
|
|
key := param.Code + "_" + param.Uid
|
|
@@ -86,7 +86,7 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
redis.Put(consts.RedisDB, key, newobj, GetSubSecond(int(newobj[2]-thist)))
|
|
redis.Put(consts.RedisDB, key, newobj, GetSubSecond(int(newobj[2]-thist)))
|
|
redis.Put(consts.RedisDB, daykey, true, GetSubSecond(1))
|
|
redis.Put(consts.RedisDB, daykey, true, GetSubSecond(1))
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(creditDoc)
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
} else {
|
|
} else {
|
|
//不是连续签到
|
|
//不是连续签到
|
|
bcon = false
|
|
bcon = false
|
|
@@ -104,7 +104,7 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
redis.Put(consts.RedisDB, key, newobj, GetSubSecond(int(newobj[2])))
|
|
redis.Put(consts.RedisDB, key, newobj, GetSubSecond(int(newobj[2])))
|
|
redis.Put(consts.RedisDB, daykey, true, GetSubSecond(1))
|
|
redis.Put(consts.RedisDB, daykey, true, GetSubSecond(1))
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(creditDoc)
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -119,7 +119,7 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
redis.Put(consts.RedisDB, key, newobj, GetSubSecond(1))
|
|
redis.Put(consts.RedisDB, key, newobj, GetSubSecond(1))
|
|
creditDoc["i_score"] = Score[param.Code]
|
|
creditDoc["i_score"] = Score[param.Code]
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(creditDoc)
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
times := Score[param.Code+"_n"]
|
|
times := Score[param.Code+"_n"]
|
|
@@ -131,7 +131,7 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
creditDoc["i_score"] = Score[param.Code]
|
|
creditDoc["i_score"] = Score[param.Code]
|
|
redis.Put(consts.RedisDB, key, newobj, GetSubSecond(1))
|
|
redis.Put(consts.RedisDB, key, newobj, GetSubSecond(1))
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(creditDoc)
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
lock.Unlock()
|
|
lock.Unlock()
|
|
@@ -157,7 +157,7 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(newDoc)
|
|
creditlog.AddLog(newDoc)
|
|
redis.Put(consts.RedisDB, key, true, GetSubSecond(1))
|
|
redis.Put(consts.RedisDB, key, true, GetSubSecond(1))
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if param.Code == "c2" { //评价
|
|
} else if param.Code == "c2" { //评价
|
|
@@ -169,14 +169,14 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
creditDoc["o_param"] = param.OtherParam
|
|
creditDoc["o_param"] = param.OtherParam
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(creditDoc)
|
|
redis.Put(consts.RedisDB, key, true, GetSubSecond(1))
|
|
redis.Put(consts.RedisDB, key, true, GetSubSecond(1))
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
creditDoc["i_score"] = Score[param.Code]
|
|
creditDoc["i_score"] = Score[param.Code]
|
|
creditDoc["o_param"] = param.OtherParam
|
|
creditDoc["o_param"] = param.OtherParam
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(creditDoc)
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
lock.Unlock()
|
|
lock.Unlock()
|
|
default: //定时任务
|
|
default: //定时任务
|
|
@@ -184,7 +184,7 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
if sc > 0 {
|
|
if sc > 0 {
|
|
creditDoc["i_score"] = sc
|
|
creditDoc["i_score"] = sc
|
|
creditlog.AddLog(creditDoc)
|
|
creditlog.AddLog(creditDoc)
|
|
- *replay = 1
|
|
|
|
|
|
+ *replay = creditDoc["i_score"].(int)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|