package com.keao.edu.controller;


import com.keao.edu.auth.api.client.SysUserFeignService;
import com.keao.edu.auth.api.entity.SysUser;
import com.keao.edu.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("employee")
@Api(tags = "员工服务")
public class EmployeeController extends BaseController {

	@Autowired
	private SysUserFeignService sysUserFeignService;

	@ApiOperation(value = "获取用户信息")
	@GetMapping("/queryUserInfo")
	public Object apiQueryUserInfo() {
		SysUser sysUser = sysUserFeignService.queryUserInfo();
		if(sysUser != null && sysUser.getId() != null){
			return succeed(sysUser);
		}
		return failed("获取用户信息失败");
	}

}
