- 跨域访问:
@CrossOrigin
- swagger:
@Api
,@ApiOperation
类注解:
@RequestMapping("/theme")
@Api(tags="主题管理")
@RestController
public class ThemeController {
// ...
}
方法注解
@CrossOrigin(origins = "*", maxAge = 3600)
@ApiOperation(value="增加度量字段", notes="增加度量字段,返回增加字段语句", response=String.class)
@RequestMapping(value="addLength", method=RequestMethod.GET)
public String addLength(
@ApiParam(required=true, value="主题编号") @RequestParam String code,
@ApiParam(required=true, value="要增加多少度量。10/20/50") @RequestParam int length) throws MyException {
// TODO: ...
return "";
}