1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package crm
- import (
- "hongze/hz_eta_docs_api/global"
- "time"
- )
- type HelpDoc struct {
- Id int `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
- ClassifyId int `gorm:"column:classify_id;default:0" json:"classify_id"`
- ClassifyName string `gorm:"column:classify_name" json:"classify_name"`
- Title string `gorm:"column:title" json:"title"`
- Author string `gorm:"column:author" json:"author"`
- CreateTime time.Time `gorm:"column:create_time;default:CURRENT_TIMESTAMP" json:"create_time"`
- ModifyTime time.Time `gorm:"column:modify_time;default:CURRENT_TIMESTAMP" json:"modify_time"`
- Status int `gorm:"column:status;default:1" json:"status"`
- PublishTime time.Time `gorm:"column:publish_time" json:"publish_time"`
- Content string `gorm:"column:content" json:"content"`
- AdminId int `gorm:"column:admin_id;default:0;NOT NULL" json:"admin_id"`
- AdminRealName string `gorm:"column:admin_real_name" json:"admin_real_name"`
- Anchor string `gorm:"column:anchor" json:"anchor"`
- Recommend string `gorm:"column:recommend" json:"recommend"`
- }
- func (m *HelpDoc) TableName() string {
- return "`help_doc`"
- }
- func (m *HelpDoc) GetItemByCondition(condition string, pars []interface{}, orderRule string) (item *HelpDoc, err error) {
- if orderRule == "" {
- orderRule = "create_time DESC"
- }
- err = global.MYSQL["hz_crm"].Where(condition, pars...).Order(orderRule).Limit(1).Find(&item).Error
- return
- }
- type HelpDocResp struct {
- Id int `orm:"column(id);pk"`
- ClassifyId int
- Title string
- Author string
- CreateTime string
- ModifyTime string
- Status int
- PublishTime string
- Content string
- AdminId int
- AdminRealName string
- Anchor []AnchorList
- Recommend []RecommendList
- }
- type AnchorList struct {
- AnchorId string
- Anchor string
- Child []AnchorList
- }
- type RecommendList struct {
- Name string
- Url string
- }
|