package com.neusoft.smart.pos.gateway.controller;


import com.neusoft.smart.pos.dto.trade.response.GetBillSettlementRuleResponse;
import com.neusoft.smart.pos.dto.trade.response.GetBillSettlementRulesResponse;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import com.neusoft.smart.pos.gateway.service.BillRuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "账单管理使用rest接口", description = "账单管理使用rest接口")
@RestController
@RequestMapping(path = "/unionService/billSettlementRule")
@Validated
public class BillRuleController {

	@Autowired
	private BillRuleService billRuleService;
	
	@ApiOperation(value = "结算规则查询使用接口", notes = "结算规则查询使用方法")
	@GetMapping("/billSettlementRule")
	public ResponseData<GetBillSettlementRuleResponse> queryBillSettlementRule(@RequestParam(value="ruleId",defaultValue = "0") Integer ruleId){
		return new ResponseData<>(billRuleService.queryBillSettlementRule(ruleId));
	}
	
	@ApiOperation(value = "结算规则列表查询使用接口", notes = "结算规则列表查询使用方法")
	@GetMapping("/billSettlementRules")
	public ResponseData<GetBillSettlementRulesResponse> queryBillSettlementRules(){
		return new ResponseData<>(billRuleService.queryBillSettlementRules());
	}
	
}
	