@RestController @RequestMapping("/ChargingSupply") public class ChargingSupplyController {
@RequestMapping(value = "/getHouseholdChargingRisk", method = { RequestMethod.POST, RequestMethod.GET }) public RestResponse getHouseholdChargingRisk(@RequestParam("level")int level,@RequestParam("guid")String guid, @RequestParam(value = "gridSize",required = false)Integer gridSize, @RequestParam(value = "gridPage",required = false)Integer gridPage){ return RestResponse.ok(areaChargingService.getRegionalRiskLevels(level,guid,gridSize,gridPage)); }
public Object sheducleDealBuildingRiskLevel(@RequestBody OrderVo orderVo){ return RestResponse.ok(orderCompanyService.addTransOrder(orderVo)); }
//body 传 list
public class OrderCarrierDto { private List<OrderCarrier> orderCarrierList; }
{
"orderCarrierList": [
{
"orderCompanyProductId": 1,
"companyId": 1,
"orderCarrierWeigth": "7"
},
{
"orderCompanyProductId": 2,
"companyId": 2,
"orderCarrierWeigth": "3"
}
]
}
@EnableScheduling @EnableAspectJAutoProxy //@EnableCaching @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) @ComponentScan(basePackages = {"com.sf"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = com.sf.gis.app.framework.Scheduled.QuartzConfig.class)) @ImportResource({"classpath:application-context.xml"}) @SpringBootApplication(exclude={DataSourceAutoConfiguration.class}) @EnableTransactionManagement public class HcfiregovernApp extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(HcfiregovernApp.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(HcfiregovernApp.class); } }
@MapperScan 配置一个或多个路径,自动扫描这些包路径下的类,自动生成代理类