package logic import ( "HttpServer/redishandler" "common/logger" "common/redis" "encoding/json" "net/http" "strconv" "time" ) func SetHeader(w http.ResponseWriter) { w.Header().Set("Access-Control-Allow-Origin", "*") //允许访问所有域 w.Header().Set("Content-Type", "application/json") w.Header().Set("Access-Control-Allow-Headers", "Content-Type,Uuid") } func (tinfo *TeamInfo) DoAddBuffTimee(btype int,muti int,resp *AddTeamBuffResp) { addtime := 1800*muti index := 0 for k,val := range tinfo.BInfo.Buff { if val.Type == btype { index = k } } for i:=0;i= nowtime { tinfo.BInfo.Buff[index].BuffInfo[len(tinfo.BInfo.Buff[index].BuffInfo)-1].EndTime += addTime } else { var tmp TeamBuffInfo tmp.BeginTime = nowtime tmp.EndTime = nowtime + addTime tinfo.BInfo.Buff[index].BuffInfo = append(tinfo.BInfo.Buff[index].BuffInfo,tmp) } }else { tinfo.BInfo.Buff[index].BuffInfo[len(tinfo.BInfo.Buff[index].BuffInfo)-1].EndTime += 86399 } //删除掉无用的 yestime := nowtime-86400 for i:=0;i