package com.palmnest.webapp.controller.backstage;

import com.palmnest.application.bean.AppResultDto;
import com.palmnest.service.usertoken.UserTokenService;
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.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@Controller
@RequestMapping(value = "/userdata")
public class BkUserTokenController {

	@Autowired
	private UserTokenService userTokenService;


	//某人是否有投诉表扬回复权限 true/false
	@ResponseBody
	@RequestMapping(value = "/getUserIsHaveTsbyReplyByToken", method = {RequestMethod.GET, RequestMethod.POST}, produces = "application/json")
	public AppResultDto getUserIsHaveTsbyReplyByToken(HttpServletRequest request, HttpServletResponse response) {

		return userTokenService.getUserIsHaveTsbyReplyByToken(request);

	}

	@ResponseBody
	@RequestMapping(value = "/getOrgsByToken", method = {RequestMethod.GET, RequestMethod.POST}, produces = "application/json")
	public AppResultDto getOrgsByToken(HttpServletRequest request, HttpServletResponse response) {

		return userTokenService.getOrgsByToken(request);
	}
}
