ca证书
This commit is contained in:
@@ -11,11 +11,10 @@ type MsgBody struct {
|
||||
RawData []byte
|
||||
MsgName string
|
||||
Msg map[string]string
|
||||
Keys []string
|
||||
}
|
||||
|
||||
// Decode
|
||||
// reqLoginAlarm;user=yiy;key=qw#$@;type=msg
|
||||
//reqLoginAlarm;user=yiy;key=qw#$@;type=msg
|
||||
func (o *MsgBody) Decode() error {
|
||||
multi := strings.Split(string(o.RawData), ";")
|
||||
if len(multi) < 1 {
|
||||
@@ -32,12 +31,12 @@ func (o *MsgBody) Decode() error {
|
||||
}
|
||||
|
||||
// Pack
|
||||
// reqLoginAlarm;user=yiy;key=qw#$@;type=msg
|
||||
//reqLoginAlarm;user=yiy;key=qw#$@;type=msg
|
||||
func (o *MsgBody) Pack() error {
|
||||
var multi []string
|
||||
multi = append(multi, o.MsgName)
|
||||
for _, key := range o.Keys {
|
||||
item := fmt.Sprintf("%s=%s", key, o.Msg[key])
|
||||
for i, v := range o.Msg {
|
||||
item := fmt.Sprintf("%s=%s", i, v)
|
||||
multi = append(multi, item)
|
||||
}
|
||||
raw := strings.Join(multi, ";")
|
||||
|
||||
Reference in New Issue
Block a user