fix: adjustment directory structure
This commit is contained in:
177
proxy/MsgDef/canal.go
Normal file
177
proxy/MsgDef/canal.go
Normal file
@@ -0,0 +1,177 @@
|
||||
package MsgDef
|
||||
|
||||
const (
|
||||
TbAcctInfo = "tb_prd_prd_inst_551"
|
||||
TbOfrDetail = "tb_prd_ofr_detail_inst_551"
|
||||
TbTariff = "tb_bil_tariff"
|
||||
TbOfrInfo = "tb_prd_ofr"
|
||||
TbPricingStrategy = "tb_bil_evt_pricing_strategy"
|
||||
TbConfigArea = "config_area"
|
||||
TbPricingArea = "tb_bil_pricing_area"
|
||||
TbRr = "ratable_history"
|
||||
TbHoliday = "tb_bil_holiday_rel"
|
||||
TbBilHoliday = "tb_bil_holiday"
|
||||
TbSmsInfo = "tb_sms_info"
|
||||
TbSyncMobile = "tb_sync_mobile"
|
||||
)
|
||||
|
||||
type RecordChange struct {
|
||||
TableName string
|
||||
EventType string//entry.EventType
|
||||
|
||||
ChgAcctInfo []ChgAcctInfo
|
||||
ChgOfrDetail []ChgOfrDetail
|
||||
ChgTariff []ChgTariff
|
||||
ChgOfrInfo []ChgOfrInfo
|
||||
ChgPricingStrategy []ChgPricingStrategy
|
||||
ChgConfigArea []ChgConfigArea
|
||||
ChgPricingArea []ChgPricingArea
|
||||
ChgRr []ChgRr
|
||||
ChgHoliday []ChgHoliday
|
||||
ChgBilHoliday []ChgBilHoliday
|
||||
ChgAlertSms []ChgAlertSms
|
||||
ChgSyncMobile []ChgSyncMobile
|
||||
}
|
||||
|
||||
type ChgAcctInfo struct {
|
||||
PrdInstId int//string
|
||||
ServiceNbr string
|
||||
IfPrepaid string
|
||||
OldPrdInstStasId string
|
||||
NewPrdInstStasId string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgOfrDetail struct {
|
||||
OfrDetailInstId int//string
|
||||
OfrDetailTypeId string
|
||||
OldEffDate string
|
||||
NewEffDate string
|
||||
OldExpDate string
|
||||
NewExpDate string
|
||||
//OldCalcPriority string
|
||||
//NewCalcPriority string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgTariff struct {
|
||||
TariffId int//string
|
||||
}
|
||||
|
||||
type ChgOfrInfo struct {
|
||||
OfrId int//string
|
||||
OfrTypeId string
|
||||
IfPrepaid string
|
||||
OldCalcPriority string
|
||||
NewCalcPriority string
|
||||
OldOfrState string
|
||||
NewOfrState string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgPricingStrategy struct {
|
||||
EventPricingStrategyId int//string
|
||||
OldEventPriority string
|
||||
NewEventPriority string
|
||||
OldCallType string
|
||||
NewCallType string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgConfigArea struct {
|
||||
AreaId int//string
|
||||
OldAreaCode string
|
||||
NewAreaCode string
|
||||
OldState string
|
||||
NewState string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgPricingArea struct {
|
||||
OldStrategyId int//string
|
||||
NewStrategyId int//string
|
||||
OldAreaId int//string
|
||||
NewAreaId int//string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgRr struct {
|
||||
Id int64//tring
|
||||
OldBeginTime string
|
||||
NewBeginTime string
|
||||
OldEndTime string
|
||||
NewEndTime string
|
||||
OldFreeValue int64//string
|
||||
NewFreeValue int64//string
|
||||
OldValue int64//string
|
||||
NewValue int64//string
|
||||
OldOwnId string
|
||||
NewOwnId string
|
||||
OldOfrInstId string
|
||||
NewOfrInstId string
|
||||
OldPricingSubSectionId string
|
||||
NewPricingSubSectionId string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgHoliday struct {
|
||||
OldState string
|
||||
NewState string
|
||||
OldTariffId int//string
|
||||
NewTariffId int//string
|
||||
OldTariffSeq int//string
|
||||
NewTariffSeq int//string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgBilHoliday struct {
|
||||
HolidayId int//string
|
||||
OldState string
|
||||
NewState string
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgAlertSms struct {
|
||||
AlertId int
|
||||
ServiceNbr string
|
||||
SmsContent string
|
||||
OldState int
|
||||
NewState int
|
||||
|
||||
BUpdate bool
|
||||
}
|
||||
|
||||
type ChgSyncMobile struct {
|
||||
PreId int `redis:"preId,omitempty"`// key
|
||||
OperType int `redis:"operType"`// == 1, new; 2, replace imsi
|
||||
State int `redis:"state"`// == 1
|
||||
//Imsi string
|
||||
ServiceNbr string `redis:"serviceNbr"`
|
||||
CustId int `redis:"custId"`
|
||||
AcctId int `redis:"acctId"`
|
||||
PrdInstId int `redis:"prdInstId"`
|
||||
MobileType int `redis:"mobileType"`// == 1, mobile type
|
||||
BirthDate string `redis:"birthDate"`// date
|
||||
Balance int `redis:"balance"`
|
||||
BalanceExpDate string `redis:"balanceExpDate"`// datetime
|
||||
OfrId int `redis:"ofrId"`
|
||||
|
||||
Imsi string `redis:"imsi"`
|
||||
Ki string `redis:"ki"`
|
||||
Opc string `redis:"opc"`
|
||||
VmsFlag int `redis:"vmsFlag"`
|
||||
ExpDate string `redis:"expDate"`// datetime
|
||||
CugId int `redis:"cugId"`
|
||||
|
||||
OldState int// == 1
|
||||
//BUpdate bool
|
||||
}
|
||||
95
proxy/MsgDef/msg_struct.go
Normal file
95
proxy/MsgDef/msg_struct.go
Normal file
@@ -0,0 +1,95 @@
|
||||
package MsgDef
|
||||
|
||||
import (
|
||||
|
||||
)
|
||||
|
||||
//&prd_inst_id, &service_nbr, &prd_inst_stas_id, &acct_id, &cust_id
|
||||
type AcctData struct {
|
||||
AcctType int `redis:"acctType"`
|
||||
PrdInstId int `redis:"prdInstId"`
|
||||
ServiceNbr string `redis:"serviceNbr"`
|
||||
PrdInstStasId int `redis:"prdInstStasId"`
|
||||
AcctId int `redis:"acctId"`
|
||||
CustId int `redis:"custId"`
|
||||
OfrId int `redis:"ofrId"`
|
||||
OfrInstId int `redis:"ofrInstId"`
|
||||
EffTime string `redis:"effTime"`
|
||||
ExpTime string `redis:"expTime"`
|
||||
}
|
||||
|
||||
//SELECT rr.ID ratableId, rr.PRICING_SUB_SECTION_ID, rr.OFR_INST_ID, rr.BEGIN_TIME, rr.END_TIME,
|
||||
//rr.FREE_VALUE AS ratableValue, rr.`VALUE` usedRatable, g.MEASURE_DOMAIN, c.OFR_ID,
|
||||
//c.OFR_NAME, g.TARIFF_ID, g.START_REF_VALUE, g.END_REF_VALUE, c.CALC_PRIORITY, h.EVENT_PRIORITY
|
||||
type RrData struct {
|
||||
RrId int64 `redis:"rrId"`
|
||||
ServiceNbr string `redis:"serviceNbr"`
|
||||
PrdInstId int `redis:"prdInstId"`
|
||||
PricingSectionId int `redis:"pricingSectionId"`
|
||||
OfrInstId int `redis:"ofrInstId"`
|
||||
OfrId int `redis:"ofrId"`
|
||||
OfrName string `redis:"ofrName"`
|
||||
BeginTime string `redis:"beginTime"`
|
||||
EndTime string `redis:"endTime"`
|
||||
FreeValue int64 `redis:"freeValue"`
|
||||
UsedValue int64 `redis:"usedValue"`
|
||||
MeasureDomain string `redis:"measureDomain"`
|
||||
TariffId int `redis:"tariffId"`
|
||||
StartRefTime int `redis:"startRefTime"`
|
||||
EndRefTime int `redis:"endRefTime"`
|
||||
CalcPriority int `redis:"calcPriority"`
|
||||
EventPriority int `redis:"eventPriority"`
|
||||
StrategyId int `redis:"strategyId"`
|
||||
UnitFee int `redis:"unitFee"`
|
||||
RateUnit int `redis:"rateUnit"`
|
||||
}
|
||||
|
||||
// g.MEASURE_DOMAIN, time_to_sec(g.START_REF_VALUE) startTime, time_to_sec(g.END_REF_VALUE) endTime, g.SCALED_RATE_VALUE_ID feeUnit,
|
||||
// g.rate_unit rateUnit, c.CALC_PRIORITY,h.EVENT_PRIORITY,h.event_pricing_strategy_id,h.EVENT_PRICING_STRATEGY_NAME,c.ofr_id,c.OFR_NAME
|
||||
type TariffData struct {
|
||||
TariffId int `redis:"tariffId"`
|
||||
TariffSeq int `redis:"tariffSeq"`
|
||||
MeasureDomain string `redis:"measureDomain"`
|
||||
StartTime int `redis:"startTime"`
|
||||
EndTime int `redis:"endTime"`
|
||||
FeeUnit int `redis:"feeUnit"`
|
||||
RateUnit int `redis:"rateUnit"`
|
||||
CalcPriority int `redis:"calcPriority"`
|
||||
EventPriority int `redis:"eventPriority"`
|
||||
OfrId int `redis:"ofrId"`
|
||||
OfrName string `redis:"ofrName"`
|
||||
StrategyId int `redis:"strategyId"`
|
||||
StrategyName string `redis:"strategyName"`
|
||||
}
|
||||
|
||||
// SELECT DISTINCT ca.area_name, ca.area_code FROM TB_BIL_PRICING_AREA ar INNER JOIN config_area ca ON ca.area_id = ar.area_id WHERE ar.STRATEGY_ID = ?;
|
||||
type PrefixData struct {
|
||||
StrategyId int `redis:"StrategyId"`
|
||||
AreaName string `redis:"areaName"`
|
||||
AreaCode string `redis:"areaCode"`
|
||||
}
|
||||
|
||||
/*
|
||||
HD table import
|
||||
SELECT hr.ofr_id, hr.tariff_id, hr.tariff_seq, hr.holiday_group, hr.state hr_state, hr.holiday_discount,
|
||||
hd.HOLIDAY_ID, hd.STATE hd_state, hd.HOLIDAY_PRIORITY, hd.HOLIDAY_NAME, hd.HOLIDAY_TYPE, hd.HOLIDAY_BEGIN_DATE, hd.HOLIDAY_END_DATE
|
||||
FROM tb_bil_holiday_rel hr
|
||||
INNER JOIN tb_bil_holiday hd ON hr.holiday_group = hd.HOLIDAY_GROUP
|
||||
WHERE hr.tariff_id=? AND hr.tariff_seq=? AND hr.state = 1 AND hd.STATE = 'L0R';
|
||||
*/
|
||||
type HolidayDiscountData struct {
|
||||
OfrId int `redis:"ofrId"`
|
||||
TariffId int `redis:"tariffId"`
|
||||
TariffSeq int `redis:"tariffSeq"`
|
||||
HdGroup int `redis:"hdGroup"`
|
||||
HrState int `redis:"hrState"`
|
||||
HrDiscount int `redis:"hrDiscount"`
|
||||
|
||||
HdId int `redis:"hdId"`
|
||||
HdName string `redis:"hdName"`
|
||||
HdType string `redis:"hdType"`
|
||||
HdState string `redis:"hdState"`
|
||||
HdPriority int `redis:"hdPriority"`
|
||||
HdBeginDate string `redis:"hdBeginDate"`
|
||||
HdEndDate string `redis:"hdEndDate"`
|
||||
}
|
||||
Reference in New Issue
Block a user