package org.springblade.system.expand.controller;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.system.expand.service.IOrgPositionService;
import org.springblade.system.expand.vo.UserVO;
import org.springblade.system.expand.wrapper.UserWrapper;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created By lidexi in 2021/3/24
 **/
@RestController
@AllArgsConstructor
@RequestMapping("blade-user")
@Api(value = "", tags = "接口")
public class UserExController {

	private IUserClient userService;
	private IOrgPositionService orgPositionService;

	@GetMapping("/info-strength")
	public R<UserVO> info(BladeUser user) {
		User detail = this.userService.userInfoById(user.getUserId()).getData();
		return R.data(UserWrapper.build(orgPositionService).entityVO(detail));
	}
}
