This commit is contained in:
wh_zcy 2023-06-16 17:28:53 +08:00
commit c730cf7cee
11 changed files with 16763 additions and 16752 deletions

BIN
bin/cmd

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -691,6 +691,7 @@ const (
Rtype187 TaskType = 187
Rtype188 TaskType = 188 //玩家创建1个工会
Rtype189 TaskType = 189 //铁匠铺进行一次定制
Rtype199 TaskType = 199 //回想多少次
)
const (

View File

@ -207,6 +207,7 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe
}
}
}
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype199, 1))
go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), szTask...)
}

View File

@ -61,5 +61,6 @@ func (this *Api_Comp) suitableMethods() {
continue
}
this.gin.POST(strings.ToLower(mname), vof.MethodByName(mname).Interface().(func(*engine.Context)))
this.gin.GET(strings.ToLower(mname), vof.MethodByName(mname).Interface().(func(*engine.Context)))
}
}

View File

@ -5,8 +5,10 @@ import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/gin/engine"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/utils/crypto/md5"
"go_dreamfactory/pb"
"go_dreamfactory/utils"
"net/http"
"time"
)
@ -18,15 +20,19 @@ type PayDeliveryResults struct {
//充值发货
func (this *Api_Comp) PayDelivery(c *engine.Context) {
req := make([]interface{}, 0)
err := c.BindJSON(&req)
this.module.Debugf("PayDelivery:%+v err:%v", req, err)
uid := c.Query("uid")
pid := c.Query("productid")
oid := c.Query("orderid")
price := utils.ToInt32(c.Query("price"))
sign := c.Query("sign")
// req := make([]interface{}, 0)
// err := c.BindJSON(&req)
var (
payreq *pb.PayDeliveryReq = &pb.PayDeliveryReq{
Uid: req[0].(string),
Productid: req[1].(string),
Orderid: req[2].(string),
Price: int32(req[3].(float64)),
Uid: uid,
Productid: pid,
Orderid: oid,
Price: price,
Amount: 1,
}
payresp *pb.PayDeliveryResp = &pb.PayDeliveryResp{
@ -35,6 +41,7 @@ func (this *Api_Comp) PayDelivery(c *engine.Context) {
Data: "",
}
)
this.module.Debugf("PayDelivery:%+v", payreq)
defer func() {
if payresp.Code != 0 {
if payresp.Code != pb.ErrorCode_PayOrderCompleted {
@ -48,16 +55,16 @@ func (this *Api_Comp) PayDelivery(c *engine.Context) {
}
}()
sginStr := fmt.Sprintf("%s%s%s%d%s", req[0], req[1], req[2], req[3], this.options.Key)
sign := md5.MD5(sginStr)
if sign != req[4].(string) {
sginStr := fmt.Sprintf("%s%s%s%d%s", payreq.Uid, payreq.Productid, payreq.Orderid, payreq.Price, this.options.Key)
_sign := md5.MD5(sginStr)
if _sign != sign {
payresp.Code = pb.ErrorCode_SignError
payresp.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_SignError)
this.module.Errorf("PayDelivery 签名错误! sginStr:%s sign:%s", sginStr, sign)
log.Errorf("签名错误 sign:%s _sign:%s", sign, _sign)
return
}
ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
if err = this.module.service.RpcCall(
if err := this.module.service.RpcCall(
ctx,
comm.Service_Worker,
string(comm.Rpc_ModulePayDelivery),

View File

@ -326,6 +326,7 @@ func convertServiceSttings(config *comm.GameConfig, id int, stype string, ip str
"WebDir": "./dist",
"Port": lport,
"Key": "@234%67g12q4*67m12#4l67!",
"Debug": true,
}
break
default: