-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
ddd/multi-layers/src/main/java/org/hzz/config/AppSpringdocConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.hzz.config; | ||
|
||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Contact; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.info.License; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class AppSpringdocConfig { | ||
|
||
@Bean | ||
public OpenAPI applicationOpenApi() { | ||
Info info = new Info() | ||
.title("分层架构模型") | ||
.description("springboot+mybatis-plus+swagger3") | ||
.version("1.0.0") | ||
.license(new License().name("Apache 2.0").url("https://q10viking.github.io")) | ||
.contact(new Contact().name("q10viking").email("[email protected]")); | ||
return new OpenAPI() | ||
.info(info); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
ddd/multi-layers/src/main/java/org/hzz/controller/UserApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.hzz.controller; | ||
|
||
import io.swagger.v3.oas.annotations.ExternalDocumentation; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.apache.commons.lang3.NotImplementedException; | ||
import org.hzz.domain.common.Result; | ||
import org.hzz.domain.dto.UserDTO; | ||
import org.hzz.domain.vo.UserVO; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import org.springframework.validation.annotation.Validated; | ||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotNull; | ||
|
||
@RequestMapping("/user") | ||
@Tag(name = "用户管理",description = "用户管理(增删改查)", | ||
externalDocs = @ExternalDocumentation(url = "https://q10viking.github.io",description = "我的博客")) | ||
@Validated | ||
public interface UserApi { | ||
|
||
@Operation(summary = "查询用户信息",description = "根据用户id查询用户信息") | ||
@GetMapping("/queryById") | ||
default Result<UserVO> queryById( | ||
@Valid @NotNull @RequestParam(name="userid",required = false) | ||
Long userId){ | ||
throw new NotImplementedException("接口未实现"); | ||
} | ||
|
||
|
||
@Operation(summary = "保存用户信息",description = "保存用户信息到数据库") | ||
@PostMapping("/save") | ||
default public Result<String> save(@Valid @RequestBody UserDTO userDTO) { | ||
throw new NotImplementedException("接口未实现"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters