package com.wechat.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wechat.global.message.InfoMsg;
import com.wechat.model.responseDto.ResultEntity;
import com.wechat.service.CommonService;
import com.wechat.service.PackageService;

@Controller
@RequestMapping(value = "package")
public class PackageController {

	@Autowired
	PackageService PackageService;

	@Autowired
	CommonService commonService;

	/**
	 * 套餐页初始化
	 * @param req
	 * @return
	 */
	@RequestMapping(value = "",method=RequestMethod.GET)
	@ResponseBody
	public ResultEntity<Map<String, Object>> initPackagePage(HttpServletRequest req, @RequestParam String identityFlag) {
//		String userCode = commonService.getUserCode(req);
		String lang = commonService.getLanguage(req);
		Map<String, Object> map = PackageService.initPackagePage(identityFlag,lang);

		return new ResultEntity<Map<String, Object>>(InfoMsg.SUCCESS_REQUEST, map);
	}
}
