使用oracle做的数据上传系统后台
kongdeqiang
2026-03-21 b63977ec7120e8d5f8e5b7d1ac9b85be76ad62a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.example.controller;
 
import com.example.common.Result;
import com.example.dto.LoginRequest;
import com.example.dto.LoginResponse;
import com.example.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@RestController
@RequestMapping("/api/auth")
public class AuthController {
 
    @Autowired
    private AuthService authService;
 
    @PostMapping("/login")
    public Result<LoginResponse> login(@RequestBody LoginRequest request) {
        try {
            return Result.success(authService.login(request));
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
    }
 
    @GetMapping("/info")
    public Result<String> info() {
        return Result.success("当前用户部门编码: " + authService.getCurrentUserDeptCode());
    }
}