2026-02-25 16:34:58 +03:00

30 lines
863 B
Java

package com.example.nto.controller;
import com.example.nto.controller.dto.EmployeeDto;
import com.example.nto.service.EmployeeService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("api")
@RequiredArgsConstructor
public class EmployeeController {
private final EmployeeService employeeService;
@GetMapping("/{code}/info")
@ResponseStatus(code = HttpStatus.OK)
public EmployeeDto getByCode(@PathVariable String login) {
return employeeService.getByCode(login);
}
@GetMapping("/login/{username}/{password}")
@ResponseStatus(code = HttpStatus.OK)
public EmployeeDto login(@PathVariable String username, @PathVariable String password){
return employeeService.auth(username, password);
}
}