package com.hz.pm.api.sys.controller;

import com.hz.pm.api.sys.manage.UserGuidanceManage;
import com.hz.pm.api.sys.model.vo.UserGuidanceVO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname UserGuidanceController
 * @Description
 * @Date 2023/8/8 13:46
 * @Author PoffyZhang
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/api/v1/sys/user-guidanc")
@Api(value = "UserGuidance", tags = "用户引导")
@RequiredArgsConstructor
public class UserGuidanceController {

    private final UserGuidanceManage userGuidanceManage;

    @ApiOperation(value = "获取当前用户单位的一些配置是否完成", notes = "获取当前用户单位的一些配置是否完成")
    @GetMapping("/detail")
    public UserGuidanceVO detail() {
        UserInfoDetails user = LoginUserUtil.loginUserDetail();
        return userGuidanceManage.detailUserGuidance(user);
    }

    @ApiOperation(value = "删除重复用户", notes = "删除重复用户")
    @GetMapping("/remove-repeat/{userId}")
    public String removeRepeat(@PathVariable Long userId) {
        return userGuidanceManage.removeRepeat(userId);
    }
}
