@@ -20,7 +20,6 @@ require ( | |||||
github.com/mattn/go-isatty v0.0.19 // indirect | github.com/mattn/go-isatty v0.0.19 // indirect | ||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||||
github.com/modern-go/reflect2 v1.0.2 // indirect | github.com/modern-go/reflect2 v1.0.2 // indirect | ||||
github.com/stretchr/testify v1.8.4 // indirect | |||||
github.com/syndtr/goleveldb v1.0.0 // indirect | github.com/syndtr/goleveldb v1.0.0 // indirect | ||||
go.uber.org/atomic v1.6.0 // indirect | go.uber.org/atomic v1.6.0 // indirect | ||||
go.uber.org/multierr v1.5.0 // indirect | go.uber.org/multierr v1.5.0 // indirect | ||||
@@ -11,4 +11,5 @@ type UserTagDao interface { | |||||
UserTagAllByAscByPage(page, limit int) (*[]model.UserTag, int64, error) | UserTagAllByAscByPage(page, limit int) (*[]model.UserTag, int64, error) | ||||
UserTagUpdate(id interface{}, userTag *model.UserTag, forceColumns ...string) (int64, error) | UserTagUpdate(id interface{}, userTag *model.UserTag, forceColumns ...string) (int64, error) | ||||
UserTagDeleteBySession(session *xorm.Session, tagID interface{}) (int64, error) | UserTagDeleteBySession(session *xorm.Session, tagID interface{}) (int64, error) | ||||
UserTagInsert(userTag *model.UserTag) (int, error) | |||||
} | } |
@@ -57,3 +57,11 @@ func (u UserTagDb) UserTagDeleteBySession(session *xorm.Session, tagID interface | |||||
return session.Where("id = ?", tagID).Delete(model.UserTag{}) | return session.Where("id = ?", tagID).Delete(model.UserTag{}) | ||||
} | } | ||||
} | } | ||||
func (u UserTagDb) UserTagInsert(userTag *model.UserTag) (int, error) { | |||||
_, err := u.Db.InsertOne(userTag) | |||||
if err != nil { | |||||
return 0, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return userTag.Id, nil | |||||
} |
@@ -1,14 +1,10 @@ | |||||
package model | package model | ||||
import ( | |||||
"time" | |||||
) | |||||
type UserTag struct { | type UserTag struct { | ||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
TagName string `json:"tag_name" xorm:"not null default '' comment('tag名') index VARCHAR(16)"` | |||||
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(80)"` | |||||
IsPunish int `json:"is_punish" xorm:"not null default 0 comment('是否为处罚标签(0:否 1:是)') TINYINT(1)"` | |||||
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
TagName string `json:"tag_name" xorm:"not null default '' comment('tag名') index VARCHAR(16)"` | |||||
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(80)"` | |||||
IsPunish int `json:"is_punish" xorm:"not null default 0 comment('是否为处罚标签(0:否 1:是)') TINYINT(1)"` | |||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
} | } |