//package com.backendsys.controller.Systems;
//
//import com.backendsys.aspect.RateLimiting;
//import com.backendsys.modules.common.config.redis.utils.RedisUtil;
//import com.backendsys.modules.common.config.security.utils.TokenUtil;
//import com.backendsys.entity.System.SysUserDTO;
//import com.backendsys.mapper.System.SysUserMapper;
//import com.backendsys.utils.response.Result;
//import com.backendsys.service.System.SysAuthService;
//
//import jakarta.servlet.http.HttpServletRequest;
//import jakarta.servlet.http.HttpServletResponse;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import java.io.IOException;
//
////@Tag(name = "登录管理")
//@RestController
//public class SysAuthController {
//
//    @Autowired
//    private StringRedisTemplate stringRedisTemplate;
//
//    @Autowired
//    private RedisUtil redisUtil;
//
//    @Autowired
//    private TokenUtil tokenUtil;
//
//    @Autowired
//    private SysUserMapper sysUserMapper;
//
//    @Value("${spring.config.name}")
//    private String configName;
//
//    @Autowired
//    private SysAuthService sysAuthService;
//
////    /**
////     * 获得图形验证码
////     */
////    @GetMapping("/api/system/auth/getCaptcha")
////    public void getCaptcha(HttpServletRequest request, HttpServletResponse response) throws IOException {
////        sysAuthService.renderCaptcha(request, response);
////    }
//
//    /** --------------------------------------------------------------------------------------- */
////    /**
////     * 登录 (用户名)
////     */
////    @PostMapping(value = "/api/system/auth/login")
////    @RateLimiting(key = "systemLogin", limit = 5)
////    public Result systemLogin(HttpServletRequest request, @Validated(SysUserDTO.Login.class) @RequestBody SysUserDTO sysUserDTO) {
////        return Result.success(sysAuthService.login(request, sysUserDTO));
////    }
////    /**
////     * 登录 (手机号码)
////     */
////    @PostMapping(value = "/api/system/auth/loginWithPhone")
////    @RateLimiting(key = "systemLoginWithPhone", limit = 5)
////    public Result systemLoginWithPhone(HttpServletRequest request, @Validated(SysUserDTO.LoginWithPhone.class) @RequestBody SysUserDTO sysUserDTO) {
////        return Result.success(sysAuthService.loginWithPhone(request, sysUserDTO));
////    }
//
////    /**
////     * 注册系统用户 (用户名 和 手机号码 必填)
////     */
////    @PostMapping("/api/public/system/user/registerUser")
////    @RateLimiting(key = "registerUser", limit = 5)
////    public Result registerUser(HttpServletRequest request, @Validated(SysUserDTO.Register.class) @RequestBody SysUserDTO sysUserDTO) {
////        return Result.success(sysAuthService.registerUser(request, sysUserDTO), "注册成功");
////    }
//
////    /**
////     * 忘记密码
////     */
////    @PostMapping("/api/public/system/user/forgotPassword")
////    public Result forgotPassword(@Validated(SysUserDTO.ForgotPassword.class) @RequestBody SysUserDTO sysUserDTO) {
////        return Result.success(sysAuthService.forgotPassword(sysUserDTO));
////    }
//
////    // 注意：如果使用 /api/system/auth/* 会被 SecurityConfig 过滤掉 Token (获取不到 Token)
////    @PostMapping(value = "/api/system/user/logout")
////    public Result systemLogout(HttpServletRequest request) {
////        return Result.success(sysAuthService.logout(request));
////    }
//
//}
