1.获取配置文件值或者当前配置文件dev
@Value("${spring.profiles.active}")
private String profile;
2.方法请求
post
@ApiOperation(notes = "/saveUserPackages", httpMethod = "POST", value = " 保存用户包名")
@RequestMapping(value = "/saveUserPackages", method = RequestMethod.POST, consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"})
@ResponseBody
get
@ApiOperation(notes = "/getAdData", httpMethod = "GET", value = "获取各种广告信息")
@RequestMapping(value = "/getAdData", method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
@ApiImplicitParams({
@ApiImplicitParam(defaultValue = "0", value = "广告位置 1-开屏广告,2-首页广告,3-红包广告,4-列表广告", name = "ad_location", paramType = "query"),
})
或者
@ApiOperation(notes = "/startBlessing", httpMethod = "GET", value = "去祈福")
@RequestMapping(value = "/startBlessing", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
@ResponseBody
public BaseResult startBlessing(@RequestParam @ApiParam(required = true, value = "祈福类型") Integer blessingType) {
}
3.事务
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)