3D模型数据资源备份镜像批量处理
This commit is contained in:
@@ -11,6 +11,11 @@ func (m *FsProductModel) TableName() string {
|
||||
return m.name
|
||||
}
|
||||
|
||||
func (t *FsProductModel) FindAll(ctx context.Context) (resp []FsProduct, err error) {
|
||||
err = t.db.WithContext(ctx).Model(&FsProduct{}).Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (p *FsProductModel) FindOne(ctx context.Context, id int64, fields ...string) (resp *FsProduct, err error) {
|
||||
db := p.db.WithContext(ctx).Model(&FsProduct{}).Where("`id` = ? ", id)
|
||||
if len(fields) != 0 {
|
||||
|
||||
@@ -2,6 +2,10 @@ package gmodel
|
||||
|
||||
import "context"
|
||||
|
||||
func (t *FsProductModel3dLightModel) FindAll(ctx context.Context) (resp []FsProductModel3dLight, err error) {
|
||||
err = t.db.WithContext(ctx).Model(&FsProductModel3dLight{}).Limit(10).Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
func (l *FsProductModel3dLightModel) FindOne(ctx context.Context, id int64) (resp *FsProductModel3dLight, err error) {
|
||||
err = l.db.WithContext(ctx).Model(&FsProductModel3dLight{}).Where("`id` = ? and `status` = ?", id, 1).Take(&resp).Error
|
||||
return resp, err
|
||||
|
||||
@@ -19,6 +19,11 @@ type StepPriceJsonStruct struct {
|
||||
MinBuyUnitsNum int64 `json:"min_buy_units_num"`
|
||||
}
|
||||
|
||||
func (t *FsProductModel3dModel) FindAll(ctx context.Context) (resp []FsProductModel3d, err error) {
|
||||
err = t.db.WithContext(ctx).Model(&FsProductModel3d{}).Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (d *FsProductModel3dModel) FindOne(ctx context.Context, id int64, fields ...string) (resp *FsProductModel3d, err error) {
|
||||
db := d.db.WithContext(ctx).Model(&FsProductModel3d{}).Where("`id` = ? and `status` =? ", id, 1)
|
||||
if len(fields) > 0 {
|
||||
|
||||
@@ -4,6 +4,11 @@ import (
|
||||
"context"
|
||||
)
|
||||
|
||||
func (t *FsProductTemplateTagsModel) FindAll(ctx context.Context) (resp []FsProductTemplateTags, err error) {
|
||||
err = t.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (pt *FsProductTemplateTagsModel) GetListByIds(ctx context.Context, ids []int64) (resp []FsProductTemplateTags, err error) {
|
||||
if len(ids) == 0 {
|
||||
return
|
||||
|
||||
@@ -4,6 +4,11 @@ import (
|
||||
"context"
|
||||
)
|
||||
|
||||
func (t *FsProductTemplateV2Model) FindAll(ctx context.Context) (resp []FsProductTemplateV2, err error) {
|
||||
err = t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (t *FsProductTemplateV2Model) FindAllByProductIds(ctx context.Context, productIds []int64, sort string, fields ...string) (resp []FsProductTemplateV2, err error) {
|
||||
if len(productIds) == 0 {
|
||||
return
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
package gmodel
|
||||
|
||||
import "context"
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
func (t *FsToolLogsModel) FindAll(ctx context.Context) (resp []FsToolLogs, err error) {
|
||||
err = t.db.WithContext(ctx).Model(&FsToolLogs{}).Limit(10).Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user