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 Rtype187 TaskType = 187
Rtype188 TaskType = 188 //玩家创建1个工会 Rtype188 TaskType = 188 //玩家创建1个工会
Rtype189 TaskType = 189 //铁匠铺进行一次定制 Rtype189 TaskType = 189 //铁匠铺进行一次定制
Rtype199 TaskType = 199 //回想多少次
) )
const ( 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...) go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), szTask...)
} }

View File

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

View File

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