eternityz
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;


@Data
public class ResetPwdModel implements Serializable {
    @ApiModelProperty(value = "工号")
    @NotBlank(message = "工号不能为空")
    private String jobNumber;

    @ApiModelProperty(value = "新密码")
    @NotBlank(message = "密码不能为空")
    private String pwd;

    @ApiModelProperty(value = "手机号")
    private String mobile;

    @ApiModelProperty(value = "验证码")
    @NotBlank(message = "短信验证码不能为空")
    private String smsCode;

    public static void main(String[] args) {
        ResetPwdModel model = new ResetPwdModel();
        model.setJobNumber("111111");
        model.setPwd("123456");
        model.setMobile("151554227777");
        model.setSmsCode("456895");
        System.out.println(String.valueOf(model));
        System.out.println(model.toString());
        System.out.println(JSON.toJSONString(model));
        System.out.println(JSONObject.toJSONString(model));
    }
}

结果

ResetPwdModel(jobNumber=111111, pwd=123456, mobile=151554227777, smsCode=456895)
ResetPwdModel(jobNumber=111111, pwd=123456, mobile=151554227777, smsCode=456895)
{"jobNumber":"111111","mobile":"151554227777","pwd":"123456","smsCode":"456895"}
{"jobNumber":"111111","mobile":"151554227777","pwd":"123456","smsCode":"456895"}

分类:

技术点:

相关文章:

  • 2021-10-01
  • 2021-11-01
  • 2021-10-16
  • 2021-08-27
  • 2018-04-24
  • 2021-09-27
  • 2021-11-01
  • 2021-12-23
猜你喜欢
  • 2021-10-19
  • 2021-09-27
  • 2021-10-07
  • 2022-01-08
  • 2021-10-01
  • 2021-11-14
  • 2021-10-01
相关资源
相似解决方案