📄 msgupdateuserinfo.java
字号:
/**
*
*/
package com.aceway.vas.sjcraw.cbgp201.cum;
import java.nio.ByteBuffer;
import com.aceway.vas.sjcraw.cbgp201.Msg;
import com.aceway.vas.sjcraw.cbgp201.common.DataFormat;
import com.aceway.vas.sjcraw.cbgp201.common.MsgInfo;
/**
* @标题: 华为彩铃平台接口规范
* @说明:
* @版权: Copyright(c) 2007
* @公司: 北京汉铭信通科技有限公司
* @部门: 增值业务部
* @作者: 武达
* @Jun 5, 2007
*/
public class MsgUpdateUserInfo extends Msg {
private static int operCode = MsgInfo.CRBT_UPDATE_USERINFO;
private static int lenBody = MsgInfo.LEN_CRBT_UPDATE_USER_INFO;
/*
必选参数 AccountID 21 String 用户手机号码
可选参数 OldPassword 8 String 旧密码,编码格式同用户密码Password
必选参数 NewPassword 8 String 新密码,编码格式同用户密码Password
可选参数 UserType 2 Integer 用户等级
OpenType 1 Integer 用户开户来源
*/
private String accountId;
private String oldPassword;
private String newPassword;
private int userType;
private int openType; //1:WEB开户;2:SMS(短信)开户;3:IVR(语音平台)开户;4:营业厅开户;
public MsgUpdateUserInfo(String seqNo, String linkId, String accountId,
String oldPassword, String newPassword, int userType, int openType){
this.accountId = DataFormat.makeString(accountId, 21);
if (oldPassword !=null && !oldPassword.equals("")){
this.oldPassword = oldPassword;
}else{
this.oldPassword = DataFormat.makeTempStr(8);
}
this.newPassword = DataFormat.makeString(newPassword, 8);
if (userType ==1 || userType==2 || userType==3){
lenBody += 2;
this.userType = userType;
}
if (openType==1 || openType==2 || openType==3||openType==4){
lenBody+=1;
this.openType = openType;
}
super.setCommandLength(lenBody);
super.setMsgHead(operCode, "0", seqNo, linkId);
ByteBuffer buff = ByteBuffer.allocate(lenBody);
buff.put(this.accountId.getBytes());
buff.put(this.oldPassword.getBytes());
buff.put(this.newPassword.getBytes());
if (lenBody==40){
byte[] b1 = DataFormat.int2bytes(userType);
byte[] b2 = DataFormat.int2bytes(openType);
byte[] b = {b1[2], b1[3], b2[3]};
buff.put(b);
}else if (lenBody==39){
byte[] b1 = DataFormat.int2bytes(userType);
buff.put(b1);
}
buff.flip();
super.setMsgBody(buff.array());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -