初始代码
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.sky.controller.admin;
|
||||
|
||||
import com.sky.constant.JwtClaimsConstant;
|
||||
import com.sky.dto.EmployeeDTO;
|
||||
import com.sky.dto.EmployeeLoginDTO;
|
||||
import com.sky.entity.Employee;
|
||||
import com.sky.properties.JwtProperties;
|
||||
@@ -8,6 +9,8 @@ import com.sky.result.Result;
|
||||
import com.sky.service.EmployeeService;
|
||||
import com.sky.utils.JwtUtil;
|
||||
import com.sky.vo.EmployeeLoginVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -24,6 +27,7 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/admin/employee")
|
||||
@Slf4j
|
||||
@Api(tags = "员工相关接口")
|
||||
public class EmployeeController {
|
||||
|
||||
@Autowired
|
||||
@@ -38,6 +42,7 @@ public class EmployeeController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
@ApiOperation(value = "员工登录")
|
||||
public Result<EmployeeLoginVO> login(@RequestBody EmployeeLoginDTO employeeLoginDTO) {
|
||||
log.info("员工登录:{}", employeeLoginDTO);
|
||||
|
||||
@@ -67,8 +72,17 @@ public class EmployeeController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/logout")
|
||||
@ApiOperation("员工退出")
|
||||
public Result<String> logout() {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增员工")
|
||||
public Result save(@RequestBody EmployeeDTO employeeDTO) {
|
||||
log.info("新增员工:{}",employeeDTO);
|
||||
employeeService.save(employeeDTO);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user