Untitled

mail@pastecode.io avatar
unknown
scala
2 years ago
1.3 kB
1
Indexable
Never
//$gate_consigntradeapi_search.SearchGoodsList

var deviceId = ""
var keyword = ""
var goods_type =0
//#receive

	invoke(checkGameResult,"frontadminservice.GetGameInfo",3000,
			"game_id" ->  req.i("game_id"),
			"src_code" ->  req.ns("src_code")
		  )
	
//#checkGameResult

	val ret = lastresult
	if(ret.code != 0){
		next
	    return
	}
	goods_type = req.i("goods_type")
	if(ret.i("is_snda_game")==0){
		if(req.i("goods_type")==10 || req.ns("goods_type")=="10" || req.i("goods_type")==12 || req.ns("goods_type")=="12")
		goods_type = 2
	}
	next
//#next
	deviceId = req.ns("system_deviceId","unknown_device")
	if(req.ns("keyword") == "") keyword = req.ns("key") else keyword = req.ns("keyword")

	invoke(result, "mixedproductservice.SearchGoodsList4Consign", 25000,
				"xhead.logId" -> deviceId,
				"device_id" -> deviceId, // 使用的名称和外部不一致
				"src_code" -> req.s("src_code"),
				"app_version" -> req.s("app_version"),
				"*" -> req,
				"goods_type" -> goods_type,
				"keyword" -> keyword,
				"req_from"->0,
				"user_client_ip"->req.ns("client_ip",req.clientIp)
			)

//#result
	val res = lastresult

	if( res.code < 0 ) {
		reply(res.code,"fail_reason"->res.s("fail_reason",""))
		return
	}

    reply(0,"*"->res,"sum"->res.i("sum",0))