📄 msgeditring.java
字号:
/**
*
*/
package com.aceway.vas.sjcraw.cbgp201.crm.rwm;
import java.nio.ByteBuffer;
import java.util.Date;
import com.aceway.vas.sjcraw.cbgp201.Msg;
import com.aceway.vas.sjcraw.cbgp201.common.DataFormat;
import com.aceway.vas.sjcraw.cbgp201.common.MsgInfo;
/**
* @标题: 华为彩铃平台接口规范
* @说明: 6.2.10.1.2 修改铃音信息操作
* @版权: Copyright(c) 2007
* @公司: 北京汉铭信通科技有限公司
* @部门: 增值业务部
* @作者: 武达
* @Jun 5, 2007
*/
public class MsgEditRing extends Msg {
private static int operCode = MsgInfo.CRBT_EDIT_RING;
private static int lenBody = MsgInfo.LEN_CRBT_EDIT_RING;
private String accountId;
private String ringId;
private int price;
private String ringName;
private String author;
private String supplier;
private String validDate;
/*
必选参数
AccountID 21 String 修改铃音信息的用户ID
RingID 12 String 要更新信息的铃音ID
可选参数
Price 4 Integer 新的铃音价格
RingName 40 String 新的铃音名称
Author 20 String 铃音作者或歌手
Supplier 20 String 铃音提供者
ValidDate 10 String 铃音的有效期截止日期
*/
public MsgEditRing(String seqNo, String linkId, String accountId, String ringId,
int price, String ringName, String author, String supplier, Date validDate){
this.accountId = DataFormat.makeString(accountId, 21);
this.ringId = DataFormat.makeString(ringId, 12);
super.setCommandLength(lenBody);
super.setMsgHead(operCode, "", seqNo, linkId);
ByteBuffer buff = ByteBuffer.allocate(lenBody);
if (price < 0){
buff.put(DataFormat.makeTempStr(4).getBytes());
} else{
this.price = price;
buff.putInt(price);
}
if (ringName !=null && !ringName.equals("")){
this.ringName = DataFormat.makeString(ringName, 40);
}else{
this.ringName = DataFormat.makeTempStr(40);
}
buff.put(this.ringName.getBytes());
if (author!=null && !author.equals("")){
this.author = DataFormat.makeString(author, 20);
}else {
this.author = DataFormat.makeTempStr(20);
}
buff.put(this.author.getBytes());
if (supplier!=null && !supplier.equals("")){
this.supplier = DataFormat.makeString(supplier, 20);
} else{
this.supplier = DataFormat.makeTempStr(20);
}
buff.put(this.supplier.getBytes());
if (validDate!=null && !validDate.equals("")){
this.validDate = super.dateFormat.format(validDate);
}else {
this.validDate = DataFormat.makeTempStr(10);
}
buff.put(this.validDate.getBytes());
buff.flip();
super.setMsgBody(buff.array());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -