美文网首页JSON
fastjson的@JSONField注解

fastjson的@JSONField注解

作者: wanggs | 来源:发表于2017-08-22 19:38 被阅读78次

    序列化

    fastjson的@JSONField注解

    package com.toltech.phatent.commons.bean;
    
    import java.io.Serializable;
    
    import com.alibaba.fastjson.annotation.JSONField;
    import com.alibaba.fastjson.annotation.JSONType;
    
    /**
     * AuthzReq
     * @author qiuyp
     * @version 1.0
     * @since 2017年8月18日下午6:29:49
     */
    
    //@JSONType(orders ={ "id", "pId", "name", "open" },ignores = { "projectId" }) 
    
    
    @JSONType(ignores={"sign"})
    public class AuthzReq implements Serializable {
        private static final long serialVersionUID = 1L;
        @JSONField(name = "trans_Id")
        private String transId;
        @JSONField(name = "user_name")
        private String userName;
        @JSONField(name = "password")
        private String password;
        @JSONField(name = "user_type")
        private Integer userType;
        private String sign;
    
        public String getTransId() {
            return transId;
        }
    
        public void setTransId(String transId) {
            this.transId = transId;
        }
    
        public String getUserName() {
            return userName;
        }
    
        public void setUserName(String userName) {
            this.userName = userName;
        }
    
        public String getPassword() {
            return password;
        }
    
        public void setPassword(String password) {
            this.password = password;
        }
    
        public Integer getUserType() {
            return userType;
        }
    
        public void setUserType(Integer userType) {
            this.userType = userType;
        }
    
        public String getSign() {
            return sign;
        }
    
        public void setSign(String sign) {
            this.sign = sign;
        }
    }
    
    

    相关文章

      网友评论

        本文标题:fastjson的@JSONField注解

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