fix: adjustment directory structure
This commit is contained in:
353
proxy/Nrestful/rest_msg.go
Normal file
353
proxy/Nrestful/rest_msg.go
Normal file
@@ -0,0 +1,353 @@
|
||||
package Nrestful
|
||||
|
||||
import (
|
||||
|
||||
)
|
||||
|
||||
type AuthCodeReq struct {
|
||||
CODE_TYPE string `json:"CODE_TYPE"`// ignore?
|
||||
CUST_CODE uint32 `json:"CUST_CODE"`// ignore?
|
||||
Content string `json:"content"`
|
||||
TelNumber string `json:"telNumber"`
|
||||
}
|
||||
|
||||
type AuthCodeRsp struct {
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail, from uint32
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type QueryUserDataReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
}
|
||||
|
||||
type QueryUserDataRsp struct {
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail, from uint32
|
||||
Message string `json:"message"`
|
||||
Status string `json:"status"`// from uint8
|
||||
Remark string `json:"remark"`
|
||||
TelNumber string `json:"telNumber"`
|
||||
UserGroupName string `json:"userGroupName"`
|
||||
Balance string `json:"balance"`// from uint32
|
||||
ExpireDate string `json:"expireDate"`// "YYYY-MM-DD HH:MM:SS"
|
||||
VoiceMinute string `json:"VoiceMinute,omitempty"`// from uint32
|
||||
RemainMoVoiceMinute string `json:"remainVoiceMinute"`// from uint32
|
||||
RemainMtVoiceMinute string `json:"remainMtVoiceMinute,omitempty"`// from uint32
|
||||
SmsVolume string `json:"smsVolume,omitempty"`// from uint32
|
||||
RemainSmsVolume string `json:"remainSmsVolume"`// from uint32
|
||||
DataVolume string `json:"dataVolume,omitempty"`// from uint32
|
||||
RemainDataVolume string `json:"remainDataVolume"`// from uint32
|
||||
}
|
||||
|
||||
type BundleSubsReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
PayType string `json:"payType"`// from uint8
|
||||
ChargedAmount string `json:"chargedAmount"`// from uint32
|
||||
MoVoiceMinute string `json:"moVoiceMinute"`// from uint32
|
||||
MtVoiceMinute string `json:"mtVoiceMinute"`// from uint32
|
||||
DataVolume string `json:"dataVolume"`// from uint32, in MB
|
||||
SmsVolume string `json:"smsVolume"`// from uint32
|
||||
ValidPeriod string `json:"validPeriod"`// from uint32
|
||||
}
|
||||
|
||||
type BundleSubsRsp struct {
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail// from uint32
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type BundleUsageReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
}
|
||||
|
||||
type BundleUsageRsp struct {
|
||||
|
||||
Code uint32 `json:"code"`// 2001: succ; else: fail
|
||||
Message string `json:"message"`
|
||||
|
||||
MoVoiceInSecond uint32 `json:"moVoiceInSecond"`
|
||||
MtVoiceInSecond uint32 `json:"mtVoiceInSecond"`
|
||||
DataVolumeInKB uint32 `json:"dataVolumeInKB"`
|
||||
SmsVolume uint32 `json:"smsVolume"`
|
||||
ExpiredTimestamp string `json:"expiredTimestamp"`// "YYYY-MM-DD HH:MM:SS"
|
||||
}
|
||||
|
||||
type RechargeReq struct {
|
||||
AccountId string `json:"accountId"`
|
||||
Amount string `json:"amount"`// to uint32
|
||||
OpType string `json:"opType"`// to uint8
|
||||
StaffId string `json:"staffId"`
|
||||
TelNumber string `json:"telNumber"`
|
||||
ValidyDays string `json:"validyDays"`// to uint16
|
||||
}
|
||||
|
||||
type RechargeRsp struct {
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail, from uint32
|
||||
Message string `json:"message"`
|
||||
Status string `json:"status"` // from uint8
|
||||
Balance string `json:"balance"`// from uint32
|
||||
ExpiredTimestamp string `json:"expiredTimestamp"`// "YYYY-MM-DD HH:MM:SS"
|
||||
}
|
||||
|
||||
type TransferReq struct {
|
||||
|
||||
TransferOut string `json:"transferOut"`
|
||||
TransferIn string `json:"transferIn"`
|
||||
Amount string `json:"amount"`// from uint32
|
||||
}
|
||||
|
||||
type TransferRsp struct {
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail, from uint32
|
||||
Message string `json:"message"`
|
||||
Balance string `json:"balance"`// from uint32
|
||||
}
|
||||
|
||||
type RechargeCardReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
CardPwd string `json:"cardPwd"`
|
||||
}
|
||||
|
||||
type RechargeCardRsp struct {
|
||||
|
||||
Code uint32 `json:"code"`// 2001: succ; else: fail
|
||||
Message string `json:"message"`
|
||||
RechargeAmount uint32 `json:"rechargeAmount"`
|
||||
Balance uint32 `json:"balance"`
|
||||
ExpiredTimestamp string `json:"expiredTimestamp"`// "%02d-%02d-%02d %02d:%02d:%02d"
|
||||
}
|
||||
|
||||
type CheckBalanceReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
Amount uint32 `json:"amount"`
|
||||
}
|
||||
|
||||
type CheckBalanceRsp struct {
|
||||
|
||||
Code uint32 `json:"code"`// 2001: succ; else: fail
|
||||
Message string `json:"message"`
|
||||
Available uint32 `json:"available"`
|
||||
}
|
||||
|
||||
type QueryBalanceReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
}
|
||||
|
||||
type QueryBalanceRsp struct {
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail, from uint32
|
||||
Message string `json:"message"`
|
||||
Status string `json:"status"`// from uint8
|
||||
Balance string `json:"balance"`// from uint32
|
||||
ExpireDate string `json:"expireDate"`// "YYYY-MM-DD HH:MM:SS"
|
||||
}
|
||||
|
||||
type QueryRechargeCardReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
}
|
||||
|
||||
type QueryRechargeCardRsp struct {
|
||||
|
||||
Code uint32 `json:"code"`// 2001: succ; else: fail
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type UpdateRechargeCardReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
}
|
||||
|
||||
type UpdateRechargeCardRsp struct {
|
||||
|
||||
Code uint32 `json:"code"`// 2001: succ; else: fail
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type CreateAccountReq struct {
|
||||
|
||||
ServiceNbr string `json:"serviceNbr"`
|
||||
CustId string `json:"custId"`// from uint32
|
||||
AccountId string `json:"accountId"`// from uint32
|
||||
ProductInstId string `json:"productInstId"`// from uint32
|
||||
PackageId string `json:"packageId"`// from uint32
|
||||
Balance string `json:"balance"`// from uint32
|
||||
//CustIdUint32 uint32 `json:"custIdUint32,omitempty"`// from uint32
|
||||
//AcctIdUint32 uint32 `json:"acctIdUint32,omitempty"`// from uint32
|
||||
|
||||
BalanceExpDate string `json:"balanceExpDate"`
|
||||
Birthday string `json:"birthday"`
|
||||
RentCharge string `json:"rentCharge,omitempty"`// from uint32
|
||||
CugId string `json:"cugId,omitempty"`// from uint32
|
||||
UserClass string `json:"userClass,omitempty"`// from uint32
|
||||
}
|
||||
|
||||
type CreateAccountRsp struct {
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail, from uint32
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type UpdateSubsReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
AccountId string `json:"accountId,omitempty"`// from uint32
|
||||
Status string `json:"status,omitempty"`// from uint8
|
||||
Balance string `json:"balance,omitempty"`// from uint32
|
||||
BalanceExpDate string `json:"balanceExpDate,omitempty"`
|
||||
|
||||
AccountIdU32 uint32 `json:"accountIdU32,omitempty"`
|
||||
StatusU8 byte `json:"statusU8,omitempty"`
|
||||
BalanceU32 uint32 `json:"balanceU32,omitempty"`
|
||||
ExpDateU32 uint32 `json:"balanceExpDateU32,omitempty"`
|
||||
OptFlag uint32 `json:"optFlagU32,omitempty"`
|
||||
PackageIdU32 uint32 `json:"packageIdU32,omitempty"`// from uint32
|
||||
RentChargeU32 uint32 `json:"rentChargeU32,omitempty"`// from uint32
|
||||
VasCugStatusU8 byte `json:"vasCugStatusU8,omitempty"`// from uint8
|
||||
|
||||
PackageId string `json:"packageId,omitempty"`// from uint32
|
||||
RentCharge string `json:"rentCharge,omitempty"`// from uint32
|
||||
VasCugStatus string `json:"vasCugStatus,omitempty"`// from uint8
|
||||
//Optional_flag uint32 `json:"optional_flag,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateSubsRsp struct {
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail, from uint32
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type DeleteSubsReq struct {
|
||||
|
||||
TelNumber string `json:"telNumber"`
|
||||
AcctType string `json:"acctType,omitempty"`// from uint8
|
||||
AcctId string `json:"acctID,omitempty"`// from uint32
|
||||
Cause string `json:"reason,omitempty"`// from uint8
|
||||
}
|
||||
|
||||
type DeleteSubsRsp struct {
|
||||
|
||||
Result byte
|
||||
ErrorCode uint32
|
||||
|
||||
Code string `json:"code"`// 2001: succ; else: fail, from uint32
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type UpdateBundleUsageReq struct {
|
||||
Msisdn string // tag 2
|
||||
ServiceType byte
|
||||
AccountId uint32
|
||||
PlanId uint32
|
||||
BundleId uint32
|
||||
PlanValue uint64
|
||||
PlanUsedValue uint64
|
||||
SessUpdateTime uint32
|
||||
PlanValueAddThisTime uint64
|
||||
}
|
||||
|
||||
//type RestMsgType int
|
||||
|
||||
const (
|
||||
REST_SEND_AUTHCODE_REQ byte = 5
|
||||
REST_SEND_AUTHCODE_RSP byte = 6
|
||||
REST_QUERY_USERDATA_REQ byte = 7
|
||||
REST_QUERY_USERDATA_RSP byte = 8
|
||||
REST_BUNDLE_SUBS_REQ byte = 9
|
||||
REST_BUNDLE_SUBS_RSP byte = 10
|
||||
REST_BUNDLE_USAGE_REQ byte = 11
|
||||
REST_BUNDLE_USAGE_RSP byte = 12
|
||||
REST_RECHARGE_REQ byte = 13
|
||||
REST_RECHARGE_RSP byte = 14
|
||||
REST_TRANSFER_REQ byte = 15
|
||||
REST_TRANSFER_RSP byte = 16
|
||||
REST_RECHARGE_CARD_REQ byte = 17
|
||||
REST_RECHARGE_CARD_RSP byte = 18
|
||||
REST_CHECK_BALANCE_REQ byte = 19
|
||||
REST_CHECK_BALANCE_RSP byte = 20
|
||||
REST_QUERY_BALANCE_REQ byte = 21
|
||||
REST_QUERY_BALANCE_RSP byte = 22
|
||||
REST_QUERY_RECHARGE_CARD_REQ byte = 23
|
||||
REST_QUERY_RECHARGE_CARD_RSP byte = 24
|
||||
REST_UPDATE_RECHARGE_CARD_REQ byte = 25
|
||||
REST_UPDATE_RECHARGE_CARD_RSP byte = 26
|
||||
|
||||
REST_CRM_PAYMENT_REQ byte = 27
|
||||
REST_CRM_PAYMENT_RES byte = 28
|
||||
|
||||
REST_CRM_SMS_DELIVER_REQ byte = 29
|
||||
REST_CRM_SMS_DELIVER_RES byte = 30
|
||||
|
||||
REST_CRM_CREATE_ACCT_REQ byte = 31
|
||||
REST_CRM_CREATE_ACCT_RES byte = 32
|
||||
|
||||
REST_CRM_QUERY_TARIFF_REQ byte = 33
|
||||
REST_CRM_QUERY_TARIFF_RES byte = 34
|
||||
|
||||
REST_CRM_UPDATE_SUBS_REQ byte = 35
|
||||
REST_CRM_UPDATE_SUBS_RES byte = 36
|
||||
|
||||
REST_CRM_DELETE_SUBS_REQ byte = 37
|
||||
REST_CRM_DELETE_SUBS_RES byte = 38
|
||||
|
||||
REST_CRM_UPDATE_SESS_INFO_REQ byte = 39
|
||||
REST_CRM_UPDATE_SESS_INFO_RES byte = 40
|
||||
|
||||
REST_CRM_UPDATE_PLAN_INFO_REQ byte = 41
|
||||
REST_CRM_UPDATE_PLAN_INFO_RES byte = 42
|
||||
|
||||
REST_CRM_RENT_CHARGE byte = 43
|
||||
)
|
||||
|
||||
type RestReq struct {
|
||||
MsgType byte
|
||||
Src_id uint16
|
||||
Dst_id uint16
|
||||
|
||||
AuthCodeReq AuthCodeReq
|
||||
QueryUserDataReq QueryUserDataReq
|
||||
BundleSubsReq BundleSubsReq
|
||||
BundleUsageReq BundleUsageReq
|
||||
RechargeReq RechargeReq
|
||||
TransferReq TransferReq
|
||||
RechargeCardReq RechargeCardReq
|
||||
CheckBalanceReq CheckBalanceReq
|
||||
QueryBalanceReq QueryBalanceReq
|
||||
QueryRechargeCardReq QueryRechargeCardReq
|
||||
UpdateRechargeCardReq UpdateRechargeCardReq
|
||||
CreateAccountReq CreateAccountReq
|
||||
UpdateSubsReq UpdateSubsReq
|
||||
DeleteSubsReq DeleteSubsReq
|
||||
}
|
||||
|
||||
type RestRsp struct {
|
||||
MsgType byte
|
||||
Src_id uint16
|
||||
Dst_id uint16
|
||||
|
||||
AuthCodeRsp AuthCodeRsp
|
||||
QueryUserDataRsp QueryUserDataRsp
|
||||
BundleSubsRsp BundleSubsRsp
|
||||
BundleUsageRsp BundleUsageRsp
|
||||
RechargeRsp RechargeRsp
|
||||
TransferRsp TransferRsp
|
||||
RechargeCardRsp RechargeCardRsp
|
||||
CheckBalanceRsp CheckBalanceRsp
|
||||
QueryBalanceRsp QueryBalanceRsp
|
||||
QueryRechargeCardRsp QueryRechargeCardRsp
|
||||
UpdateRechargeCardRsp UpdateRechargeCardRsp
|
||||
CreateAccountRsp CreateAccountRsp
|
||||
UpdateSubsRsp UpdateSubsRsp
|
||||
DeleteSubsRsp DeleteSubsRsp
|
||||
UpdateBundleUsageReq UpdateBundleUsageReq
|
||||
UpdateSubsReq UpdateSubsReq
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user