?? 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 + -