package web import ( "context" "go_dreamfactory/comm" "go_dreamfactory/lego/sys/gin/engine" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" "go_dreamfactory/utils" "net/http" "time" ) type ModifyopentimeReq struct { Offest int64 `json:"offest"` // uid Sign string `json:"sign"` } //修改开服时间 func (this *Api_Comp) Modifyopentime(c *engine.Context) { var ( code pb.ErrorCode msg string ) offest := utils.ToInt32(c.PostForm("offset")) defer func() { c.JSON(http.StatusOK, &Respond{Code: code, Message: msg, Data: nil}) }() configure.SetOffsettime(time.Duration(offest) * time.Second) if err := this.module.service.RpcBroadcast( context.Background(), comm.Service_Worker, string(comm.Rpc_ConfigureUpDate), &pb.EmptyReq{}, &pb.EmptyResp{}); err != nil { this.module.Errorln(err) msg = err.Error() code = pb.ErrorCode_RpcFuncExecutionError } }