美文网首页
Springboot 常用注解举例

Springboot 常用注解举例

作者: 步闲 | 来源:发表于2019-12-04 13:48 被阅读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;
}

相关文章

网友评论

      本文标题:Springboot 常用注解举例

      本文链接:https://www.haomeiwen.com/subject/skxlgctx.html