Commit 884d259d by “lxy”

swagger

1 parent 9edbcec0
......@@ -7,7 +7,6 @@ import org.nafmii.nafmiiadmin.service.TestService;
import org.nafmii.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......
......@@ -2,7 +2,6 @@ package org.nafmii.nafmiiadmin.service.impl;
import org.nafmii.nafmiiadmin.mapper.TStudentMapper;
import org.nafmii.nafmiiadmin.po.TStudent;
import org.nafmii.nafmiiadmin.po.TStudentExample;
import org.nafmii.nafmiiadmin.service.TestService;
import org.nafmii.result.Result;
import org.nafmii.result.ResultCode;
......@@ -27,9 +26,8 @@ public class TestServiceImpl implements TestService {
@Override
public Result<List<TStudent>> searchAll() {
Result result = new Result();
TStudentExample studentExample = new TStudentExample();
List<TStudent> tStudents = studentMapper.selectByExample(studentExample);
result.setData(tStudents);
TStudent tStudent = studentMapper.selectByPrimaryKey(1);
result.setData(tStudent);
result.setCode(ResultCode.SUCCESS.getCode());
result.setMessage(ResultCode.SUCCESS.getMessage());
return result;
......
......@@ -25,7 +25,7 @@ public class SwaggerConfig {
// String basePackage = ADMIN_SWAGGER;// 要暴露的API接口的基础包名
return new Docket (DocumentationType.SWAGGER_2)
.select ()
.apis (RequestHandlerSelectors.basePackage ("org.nafmii.nafmiiadmin"))
.apis (RequestHandlerSelectors.basePackage ("org.nafmii.nafmiiadmin.controller"))
.paths (PathSelectors.any ())
.build ()
.apiInfo (apiInfo ())
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!