添加文档注释

This commit is contained in:
Bunny 2024-01-05 10:39:52 +08:00
parent 42d05894fa
commit 00b26569ff
3 changed files with 9 additions and 10 deletions

View File

@ -122,14 +122,6 @@
<artifactId>wechatpay-apache-httpclient</artifactId> <artifactId>wechatpay-apache-httpclient</artifactId>
<version>0.4.8</version> <version>0.4.8</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.webjars.npm/spark-md5 -->
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>spark-md5</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
</project> </project>

View File

@ -8,6 +8,9 @@ import com.sky.result.Result;
import com.sky.service.EmployeeService; import com.sky.service.EmployeeService;
import com.sky.utils.JwtUtil; import com.sky.utils.JwtUtil;
import com.sky.vo.EmployeeLoginVO; import com.sky.vo.EmployeeLoginVO;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -25,6 +28,7 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("/admin/employee") @RequestMapping("/admin/employee")
@Slf4j @Slf4j
@Api(tags = "员工相关接口")
public class EmployeeController { public class EmployeeController {
@Resource @Resource
@ -38,6 +42,7 @@ public class EmployeeController {
* @param employeeLoginDTO * @param employeeLoginDTO
* @return * @return
*/ */
@Operation(summary = "员工登录接口")
@PostMapping("/login") @PostMapping("/login")
public Result<EmployeeLoginVO> login(@RequestBody EmployeeLoginDTO employeeLoginDTO) { public Result<EmployeeLoginVO> login(@RequestBody EmployeeLoginDTO employeeLoginDTO) {
log.info("员工登录:{}", employeeLoginDTO); log.info("员工登录:{}", employeeLoginDTO);
@ -67,6 +72,7 @@ public class EmployeeController {
* *
* @return * @return
*/ */
@Operation(summary = "员工退出登录")
@PostMapping("/logout") @PostMapping("/logout")
public Result<String> logout() { public Result<String> logout() {
return Result.success(); return Result.success();

View File

@ -14,6 +14,8 @@ import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@Service @Service
public class EmployeeServiceImpl implements EmployeeService { public class EmployeeServiceImpl implements EmployeeService {
@ -28,6 +30,7 @@ public class EmployeeServiceImpl implements EmployeeService {
* @return Employee * @return Employee
*/ */
public Employee login(EmployeeLoginDTO employeeLoginDTO) { public Employee login(EmployeeLoginDTO employeeLoginDTO) {
String username = employeeLoginDTO.getUsername(); String username = employeeLoginDTO.getUsername();
String password = employeeLoginDTO.getPassword(); String password = employeeLoginDTO.getPassword();
@ -52,8 +55,6 @@ public class EmployeeServiceImpl implements EmployeeService {
throw new AccountLockedException(MessageConstant.ACCOUNT_LOCKED); throw new AccountLockedException(MessageConstant.ACCOUNT_LOCKED);
} }
// 3返回实体对象 // 3返回实体对象
return employee; return employee;
} }