package cn.hmsoft.pay.control;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.hmsoft.application.web.Ajax;
import cn.hmsoft.frame.control.FrameControl;
import cn.hmsoft.jdbc.entity.QueryOrder;
import cn.hmsoft.pay.data.dao.PayChannelDefineDao;
import cn.hmsoft.pay.data.model.PayChannelDefine;

@RestController
public class PayChannelControl extends FrameControl {

	@Autowired
	private PayChannelDefineDao daoChannel;

	@RequestMapping("/pay/channel/all")
	public Ajax all() {
		return new Ajax(this.daoChannel.all(new QueryOrder("channel_id")));
	}	

	@RequestMapping("/pay/channel/edit")
	public Ajax edit(PayChannelDefine channel) {
		this.daoChannel.update(channel);
		return new Ajax();
	}
}
