123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- package models
- import (
- _ "github.com/go-sql-driver/mysql"
- "hongze/hongze_clpt/utils"
- "time"
- "github.com/beego/beego/v2/client/orm"
- )
- func init() {
- _ = orm.RegisterDataBase("default", "mysql", utils.MYSQL_URL_CYGX)
- orm.SetMaxIdleConns("default", 50)
- orm.SetMaxOpenConns("default", 100)
- cygx_db, _ := orm.GetDB("default")
- cygx_db.SetConnMaxLifetime(10 * time.Minute)
- _ = orm.RegisterDataBase("weekly_report", "mysql", utils.MYSQL_URL)
- orm.SetMaxIdleConns("weekly_report", 50)
- orm.SetMaxOpenConns("weekly_report", 100)
- db, _ := orm.GetDB("weekly_report")
- db.SetConnMaxLifetime(10 * time.Minute)
- _ = orm.RegisterDataBase("rddp", "mysql", utils.MYSQL_URL_RDDP)
- orm.SetMaxIdleConns("rddp", 50)
- orm.SetMaxOpenConns("rddp", 100)
- report_db, _ := orm.GetDB("rddp")
- report_db.SetConnMaxLifetime(10 * time.Minute)
- //注册对象
- orm.RegisterModel(
- new(WxUser),
- new(WxUserCode),
- new(UserRecord),
- new(CygxUserRecord),
- new(CygxClptSession),
- new(CygxIndustryFllow),
- new(MsgCode),
- new(CygxArticleCollect),
- new(CygxInterviewApply),
- new(CygxArticleAsk),
- new(CygxSearchKeyWord),
- new(CygxSearchKeyWordLog),
- new(Resource),
- new(CygxXzsChooseCategory),
- new(CygxReportIndustrialSeaarchHistory),
- new(CygxMicroRoadshowVideoHistory),
- new(CygxActivitySignup),
- new(CygxActivitySignupLog),
- new(CygxMySchedule),
- new(CygxActivitySpecialSignup),
- new(CygxUserFollowSpecial),
- new(CygxActivitySpecialTrip),
- new(CygxActivityMeetingReminder),
- new(CygxActivityMeetingReminderLog),
- new(CygxActivityAppointment),
- new(CygxActivityHelpAsk),
- new(UserTemplateRecord),
- new(CygxAdvice),
- new(CygxPageHistoryRecord),
- new(CygxArticleDepartmentFollow),
- new(CygxArticleComment),
- new(CygxArticleViewRecord),
- new(CygxArticleHistoryRecordNewpv),
- new(CygxArticleHistoryRecord),
- new(CygxArticleHistoryRecordAll),
- new(CygxActivitySpecialTripBill),
- new(CygxReportHistoryRecord),
- new(CygxReportSelectionSubjectHistory),
- new(CygxMinutesSummaryVoiceHistory),
- new(CygxResearchSummaryVoiceHistory),
- new(CygxProductInteriorHistory),
- new(CygxAboutUsVideoHistory),
- new(CygxTacticsTimeLineHistory),
- new(CygxBannerHistory),
- new(CygxReportHistoryRecordLog),
- new(CygxUserLabel),
- new(CygxInviteCompany),
- new(CygxApplyRecord),
- new(CygxTagHistory),
- new(CygxActivitySpecialMeetingDetail),
- new(CygxActivityVoiceHistory),
- new(CygxApplyCollection),
- new(CygxActivitySpecialInheritPointsCompany),
- new(CygxArticleApplyAppointmentExpert),
- new(CygxBannerYxSurvey),
- new(CygxReportSelectionLogApply),
- new(CygxIndustryFllowLog),
- new(CygxYanxuanSpecialRecord),
- new(CygxYanxuanSpecialRecordLog),
- new(CygxYanxuanSpecialCollect),
- new(CygxYanxuanSpecial),
- new(CygxYanxuanSpecialFollow),
- new(CygxYanxuanSpecialCompany),
- new(CygxYanxuanSpecialApprovalLog),
- new(CygxResourceData),
- new(CygxMorningMeetingReviewChapterHistory),
- new(CygxAskserieVideoHistoryRecord),
- new(CygxAskserieVideoCollection),
- new(CygxAskserieVideoCollect),
- new(CygxVoiceAndVideoHistory),
- new(CygxActivityVideoHistory),
- new(CygxTimelineLog),
- new(CygxActivitySpecialPermissionPoints),
- new(CygxXzsChooseCategoryZhouqi),
- )
- // 记录ORM查询日志
- orm.Debug = true
- orm.DebugLog = orm.NewLog(utils.Binlog)
- }
|