简要描述
  • 添加APi计费策略
请求URL
  • http://xx.com/manager/apiChargeStrategy/add
请求方式
  • POST
参数说明出参

参数名

是否必选

类型

说明

callerCode


string

调用主体代码

sourceCode


string

数据源编码

apiCode


string

接口编码

blINcome


boolean

收支类型 -----收入:true/支出:false

chargeModelType


number

计费模式类型----普通模式:0|融慧分润模式:1|分渠道模式:2

status


number

状态 1:有效|2:过期|3:废弃()

effectDay


number

策略生效时间 时间戳

gratisRuleVo


object

免费规则

gratisRuleVo.gratisTimeType


string

免费类型 ----不免费:NO/按日免费:DAY/按月免费:MONTH/按季度免费:QUARTER/自定义时间段免费:CUSTOM/按数量免费:NUMBER

gratisRuleVo.gratisCustomStartTime


number

自定义时间段免费 免费日期开始时间 时间戳

gratisRuleVo.gratisCustomEndTime


number

自定义时间段免费 免费日期开始时间 时间戳

gratisRuleVo.gratisQuantity


number

免费数量(注意:全部免费传0)

repeatRuleVo


object

去重规则

repeatRuleVo.blRepeat


boolean

是否去重

repeatRuleVo.repeatUnit


string

去重周期单位----分:MINUTE/时:HOUR/天:DAY

repeatRuleVo.repeatValue


number

去重周期值

chargeRuleVo


object

计费规则

chargeRuleVo.chargeType


number

计费规则类型–查得计费:1|查询计费:2|命中计费:3

chargeRuleVo.expressionJsonCase


string

案例数据

chargeRuleVo.chargeRuleExpression


string

计费表达式

chargeRuleVo.chargeRuleId


number

计费规则Id 普通模式/第一次新增分渠道/分润策略传0

priceRuleVoList


array

计价规则数组

priceRuleVoList.channel1


string

渠道1/机构编码

priceRuleVoList.channel2


string

渠道2/产品编码

priceRuleVoList.shareProfitRule


string

分润规则编码

priceRuleVoList.pricingType


string

计价类型----固定单价:UPRICF|标准阶梯:STANDARD|累计阶梯:LADDER

priceRuleVoList.stepPricingCycle


string

阶梯计价周期----自然日:DAY|自然月:MONTH|自然季:QUARTER|自定义:CUSTOM

priceRuleVoList.stepPricingCycleCustomStartDay


number

自定义时间段计费 日期开始时间 时间戳

priceRuleVoList.stepPricingCycleCustomEndDay


number

自定义时间段计费 日期结束时间 时间戳

priceRuleVoList.pricingRangeVoList


array

计价区间数组

priceRuleVoList.pricingRangeVoList.rangeBegin


number

区间开始(从1开始)

priceRuleVoList.pricingRangeVoList.rangeEnd


number

区间结束(正无穷传-1)

priceRuleVoList.pricingRangeVoList.rangePrice


number

区间价格(单位毫厘)

priceRuleVoList.pricingRangeVoList.rangeIndex


number

区间数组索引

md5Hex


string

策略唯一串(只有在需要二次提交的策略才需要)

请求示例
{
    "callerCode":"ronghui",
	"sourceCode":"jiguang",
	"apiCode":"JG_model_v2",
	"blIncome":false,
	"chargeModelType":1,
	"effectDay":"1612454400000",
	"gratisRuleVo":{
		"gratisTimeType":"NO",
		"gratisCustomStartTime":1612454400000,
		"gratisCustomEndTime":000000000000000,
		"gratisQuantity":10,
	},
	"repeatRuleVo":{
        "blRepeat":true,
		"repeatUnit":"DAY",
		"repeatValue":1
	},
	"chargeRuleVo":{
		"expressionJsonCase":"{'matchTag':1}",
		"chargeRuleExpression":"matchTag == 1",
        "chargeType":1,
        "chargeRuleId":1
	},
	"priceRuleVoList":[
		{
			"channel1":"jingodng",
			"channel2":"JDM",
			"shareProfitRule":"old",
            "pricingType":"STANDARD",
            "stepPricingCycle":"CUSTOM",
            "stepPricingCycleCustomStartDay":1612454400000,
            "stepPricingCycleCustomEndDay":1612454400000,
			"pricingRangeVoList":[
				{
					"rangeBegin":0,
					"rangeEnd":100,
					"rangePrice":100,
                    "rangeIndex":0
				},
				{
					"rangeBegin":101,
					"rangeEnd":-1,
					"rangePrice":10,
                    "rangeIndex":0
				}
			]
		}
	]
  }
添加成功返回示例
{
    "code":0,
    "message":"success"
}
复核返回示例
{
    "code":200,
    "data":{
        "md5Hex":"dhalsdhalsdhj"
    }
    "message":"当前添加的策略已存在,是否继续添加并覆盖之前的策略"
}
参数错误返回示例
{
    "code":40002,
    "message":"apiCode不存在"
}
返回参数说明

参数名

类型

说明

code

int

0:成功/200:提示是否继续添加/40002:参数错误

备注
  • 参数问题前端也需要校验
  • 计价规则为固定单价时,pricingRangeVoList也需要传递 rangeBegin = 1 rangeEnd =-1 rangePrice=价格(毫厘)