package com.gyee.frame.controller.gen;

import java.util.List;

import com.gyee.frame.common.dataSources.DataSource;
import com.gyee.frame.common.dataSources.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gyee.frame.common.base.BaseController;
import com.gyee.frame.common.domain.AjaxResult;
import com.gyee.frame.model.auto.GyeepermissionView;
import com.gyee.frame.service.GyeepermissionService;
import io.swagger.annotations.Api;

@Controller
@RequestMapping("GyeepermissionController")
@Api(value = "")
public class GyeepermissionController extends BaseController{
	
	@Autowired
	private GyeepermissionService gyeepermissionService;
	

	@DataSource(value = DataSourceType.TICKET)
	@GetMapping("/GyeePermissionList")
	@ResponseBody
	public AjaxResult GyeePermissionList(String userid){
		List<GyeepermissionView> list=gyeepermissionService.queryPermissionByRoleId(userid);
		if(list.isEmpty()){
			return AjaxResult.error(500, "无法获取权限");
			
		}else{
			return AjaxResult.successData(200, list);
		}
	}
	

}
