正在显示
1 个修改的文件
包含
19 行增加
和
20 行删除
| @@ -7,7 +7,6 @@ import ( | @@ -7,7 +7,6 @@ import ( | ||
| 7 | "strconv" | 7 | "strconv" |
| 8 | 8 | ||
| 9 | "github.com/astaxie/beego" | 9 | "github.com/astaxie/beego" |
| 10 | - "gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/redis" | ||
| 11 | "gitlab.fjmaimaimai.com/mmm-go/gocomm/time" | 10 | "gitlab.fjmaimaimai.com/mmm-go/gocomm/time" |
| 12 | ) | 11 | ) |
| 13 | 12 | ||
| @@ -60,25 +59,25 @@ func (this *BaseController) Prepare() { | @@ -60,25 +59,25 @@ func (this *BaseController) Prepare() { | ||
| 60 | this.RequestHead.SetRequestId(fmt.Sprintf("%v.%v.%s", this.RequestHead.Uid, time.GetTimeByYyyymmddhhmmss(), this.Ctx.Request.URL)) | 59 | this.RequestHead.SetRequestId(fmt.Sprintf("%v.%v.%s", this.RequestHead.Uid, time.GetTimeByYyyymmddhhmmss(), this.Ctx.Request.URL)) |
| 61 | log.Debug(fmt.Sprintf("====>Recv data from uid(%d) client:\nHeadData: %s\nRequestId:%s BodyData: %s", this.RequestHead.Uid, this.Ctx.Request.Header, this.RequestHead.GetRequestId(), string(this.ByteBody))) | 60 | log.Debug(fmt.Sprintf("====>Recv data from uid(%d) client:\nHeadData: %s\nRequestId:%s BodyData: %s", this.RequestHead.Uid, this.Ctx.Request.Header, this.RequestHead.GetRequestId(), string(this.ByteBody))) |
| 62 | } | 61 | } |
| 63 | - key := SWITCH_INFO_KEY | ||
| 64 | - str := "" | ||
| 65 | - switchInfo := &TotalSwitchStr{} | ||
| 66 | - if str, _ = redis.Get(key); str == "" { | ||
| 67 | - switchInfo.TotalSwitch = TOTAL_SWITCH_ON | ||
| 68 | - switchInfo.MessageBody = "正常运行" | ||
| 69 | - redis.Set(key, switchInfo, redis.INFINITE) | ||
| 70 | - } else { | ||
| 71 | - json.Unmarshal([]byte(str), switchInfo) | ||
| 72 | - } | ||
| 73 | - if switchInfo.TotalSwitch == TOTAL_SWITCH_OFF { | ||
| 74 | - var msg *Message | ||
| 75 | - msg = NewMessage(3) | ||
| 76 | - msg.Errmsg = switchInfo.MessageBody | ||
| 77 | - log.Info(msg.Errmsg) | ||
| 78 | - this.Data["json"] = msg | ||
| 79 | - this.ServeJSON() | ||
| 80 | - return | ||
| 81 | - } | 62 | + //key := SWITCH_INFO_KEY |
| 63 | + //str := "" | ||
| 64 | + //switchInfo := &TotalSwitchStr{} | ||
| 65 | + //if str, _ = redis.Get(key); str == "" { | ||
| 66 | + // switchInfo.TotalSwitch = TOTAL_SWITCH_ON | ||
| 67 | + // switchInfo.MessageBody = "正常运行" | ||
| 68 | + // redis.Set(key, switchInfo, redis.INFINITE) | ||
| 69 | + //} else { | ||
| 70 | + // json.Unmarshal([]byte(str), switchInfo) | ||
| 71 | + //} | ||
| 72 | + //if switchInfo.TotalSwitch == TOTAL_SWITCH_OFF { | ||
| 73 | + // var msg *Message | ||
| 74 | + // msg = NewMessage(3) | ||
| 75 | + // msg.Errmsg = switchInfo.MessageBody | ||
| 76 | + // log.Info(msg.Errmsg) | ||
| 77 | + // this.Data["json"] = msg | ||
| 78 | + // this.ServeJSON() | ||
| 79 | + // return | ||
| 80 | + //} | ||
| 82 | } | 81 | } |
| 83 | 82 | ||
| 84 | func (this *BaseController) GetRequestHead() *RequestHead { | 83 | func (this *BaseController) GetRequestHead() *RequestHead { |
-
请 注册 或 登录 后发表评论