no message
parent
da8ae4eb1d
commit
27ab4fa202
|
@ -12,7 +12,6 @@ import (
|
|||
)
|
||||
|
||||
type Doc struct {
|
||||
<<<<<<< .merge_file_a12396
|
||||
ID int64 `json:"id" gorm:"column:id" sql:"id"`
|
||||
Title string `json:"title" gorm:"column:title" sql:"title"`
|
||||
Type int32 `json:"type" gorm:"column:type" sql:"type"`
|
||||
|
@ -25,20 +24,6 @@ type Doc struct {
|
|||
IsPublic int32 `json:"is_public" gorm:"column:is_public" sql:"is_public"`
|
||||
Deleted int32 `json:"deleted" gorm:"column:deleted" sql:"deleted"`
|
||||
OriginUrl string `json:"origin_url" gorm:"column:origin_url" sql:"origin_url"`
|
||||
=======
|
||||
ID int64 `json:"id" gorm:"column:id" sql:"id"`
|
||||
Title string `json:"title" gorm:"column:title" sql:"title"`
|
||||
Type int32 `json:"type" gorm:"column:type" sql:"type"`
|
||||
Content string `json:"content" gorm:"column:content" sql:"content"`
|
||||
Author string `json:"author" gorm:"column:author" sql:"author"`
|
||||
CreateTime time.Time `json:"create_time" gorm:"column:create_time" sql:"create_time"`
|
||||
UpdateTime time.Time `json:"update_time" gorm:"column:update_time" sql:"update_time"`
|
||||
DeleteTime time.Time `json:"delete_time" gorm:"column:delete_time" sql:"delete_time"`
|
||||
Version int32 `json:"version" gorm:"column:version" sql:"version"`
|
||||
IsPublic int32 `json:"is_public" gorm:"column:is_public" sql:"is_public"`
|
||||
Deleted int32 `json:"deleted" gorm:"column:deleted" sql:"deleted"`
|
||||
OriginUrl string `json:"origin_url" gorm:"column:origin_url" sql:"origin_url"`
|
||||
>>>>>>> .merge_file_a29080
|
||||
}
|
||||
|
||||
type DocGroup struct {
|
||||
|
@ -105,11 +90,7 @@ UpdateDoc 更新文档
|
|||
func UpdateDoc(doc Doc) error {
|
||||
sql := fmt.Sprintf(`update doc set doc.author = '%s' ,doc.title = '%s',doc.type = '%d',doc.content = '%s' ,doc.update_time = '%s' ,doc.version = '%d' where doc.id = '%d'; `,
|
||||
doc.Author, doc.Title, doc.Type,
|
||||
<<<<<<< .merge_file_a12396
|
||||
strings.Replace(doc.Content, "'", "\\'", -1), time.Now().Format("2006-01-02 15:04:05"),doc.Version, doc.ID)
|
||||
=======
|
||||
strings.Replace(doc.Content, "'", "\\'", -1), time.Now().Format("2006-01-02 15:04:05"), doc.Version, doc.ID)
|
||||
>>>>>>> .merge_file_a29080
|
||||
_, e := db.GetMysqlClient().Query(sql)
|
||||
if nil != e {
|
||||
logs.Error(e.Error())
|
||||
|
@ -172,10 +153,6 @@ func DeleteArticleType(id int32) error {
|
|||
return nil
|
||||
|
||||
}
|
||||
<<<<<<< .merge_file_a12396
|
||||
=======
|
||||
|
||||
>>>>>>> .merge_file_a29080
|
||||
func GetAllDocs() ([]Doc, error) {
|
||||
ret := []Doc{}
|
||||
sql := fmt.Sprintf("select * from doc")
|
||||
|
|
Loading…
Reference in New Issue