外卖项目day01-Swagger_介绍和常用注解
This commit is contained in:
@@ -43,6 +43,7 @@ public class WebMvcConfiguration extends WebMvcConfigurationSupport {
|
|||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public Docket docket() {
|
public Docket docket() {
|
||||||
|
log.info("swagger接口文档自动生成");
|
||||||
ApiInfo apiInfo = new ApiInfoBuilder()
|
ApiInfo apiInfo = new ApiInfoBuilder()
|
||||||
.title("苍穹外卖项目接口文档")
|
.title("苍穹外卖项目接口文档")
|
||||||
.version("2.0")
|
.version("2.0")
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ 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.annotations.ApiOperation;
|
||||||
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;
|
||||||
@@ -23,6 +25,7 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/employee")
|
@RequestMapping("/admin/employee")
|
||||||
|
@Api(tags = "员工相关接口")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class EmployeeController {
|
public class EmployeeController {
|
||||||
|
|
||||||
@@ -38,6 +41,7 @@ public class EmployeeController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
|
@ApiOperation("员工登录")
|
||||||
public Result<EmployeeLoginVO> login(@RequestBody EmployeeLoginDTO employeeLoginDTO) {
|
public Result<EmployeeLoginVO> login(@RequestBody EmployeeLoginDTO employeeLoginDTO) {
|
||||||
log.info("员工登录:{}", employeeLoginDTO);
|
log.info("员工登录:{}", employeeLoginDTO);
|
||||||
|
|
||||||
@@ -67,6 +71,7 @@ public class EmployeeController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/logout")
|
@PostMapping("/logout")
|
||||||
|
@ApiOperation("员工退出")
|
||||||
public Result<String> logout() {
|
public Result<String> logout() {
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user