Springboot 常用注解举例

2019-12-04  本文已影响0人  步闲

Http 常用注解:

@RequestParam("policyId") String policyId,
@RequestParam(value = "index", defaultValue = "", required = false) String index,
@RequestParam(value = "limit", defaultValue = "-1", required = false) int limit,
@RequestParam(value = "offset", defaultValue = "-1", required = false) long offset,
@RequestParam("mode") int mode,
@RequestBody(required = false) String body) 

Json 格式返回常用注解:

    @JSONField(ordinal = 1)
    private String title;
    @JSONField(name="abstract",ordinal = 2)
    private String abstractAlia;
    @JSONField(ordinal = 3)
    private List<Body> body;
    @JSONField(ordinal = 4)
    private String metadata_string;

引入配置文件:

@Component
@PropertySource({"classpath:dlsconfig.properties"})
public class HbaseUtil {
    @Value("${easyhbase.dalishen.namespace}")
    private String nameSpace;
}
上一篇下一篇

猜你喜欢

热点阅读