123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- package main
- import "time"
- type GlobalConf struct {
- Mongob MgoConf
- Cron CronConf
- Mongop MgoConf
- Mysql MysqlConf
- Log Log
- Mongospider MgoConf
- Email EmailConf
- Clickhouse CkConf
- }
- type MgoConf struct {
- Host string
- DB string
- Coll string // 查询表
- Username string
- Password string
- Size int
- Direct bool
- List string
- Detail string
- }
- // CronConf 定时任务
- type CronConf struct {
- Spec string
- Url string
- Start int
- End int
- Delete int
- }
- type CkConf struct {
- Host string
- Username string
- Password string
- DB string
- }
- type MysqlConf struct {
- Address string
- Dbname string
- Username string
- Password string
- Prefix string //数据表前缀
- Table string
- Stime string
- Etime string
- Test bool
- }
- type Log struct {
- LogPath string
- MaxSize int
- Compress bool
- MaxAge int
- MaxBackups int
- LogLevel string
- Format string
- }
- type EmailConf struct {
- Api string
- To string
- }
- // ProjectBaseInfo 项目基本信息
- type ProjectBaseInfo struct {
- ID int `json:"id" gorm:"primaryKey;autoIncrement;column:id;comment:主键自增"`
- ProjectName string `json:"project_name" gorm:"size:255;index;not null;column:project_name;comment:项目名称,索引"`
- TotalInvestment float64 `json:"total_investment" gorm:"column:total_investment;comment:总投资(万元)"`
- Area string `json:"area" gorm:"size:255;column:area;comment:省份"`
- City string `json:"city" gorm:"size:255;column:city;comment:城市"`
- District string `json:"district" gorm:"size:255;column:district;comment:区县"`
- Capital float64 `json:"capital" gorm:"column:capital;comment:不含专项债的资本金(万元)"`
- ApplyTotalBonds float64 `json:"apply_total_bonds" gorm:"column:apply_total_bonds;comment:申请专项债总额(万元)"`
- OtherDebtFinancing float64 `json:"other_debt_financing" gorm:"column:other_debt_financing;comment:其他债务融资(万元)"`
- SpecialDebtCapital float64 `json:"special_debt_capital" gorm:"column:special_debt_capital;comment:专项债作资本金(万元)"`
- ExpectedReturn float64 `json:"expected_return" gorm:"column:expected_return;comment:预期收入(万元)"`
- ProjectCost int `json:"project_cost" gorm:"column:project_cost;comment:成本"`
- ProjectDomain string `json:"project_domain" gorm:"size:255;column:project_domain;comment:项目领域"`
- ProjectOwner string `json:"project_owner" gorm:"size:255;column:project_owner;comment:项目业主"`
- StartDate string `json:"start_date" gorm:"size:255;column:start_date;comment:建设期开始"`
- EndDate string `json:"end_date" gorm:"size:255;column:end_date;comment:建设期结束"`
- OperationStartDate string `json:"operation_start_date" gorm:"size:255;column:operation_start_date;comment:运营期开始"`
- OperationEndDate string `json:"operation_end_date" gorm:"size:255;column:operation_end_date;comment:运营期结束"`
- SourceIncome string `json:"source_income" gorm:"size:500;column:source_income;comment:收入来源"`
- ConstructionContent string `json:"construction_content" gorm:"size:500;column:construction_content;comment:建设内容"`
- Remarks string `json:"remarks" gorm:"size:500;column:remarks;comment:特殊情况备注"`
- OtherDebtFinancingSource string `json:"other_debt_financing_source" gorm:"size:500;column:other_debt_financing_source;comment:其他债务融资来源"`
- CostIncomePercent string `json:"cost_income_percent" gorm:"size:50;column:cost_income_percent;comment:成本/收入(%)"`
- CoverageMultiple float64 `json:"coverage_multiple" gorm:"column:coverage_multiple;comment:覆盖倍数"`
- CompetentDepartment string `json:"competent_department" gorm:"size:255;column:competent_department;comment:主管部门"`
- AccountingFirm string `json:"accounting_firm" gorm:"size:255;column:accounting_firm;comment:会计所"`
- LawFirm string `json:"law_firm" gorm:"size:255;column:law_firm;comment:律所"`
- CreateDate string `json:"create_date" gorm:"size:255;column:create_date;comment:原网站创建时间"`
- UpdateDate string `json:"update_date" gorm:"size:255;column:update_date;comment:原网站更新时间"`
- }
- // TableName 指定数据库表名
- func (ProjectBaseInfo) TableName() string {
- if GF.Mysql.Prefix != "" {
- return GF.Mysql.Prefix + "_project_base_info"
- } else {
- return "project_base_info"
- }
- }
- // ProjectChange 项目变更记录
- type ProjectChange struct {
- ID int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键自增"`
- ProjectID int `json:"project_id" gorm:"column:project_id;comment:项目ID" `
- ProjectName string `json:"project_name" gorm:"column:project_name;size:255;index;not null;comment:项目名称,索引"`
- ChangeContent string `json:"change_content,omitempty" gorm:"column:change_content;size:1000;comment:变更内容"`
- UpdateReason string `json:"update_reason" gorm:"column:update_reason;size:1000;comment:变更原因"`
- SubmitTime string `json:"submit_time" gorm:"column:submit_time;size:1000;comment:提交时间"`
- Comeintime *time.Time `json:"comeintime" gorm:"column:comeintime;autoCreateTime"` // 入库时间
- Updatetime *time.Time `json:"updatetime" gorm:"column:updatetime;autoUpdateTime"` // 更新时间
- }
- // TableName 指定数据库表名
- func (ProjectChange) TableName() string {
- if GF.Mysql.Prefix != "" {
- return GF.Mysql.Prefix + "_project_change"
- } else {
- return "project_change"
- }
- }
- // ProjectRepayment 项目还本付息
- type ProjectRepayment struct {
- ID int `json:"id" gorm:"primaryKey;autoIncrement;column:id;comment:主键自增"`
- ProjectID int `json:"project_id" gorm:"column:project_id;comment:项目ID" `
- ProjectName string `json:"project_name" gorm:"size:255;index;not null;column:project_name;comment:项目名称"`
- BondName string `json:"bond_name" gorm:"size:255;column:bond_name;comment:债券名称"`
- IssueTerm int `json:"issue_term" gorm:"column:issue_term;comment:发行期限(年)"`
- PayInterestMethodName string `json:"pay_interest_method_name" gorm:"size:255;column:pay_interest_method_name;comment:付息方式"`
- ValueDate string `json:"value_date" gorm:"size:50;column:value_date;comment:起息日"`
- InterestDate string `json:"interest_date" gorm:"size:50;column:interest_date;comment:付息日"`
- LastInterestDate string `json:"last_interest_date" gorm:"size:50;column:last_interest_date;comment:最近付息日"`
- ReminderRepayDays int `json:"reminder_repay_days" gorm:"column:reminder_repay_days;comment:提醒还款(天)"`
- MaturityDate string `json:"maturity_date" gorm:"size:50;column:maturity_date;comment:到期日"`
- DebtService float64 `json:"debt_service" gorm:"column:debt_service;comment:还本付息(万元)"`
- RedemptionMethod string `json:"redemption_method" gorm:"size:255;column:redemption_method;comment:赎回方式"`
- CumulativePayInterest int `json:"cumulative_pay_interest" gorm:"column:cumulative_pay_interest;comment:累计付息(万元)"`
- IsEarlyRepayPrincipal string `json:"is_early_repay_principal" gorm:"size:50;column:is_early_repay_principal;comment:提前还本"`
- Remarks string `json:"remarks" gorm:"size:5000;column:remarks;comment:备注"`
- }
- // TableName 指定数据库表名
- func (ProjectRepayment) TableName() string {
- if GF.Mysql.Prefix != "" {
- return GF.Mysql.Prefix + "_project_repayment"
- } else {
- return "project_repayment"
- }
- }
- // ProjectIssueDetails 项目发行明细表
- type ProjectIssueDetails struct {
- ID int `json:"id" gorm:"primaryKey;autoIncrement;column:id;comment:主键自增"`
- ProjectID int `json:"project_id" gorm:"column:project_id;comment:项目ID" `
- ProjectName string `json:"project_name" gorm:"size:255;index;not null;column:project_name;comment:项目名称"`
- ProjectBachName string `json:"project_bach_name" gorm:"size:255;index;not null;column:project_bach_name;comment:项目名称"`
- BondName string `json:"bond_name" gorm:"size:255;column:bond_name;comment:债券名称"`
- FirstPublishDate string `json:"first_publish_date" gorm:"size:50;column:first_publish_date;comment:发布时间"`
- BatchNum int `json:"batch_num" gorm:"column:batch_num;comment:批次"`
- PresentIssueAmount float64 `json:"present_issue_amount" gorm:"column:present_issue_amount;comment:发行额"`
- IssueInterestRate float64 `json:"issue_interest_rate" gorm:"column:issue_interest_rate;comment:发行利率"`
- PresentAsSpecialAmount float64 `json:"present_as_special_amount" gorm:"column:present_as_special_amount;comment:专项债作为资本金发行额"`
- TotalIssueAmount float64 `json:"total_issue_amount" gorm:"column:total_issue_amount;comment:累计发行金额"`
- ReviseLog string `json:"revise_log" gorm:"size:1000;column:revise_log;comment:调整记录"`
- }
- // TableName 指定数据库表名
- func (ProjectIssueDetails) TableName() string {
- if GF.Mysql.Prefix != "" {
- return GF.Mysql.Prefix + "_project_issue_details"
- } else {
- return "project_issue_details"
- }
- }
- // BondInfo 债券基本信息
- type BondInfo struct {
- ID int `json:"id" gorm:"primaryKey;autoIncrement;column:id;comment:主键自增"`
- BondName string `json:"bond_name" gorm:"size:255;index;not null;column:bond_name;comment:债券名称"`
- BondShortName string `json:"bond_short_name" gorm:"size:255;column:bond_short_name;comment:债券简称"`
- BondNo string `json:"bond_no" gorm:"size:100;column:bond_no;comment:债券编码"`
- Area string `json:"area" gorm:"size:100;column:area;comment:省份"`
- BondNature string `json:"bond_nature" gorm:"size:255;column:bond_nature;comment:债券性质"`
- BondType string `json:"bond_type" gorm:"size:255;column:bond_type;comment:债券类型"`
- OfficialProjectType string `json:"official_project_type" gorm:"size:255;column:official_project_type;comment:官方项目类型"`
- TotalAmount float64 `json:"total_amount" gorm:"column:total_amount;comment:发行金额(万元)"`
- IssueDate string `json:"issue_date" gorm:"type:datetime;column:issue_date;comment:发行日期"`
- IssuePlace string `json:"issue_place" gorm:"size:255;column:issue_place;comment:发行场所"`
- IssueTerm int `json:"issue_term" gorm:"column:issue_term;comment:发行期限(年)"`
- IssueInterestRate string `json:"issue_interest_rate" gorm:"size:50;column:issue_interest_rate;comment:发行利率(%)"`
- IssuePhase string `json:"issue_phase" gorm:"size:50;column:issue_phase;comment:发行期数"`
- WayOfPayInterest string `json:"way_of_pay_interest" gorm:"size:255;column:way_of_pay_interest;comment:付息方式"`
- NewBondAmount float64 `json:"new_bond_amount" gorm:"column:new_bond_amount;comment:新增债券(亿元)"`
- CounterBondAmount float64 `json:"counter_bond_amount" gorm:"column:counter_bond_amount;comment:置换债券(亿元)"`
- RefinancingBondAmount float64 `json:"refinancing_bond_amount" gorm:"column:refinancing_bond_amount;comment:再融资债券(亿元)"`
- RedemptionMethod string `json:"redemption_method" gorm:"size:255;column:redemption_method;comment:赎回方式"`
- ValueDate string `json:"value_date" gorm:"size:50;column:value_date;comment:起息日"`
- ExpiryDate string `json:"expiry_date" gorm:"size:50;column:expiry_date;comment:到息日"`
- PayInterestDate string `json:"pay_interest_date" gorm:"size:50;column:pay_interest_date;comment:付息日"`
- LatePayInterestDate string `json:"late_pay_interest_date" gorm:"size:50;column:late_pay_interest_date;comment:最近付息日"`
- RemindPayDays int `json:"remind_pay_days" gorm:"column:remind_pay_days;comment:提醒还款(天)"`
- LastPayInterest float64 `json:"last_pay_interest" gorm:"column:last_pay_interest;comment:上期已付息(亿元)"`
- IsEarlyRepayPrincipal string `json:"is_early_repay_prinipal" gorm:"size:50;column:is_early_repay_prinipal;comment:提前还本"`
- CumulativePayInterest float64 `json:"cumulative_pay_interest" gorm:"column:cumulative_pay_interest;comment:累计付息(亿元)"`
- IsCounterBond string `json:"is_counter_bond" gorm:"size:50;column:is_counter_bond;comment:柜台债"`
- }
- // TableName 指定数据库表名
- func (BondInfo) TableName() string {
- if GF.Mysql.Prefix != "" {
- return GF.Mysql.Prefix + "_bond_info"
- } else {
- return "bond_info"
- }
- }
- // BondAttachment 债券相关附件
- type BondAttachment struct {
- ID int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键自增"`
- BondName string `json:"bondName" gorm:"column:bondName;size:255;index;not null;comment:债券名称,索引"`
- File string `json:"file" gorm:"column:file;size:500;not null;comment:附件"`
- FileType string `json:"fileType,omitempty" gorm:"column:fileType;size:100;comment:附件类型"`
- Source string `json:"source,omitempty" gorm:"column:source;size:255;comment:资料来源"`
- PublishTime string `json:"publishTime,omitempty" gorm:"column:publishTime;size:50;comment:发布时间"`
- Comeintime *time.Time `json:"comeintime" gorm:"column:comeintime;autoCreateTime"` // 入库时间
- Updatetime *time.Time `json:"updatetime" gorm:"column:updatetime;autoUpdateTime"` // 更新时间
- }
- // TableName 指定数据库表名
- func (BondAttachment) TableName() string {
- if GF.Mysql.Prefix != "" {
- return GF.Mysql.Prefix + "_bond_attachment"
- } else {
- return "bond_attachment"
- }
- }
- // BondChangeLog 债券修改记录
- type BondChangeLog struct {
- ID int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键自增"`
- BondName string `json:"bondName" gorm:"column:bondName;size:255;index;not null;comment:债券名称"`
- ProjectName string `json:"projectName,omitempty" gorm:"column:projectName;size:255;comment:项目名称"`
- ChangeReason string `json:"changeReason,omitempty" gorm:"column:changeReason;size:500;comment:变更原因"`
- ChangeDetail string `json:"changeDetail,omitempty" gorm:"column:changeDetail;size:1000;comment:变更内容"`
- Comeintime *time.Time `json:"comeintime" gorm:"column:comeintime;autoCreateTime"` // 入库时间
- Updatetime *time.Time `json:"updatetime" gorm:"column:updatetime;autoUpdateTime"` // 更新时间
- }
- // TableName 指定数据库表名
- func (BondChangeLog) TableName() string {
- if GF.Mysql.Prefix != "" {
- return GF.Mysql.Prefix + "_bond_change_log"
- } else {
- return "bond_change_log"
- }
- }
- type ProjectBondRelation struct {
- ID int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键自增"`
- ProjectID int `json:"project_id" gorm:"column:project_id;comment:项目ID"`
- BondID int `json:"bond_id" gorm:"column:bond_id;comment:债券ID"`
- }
- // TableName 指定数据库表名
- func (ProjectBondRelation) TableName() string {
- if GF.Mysql.Prefix != "" {
- return GF.Mysql.Prefix + "_project_bond_relation"
- } else {
- return "project_bond_relation"
- }
- }
|