30 lines
847 B
Java
30 lines
847 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 code) {
|
|
return employeeService.getByCode(code);
|
|
}
|
|
|
|
@GetMapping("/login/{username}/{password}")
|
|
@ResponseStatus(code = HttpStatus.OK)
|
|
public void login(@PathVariable String username, @PathVariable String password){
|
|
employeeService.auth(username, password);
|
|
}
|
|
|
|
}
|