feat: aos-web
增加全局异常拦截器 增加全局返回结果集 增加jackson全局配置
This commit is contained in:
@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableSwagger(applicationName = "test", scanPackagesPath = "com.aos.test")
|
||||
@EnableSwagger(applicationName = "test", scanPackagesPath = "com.aos.test.web")
|
||||
@EnableConfigurationProperties
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.aos.test.web;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author: zouyang
|
||||
* @date: 2022/6/1
|
||||
* @description: 需求计划入口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/")
|
||||
@Api(value = "ActivityDemandController", tags = "需求计划入口")
|
||||
public class ActivityDemandController {
|
||||
|
||||
@PostMapping("/保存")
|
||||
@ApiOperation(value = "分页查询活动需求")
|
||||
public void save() {
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/getListPage1")
|
||||
@ApiOperation(value = "分页查询活动需求1")
|
||||
public String getListPage1() {
|
||||
return "2";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.aos.test.web;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
@Api(tags = "测试接口")
|
||||
public class TestController {
|
||||
|
||||
@PostMapping("/test1")
|
||||
@ApiOperation(value = "test1")
|
||||
public void test1() {
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/test2")
|
||||
@ApiOperation(value = "test2")
|
||||
public String test2() {
|
||||
return "2";
|
||||
}
|
||||
|
||||
@PostMapping("/test3")
|
||||
@ApiOperation(value = "test3")
|
||||
public List<Long> test3() {
|
||||
return Arrays.asList(1L, 2L, 3L);
|
||||
}
|
||||
|
||||
@PostMapping("/test4")
|
||||
@ApiOperation(value = "test4")
|
||||
public void test4() throws Exception {
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.aos.test.web2;
|
||||
|
||||
import com.aos.common.model.result.WebResponse;
|
||||
import com.aos.common.model.result.WebResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: zouyang
|
||||
* @date: 2022/6/1
|
||||
* @description: 需求计划入口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
@Api(value = "ActivityDemandController1", tags = "需求计划入口2")
|
||||
public class ActivityDemandController2 {
|
||||
|
||||
@PostMapping("/getListPage2")
|
||||
@ApiOperation(value = "分页查询活动需求2")
|
||||
public WebResult<String> getListPage() {
|
||||
return WebResponse.WebResponse.ok(1);
|
||||
}
|
||||
|
||||
@PostMapping("/getListPage12")
|
||||
@ApiOperation(value = "分页查询活动需求12")
|
||||
public List<Long> getListPage1() {
|
||||
return Arrays.asList(1L, 2L);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user