|
@@ -403,14 +403,21 @@ func (e *EnvItem) IncreAdjust(expire time.Duration) (int64, error) {
|
|
|
return intCmd.Val(), nil
|
|
|
}
|
|
|
|
|
|
-func (e *EnvItem) SetValue(o, v string) error {
|
|
|
+func (e *EnvItem) SetValue(o, v string, ct ...int64) error {
|
|
|
ts := time.Now().Unix()
|
|
|
+
|
|
|
+ var commandType int64
|
|
|
+ if len(ct) > 0 {
|
|
|
+ commandType = ct[0]
|
|
|
+ }
|
|
|
+
|
|
|
data := make(SetCurrentsReq, 1)
|
|
|
data[0] = SetCurrentReq{
|
|
|
- ProjectId: e.ProjectId,
|
|
|
- Item: e.Item,
|
|
|
- OldValue: o,
|
|
|
- NewValue: v,
|
|
|
+ ProjectId: e.ProjectId,
|
|
|
+ Item: e.Item,
|
|
|
+ OldValue: o,
|
|
|
+ NewValue: v,
|
|
|
+ CommandType: commandType,
|
|
|
}
|
|
|
|
|
|
sign := data.Sign(plcItemSecret, ts)
|