package com.usky.system.controller.web;

import com.usky.common.core.bean.ApiResult;
import com.usky.system.service.SysUserPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户人员关联 前端控制器
 * </p>
 *
 * @author JCB
 * @since 2022-08-22
 */
@RestController
@RequestMapping("/sysUserPerson")
public class SysUserPersonController {

    @Autowired
    private SysUserPersonService sysUserPersonService;

    /**
     * 修改登录通知开关状态
     * @param useId 用户id
     * @param isLoginNotify 1:开启 0:关闭
     * @return 0:失败
     */
    @PutMapping("/upIsLoginNotify")
    public ApiResult<Integer> upIsLoginNotice(@RequestParam Long userId,
                                              @RequestParam Integer isLoginNotify) {
        return ApiResult.success(sysUserPersonService.upIsLoginNotify(userId, isLoginNotify));
    }
}

