package com.ym.mec.web.controller;

import com.ym.mec.biz.dal.page.StudentRechargeQueryInfo;
import com.ym.mec.biz.service.OrganizationService;
import com.ym.mec.biz.service.StudentRechargeService;
import com.ym.mec.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("studentRecharge")
@Api(tags = "充值服务")
@RestController
public class StudentRechargeController extends BaseController {

	@Autowired
	private StudentRechargeService studentRechargeService;
	@Autowired
	private OrganizationService organizationService;

	@ApiOperation(value = "列表分页查询")
	@GetMapping(value = "/queryPage", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @PreAuthorize("@pcs.hasPermissions('studentRecharge/queryPage')")
	public Object queryPage(StudentRechargeQueryInfo queryInfo) {
		queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
		return succeed(studentRechargeService.queryPage(queryInfo));
	}

}
