删除没必要的文件
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var _ FsAddressModel = (*customFsAddressModel)(nil)
|
||||
|
||||
type (
|
||||
// FsAddressModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsAddressModel.
|
||||
FsAddressModel interface {
|
||||
fsAddressModel
|
||||
FindDataAddressList(ctx context.Context, userid int64) (*DataAddressList, error)
|
||||
}
|
||||
|
||||
customFsAddressModel struct {
|
||||
*defaultFsAddressModel
|
||||
}
|
||||
|
||||
DataAddressList struct {
|
||||
Id int64 `db:"id" json:"id"`
|
||||
UserId int64 `db:"user_id" json:"user_id"` // 用户ID
|
||||
Name string `db:"name" json:"name"` // 地址名称
|
||||
FirstName string `db:"first_name" json:"first_name"` // FirstName
|
||||
LastName string `db:"last_name" json:"last_name"` // LastName
|
||||
Mobile string `db:"mobile" json:"mobile"` // 手机号码
|
||||
Street string `db:"street" json:"street"` // 街道
|
||||
Suite string `db:"suite" json:"suite"` // 房号
|
||||
City string `db:"city" json:"city"` // 城市
|
||||
State string `db:"state" json:"state"` // 州名
|
||||
ZipCode string `db:"zip_code" json:"zip_code"` // 邮编
|
||||
IsDefault int64 `db:"is_default" json:"is_default"` // 1默认地址,0非默认地址
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
// DataAddressList 结构需要的字段
|
||||
fsDataAddressListRows = strings.Join(stringx.Remove(fsAddressFieldNames, "`status`", "`country`"), ",")
|
||||
)
|
||||
|
||||
// NewFsAddressModel returns a model for the database table.
|
||||
func NewFsAddressModel(conn sqlx.SqlConn) FsAddressModel {
|
||||
return &customFsAddressModel{
|
||||
defaultFsAddressModel: newFsAddressModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsAddressModel) FindDataAddressList(ctx context.Context, userid int64) (*DataAddressList, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `user_id` = ? ", fsDataAddressListRows, m.table)
|
||||
var resp DataAddressList
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, userid)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsAddressFieldNames = builder.RawFieldNames(&FsAddress{})
|
||||
fsAddressRows = strings.Join(fsAddressFieldNames, ",")
|
||||
fsAddressRowsExpectAutoSet = strings.Join(stringx.Remove(fsAddressFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsAddressRowsWithPlaceHolder = strings.Join(stringx.Remove(fsAddressFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsAddressModel interface {
|
||||
Insert(ctx context.Context, data *FsAddress) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsAddress, error)
|
||||
Update(ctx context.Context, data *FsAddress) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsAddressModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsAddress struct {
|
||||
Id int64 `db:"id"`
|
||||
UserId int64 `db:"user_id"` // 用户ID
|
||||
Name string `db:"name"` // 地址名称
|
||||
FirstName string `db:"first_name"` // FirstName
|
||||
LastName string `db:"last_name"` // LastName
|
||||
Mobile string `db:"mobile"` // 手机号码
|
||||
Street string `db:"street"` // 街道
|
||||
Suite string `db:"suite"` // 房号
|
||||
City string `db:"city"` // 城市
|
||||
State string `db:"state"` // 州名
|
||||
Country string `db:"country"` // 国家
|
||||
ZipCode string `db:"zip_code"` // 邮编
|
||||
Status int64 `db:"status"` // 1正常 0异常
|
||||
IsDefault int64 `db:"is_default"` // 1默认地址,0非默认地址
|
||||
}
|
||||
)
|
||||
|
||||
func newFsAddressModel(conn sqlx.SqlConn) *defaultFsAddressModel {
|
||||
return &defaultFsAddressModel{
|
||||
conn: conn,
|
||||
table: "`fs_address`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsAddressModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsAddressModel) FindOne(ctx context.Context, id int64) (*FsAddress, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsAddressRows, m.table)
|
||||
var resp FsAddress
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsAddressModel) Insert(ctx context.Context, data *FsAddress) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsAddressRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.UserId, data.Name, data.FirstName, data.LastName, data.Mobile, data.Street, data.Suite, data.City, data.State, data.Country, data.ZipCode, data.Status, data.IsDefault)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsAddressModel) Update(ctx context.Context, data *FsAddress) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsAddressRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.UserId, data.Name, data.FirstName, data.LastName, data.Mobile, data.Street, data.Suite, data.City, data.State, data.Country, data.ZipCode, data.Status, data.IsDefault, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsAddressModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsCanteenProductModel = (*customFsCanteenProductModel)(nil)
|
||||
|
||||
type (
|
||||
// FsCanteenProductModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsCanteenProductModel.
|
||||
FsCanteenProductModel interface {
|
||||
fsCanteenProductModel
|
||||
GetAllByCanteenTypeId(ctx context.Context, canteenTypeId int64) (resp []FsCanteenProduct, err error)
|
||||
}
|
||||
|
||||
customFsCanteenProductModel struct {
|
||||
*defaultFsCanteenProductModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsCanteenProductModel returns a model for the database table.
|
||||
func NewFsCanteenProductModel(conn sqlx.SqlConn) FsCanteenProductModel {
|
||||
return &customFsCanteenProductModel{
|
||||
defaultFsCanteenProductModel: newFsCanteenProductModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenProductModel) GetAllByCanteenTypeId(ctx context.Context, canteenTypeId int64) (resp []FsCanteenProduct, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `canteen_type` = ? and `status` = ?", fsCanteenProductRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, canteenTypeId, 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsCanteenProductFieldNames = builder.RawFieldNames(&FsCanteenProduct{})
|
||||
fsCanteenProductRows = strings.Join(fsCanteenProductFieldNames, ",")
|
||||
fsCanteenProductRowsExpectAutoSet = strings.Join(stringx.Remove(fsCanteenProductFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsCanteenProductRowsWithPlaceHolder = strings.Join(stringx.Remove(fsCanteenProductFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsCanteenProductModel interface {
|
||||
Insert(ctx context.Context, data *FsCanteenProduct) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsCanteenProduct, error)
|
||||
Update(ctx context.Context, data *FsCanteenProduct) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsCanteenProductModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsCanteenProduct struct {
|
||||
Id int64 `db:"id"` // ID
|
||||
CanteenType int64 `db:"canteen_type"` // 餐厅类别id
|
||||
ProductId int64 `db:"product_id"` // 产品id
|
||||
SizeId int64 `db:"size_id"` // 尺寸id
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
Status int64 `db:"status"` // 状态位 1启用0停用
|
||||
Ctime int64 `db:"ctime"` // 添加时间
|
||||
Sid string `db:"sid"` // 前端带入的id
|
||||
}
|
||||
)
|
||||
|
||||
func newFsCanteenProductModel(conn sqlx.SqlConn) *defaultFsCanteenProductModel {
|
||||
return &defaultFsCanteenProductModel{
|
||||
conn: conn,
|
||||
table: "`fs_canteen_product`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenProductModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenProductModel) FindOne(ctx context.Context, id int64) (*FsCanteenProduct, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsCanteenProductRows, m.table)
|
||||
var resp FsCanteenProduct
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenProductModel) Insert(ctx context.Context, data *FsCanteenProduct) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, fsCanteenProductRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.CanteenType, data.ProductId, data.SizeId, data.Sort, data.Status, data.Ctime, data.Sid)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenProductModel) Update(ctx context.Context, data *FsCanteenProduct) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsCanteenProductRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.CanteenType, data.ProductId, data.SizeId, data.Sort, data.Status, data.Ctime, data.Sid, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenProductModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsCanteenTypeModel = (*customFsCanteenTypeModel)(nil)
|
||||
|
||||
type (
|
||||
// FsCanteenTypeModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsCanteenTypeModel.
|
||||
FsCanteenTypeModel interface {
|
||||
fsCanteenTypeModel
|
||||
FindGetType(ctx context.Context) ([]*FsGetTypeCanteenType, error)
|
||||
}
|
||||
|
||||
customFsCanteenTypeModel struct {
|
||||
*defaultFsCanteenTypeModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsCanteenTypeModel returns a model for the database table.
|
||||
func NewFsCanteenTypeModel(conn sqlx.SqlConn) FsCanteenTypeModel {
|
||||
return &customFsCanteenTypeModel{
|
||||
defaultFsCanteenTypeModel: newFsCanteenTypeModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
// FsGetTypeCanteenType GetType返回前端的结构
|
||||
type FsGetTypeCanteenType struct {
|
||||
Id int64 `db:"id" json:"key"` // ID
|
||||
Name string `db:"name" json:"name"` // 餐厅名字
|
||||
}
|
||||
|
||||
// FindGetType 根据status = 1查询出所有,fs_canteen_type 的类型,并排序desc
|
||||
func (m *defaultFsCanteenTypeModel) FindGetType(ctx context.Context) ([]*FsGetTypeCanteenType, error) {
|
||||
query := fmt.Sprintf("select X.id,X.name from (select %s from %s where status = 1 order by sort desc) X", fsCanteenTypeRows, m.table)
|
||||
var resp []*FsGetTypeCanteenType
|
||||
err := m.conn.QueryRows(&resp, query)
|
||||
switch err {
|
||||
case nil:
|
||||
return resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsCanteenTypeFieldNames = builder.RawFieldNames(&FsCanteenType{})
|
||||
fsCanteenTypeRows = strings.Join(fsCanteenTypeFieldNames, ",")
|
||||
fsCanteenTypeRowsExpectAutoSet = strings.Join(stringx.Remove(fsCanteenTypeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsCanteenTypeRowsWithPlaceHolder = strings.Join(stringx.Remove(fsCanteenTypeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsCanteenTypeModel interface {
|
||||
Insert(ctx context.Context, data *FsCanteenType) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsCanteenType, error)
|
||||
Update(ctx context.Context, data *FsCanteenType) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsCanteenTypeModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsCanteenType struct {
|
||||
Id int64 `db:"id"` // ID
|
||||
Name string `db:"name"` // 餐厅名字
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
Status int64 `db:"status"` // 状态位 1启用0停用
|
||||
Ctime int64 `db:"ctime"` // 添加时间
|
||||
}
|
||||
)
|
||||
|
||||
func newFsCanteenTypeModel(conn sqlx.SqlConn) *defaultFsCanteenTypeModel {
|
||||
return &defaultFsCanteenTypeModel{
|
||||
conn: conn,
|
||||
table: "`fs_canteen_type`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenTypeModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenTypeModel) FindOne(ctx context.Context, id int64) (*FsCanteenType, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsCanteenTypeRows, m.table)
|
||||
var resp FsCanteenType
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenTypeModel) Insert(ctx context.Context, data *FsCanteenType) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsCanteenTypeRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Name, data.Sort, data.Status, data.Ctime)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenTypeModel) Update(ctx context.Context, data *FsCanteenType) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsCanteenTypeRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Name, data.Sort, data.Status, data.Ctime, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsCanteenTypeModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ FsCartModel = (*customFsCartModel)(nil)
|
||||
|
||||
type (
|
||||
// FsCartModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsCartModel.
|
||||
FsCartModel interface {
|
||||
fsCartModel
|
||||
}
|
||||
|
||||
customFsCartModel struct {
|
||||
*defaultFsCartModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsCartModel returns a model for the database table.
|
||||
func NewFsCartModel(conn sqlx.SqlConn) FsCartModel {
|
||||
return &customFsCartModel{
|
||||
defaultFsCartModel: newFsCartModel(conn),
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsCartFieldNames = builder.RawFieldNames(&FsCart{})
|
||||
fsCartRows = strings.Join(fsCartFieldNames, ",")
|
||||
fsCartRowsExpectAutoSet = strings.Join(stringx.Remove(fsCartFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsCartRowsWithPlaceHolder = strings.Join(stringx.Remove(fsCartFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsCartModel interface {
|
||||
Insert(ctx context.Context, data *FsCart) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsCart, error)
|
||||
Update(ctx context.Context, data *FsCart) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsCartModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsCart struct {
|
||||
Id int64 `db:"id"` // id
|
||||
UserId sql.NullInt64 `db:"user_id"` // 用户ID
|
||||
ProductId int64 `db:"product_id"` // 产品ID
|
||||
TemplateId int64 `db:"template_id"` // 模板ID
|
||||
PriceId int64 `db:"price_id"` // 价格ID
|
||||
MaterialId int64 `db:"material_id"` // 材质ID
|
||||
SizeId int64 `db:"size_id"` // 尺寸ID
|
||||
BuyNum int64 `db:"buy_num"` // 购买数量
|
||||
Cover string `db:"cover"` // 截图
|
||||
DesignId int64 `db:"design_id"` // 设计ID
|
||||
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
|
||||
Status int64 `db:"status"` // 状态位
|
||||
OptionalId int64 `db:"optional_id"` // 选项ID
|
||||
IsCheck int64 `db:"is_check"` // 是否选中状态(0:未选中,1:选中)
|
||||
TsTime time.Time `db:"ts_time"`
|
||||
IsEmail int64 `db:"is_email"` // 是否发送邮件
|
||||
}
|
||||
)
|
||||
|
||||
func newFsCartModel(conn sqlx.SqlConn) *defaultFsCartModel {
|
||||
return &defaultFsCartModel{
|
||||
conn: conn,
|
||||
table: "`fs_cart`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsCartModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsCartModel) FindOne(ctx context.Context, id int64) (*FsCart, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsCartRows, m.table)
|
||||
var resp FsCart
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsCartModel) Insert(ctx context.Context, data *FsCart) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsCartRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.UserId, data.ProductId, data.TemplateId, data.PriceId, data.MaterialId, data.SizeId, data.BuyNum, data.Cover, data.DesignId, data.Ctime, data.Status, data.OptionalId, data.IsCheck, data.TsTime, data.IsEmail)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsCartModel) Update(ctx context.Context, data *FsCart) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsCartRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.UserId, data.ProductId, data.TemplateId, data.PriceId, data.MaterialId, data.SizeId, data.BuyNum, data.Cover, data.DesignId, data.Ctime, data.Status, data.OptionalId, data.IsCheck, data.TsTime, data.IsEmail, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsCartModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ FsFaqModel = (*customFsFaqModel)(nil)
|
||||
|
||||
type (
|
||||
// FsFaqModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsFaqModel.
|
||||
FsFaqModel interface {
|
||||
fsFaqModel
|
||||
}
|
||||
|
||||
customFsFaqModel struct {
|
||||
*defaultFsFaqModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsFaqModel returns a model for the database table.
|
||||
func NewFsFaqModel(conn sqlx.SqlConn) FsFaqModel {
|
||||
return &customFsFaqModel{
|
||||
defaultFsFaqModel: newFsFaqModel(conn),
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsFaqFieldNames = builder.RawFieldNames(&FsFaq{})
|
||||
fsFaqRows = strings.Join(fsFaqFieldNames, ",")
|
||||
fsFaqRowsExpectAutoSet = strings.Join(stringx.Remove(fsFaqFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsFaqRowsWithPlaceHolder = strings.Join(stringx.Remove(fsFaqFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsFaqModel interface {
|
||||
Insert(ctx context.Context, data *FsFaq) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsFaq, error)
|
||||
Update(ctx context.Context, data *FsFaq) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsFaqModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsFaq struct {
|
||||
Id int64 `db:"id"`
|
||||
TagId int64 `db:"tag_id"` // 分类ID
|
||||
TagName string `db:"tag_name"` // 分类名称
|
||||
Title string `db:"title"` // 标题
|
||||
Content sql.NullString `db:"content"` // 内容
|
||||
Status int64 `db:"status"` // 状态(0:禁用,1:启用)
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
|
||||
}
|
||||
)
|
||||
|
||||
func newFsFaqModel(conn sqlx.SqlConn) *defaultFsFaqModel {
|
||||
return &defaultFsFaqModel{
|
||||
conn: conn,
|
||||
table: "`fs_faq`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsFaqModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsFaqModel) FindOne(ctx context.Context, id int64) (*FsFaq, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsFaqRows, m.table)
|
||||
var resp FsFaq
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsFaqModel) Insert(ctx context.Context, data *FsFaq) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, fsFaqRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.TagId, data.TagName, data.Title, data.Content, data.Status, data.Sort, data.Ctime)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsFaqModel) Update(ctx context.Context, data *FsFaq) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsFaqRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.TagId, data.TagName, data.Title, data.Content, data.Status, data.Sort, data.Ctime, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsFaqModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsFontModel = (*customFsFontModel)(nil)
|
||||
|
||||
type (
|
||||
// FsFontModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsFontModel.
|
||||
FsFontModel interface {
|
||||
fsFontModel
|
||||
FindAllOrderSortByDesc(ctx context.Context) ([]*FsFont, error)
|
||||
}
|
||||
|
||||
customFsFontModel struct {
|
||||
*defaultFsFontModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsFontModel returns a model for the database table.
|
||||
func NewFsFontModel(conn sqlx.SqlConn) FsFontModel {
|
||||
return &customFsFontModel{
|
||||
defaultFsFontModel: newFsFontModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsFontModel) FindAllOrderSortByDesc(ctx context.Context) ([]*FsFont, error) {
|
||||
|
||||
query := fmt.Sprintf("select %s from %s order by sort desc", fsFontRows, m.table)
|
||||
var resp []*FsFont
|
||||
err := m.conn.QueryRows(&resp, query)
|
||||
switch err {
|
||||
case nil:
|
||||
return resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsFontFieldNames = builder.RawFieldNames(&FsFont{})
|
||||
fsFontRows = strings.Join(fsFontFieldNames, ",")
|
||||
fsFontRowsExpectAutoSet = strings.Join(stringx.Remove(fsFontFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsFontRowsWithPlaceHolder = strings.Join(stringx.Remove(fsFontFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsFontModel interface {
|
||||
Insert(ctx context.Context, data *FsFont) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsFont, error)
|
||||
Update(ctx context.Context, data *FsFont) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsFontModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsFont struct {
|
||||
Id int64 `db:"id"` // id
|
||||
Title string `db:"title"` // 字体名字
|
||||
LinuxFontname string `db:"linux_fontname"` // linux对应字体名
|
||||
FilePath string `db:"file_path"` // 字体文件路径
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
}
|
||||
)
|
||||
|
||||
func newFsFontModel(conn sqlx.SqlConn) *defaultFsFontModel {
|
||||
return &defaultFsFontModel{
|
||||
conn: conn,
|
||||
table: "`fs_font`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsFontModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsFontModel) FindOne(ctx context.Context, id int64) (*FsFont, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsFontRows, m.table)
|
||||
var resp FsFont
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsFontModel) Insert(ctx context.Context, data *FsFont) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsFontRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.LinuxFontname, data.FilePath, data.Sort)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsFontModel) Update(ctx context.Context, data *FsFont) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsFontRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.LinuxFontname, data.FilePath, data.Sort, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsFontModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ FsGuestModel = (*customFsGuestModel)(nil)
|
||||
|
||||
type (
|
||||
// FsGuestModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsGuestModel.
|
||||
FsGuestModel interface {
|
||||
fsGuestModel
|
||||
}
|
||||
|
||||
customFsGuestModel struct {
|
||||
*defaultFsGuestModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsGuestModel returns a model for the database table.
|
||||
func NewFsGuestModel(conn sqlx.SqlConn) FsGuestModel {
|
||||
return &customFsGuestModel{
|
||||
defaultFsGuestModel: newFsGuestModel(conn),
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsGuestFieldNames = builder.RawFieldNames(&FsGuest{})
|
||||
fsGuestRows = strings.Join(fsGuestFieldNames, ",")
|
||||
fsGuestRowsExpectAutoSet = strings.Join(stringx.Remove(fsGuestFieldNames, "`guest_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsGuestRowsWithPlaceHolder = strings.Join(stringx.Remove(fsGuestFieldNames, "`guest_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsGuestModel interface {
|
||||
Insert(ctx context.Context, data *FsGuest) (sql.Result, error)
|
||||
FindOne(ctx context.Context, guestId int64) (*FsGuest, error)
|
||||
Update(ctx context.Context, data *FsGuest) error
|
||||
Delete(ctx context.Context, guestId int64) error
|
||||
}
|
||||
|
||||
defaultFsGuestModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsGuest struct {
|
||||
GuestId int64 `db:"guest_id"` // 游客ID
|
||||
AuthKey string `db:"auth_key"` // jwt token
|
||||
Status int64 `db:"status"` // 1正常 0不正常
|
||||
IsDel int64 `db:"is_del"` // 是否删除 1删除
|
||||
CreatedAt int64 `db:"created_at"` // 添加时间
|
||||
UpdatedAt int64 `db:"updated_at"` // 更新时间
|
||||
IsOpenRender int64 `db:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
||||
IsThousandFace int64 `db:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在)
|
||||
IsLowRendering int64 `db:"is_low_rendering"` // 是否开启低渲染模型渲染
|
||||
IsRemoveBg int64 `db:"is_remove_bg"` // 用户上传logo是否去除背景
|
||||
}
|
||||
)
|
||||
|
||||
func newFsGuestModel(conn sqlx.SqlConn) *defaultFsGuestModel {
|
||||
return &defaultFsGuestModel{
|
||||
conn: conn,
|
||||
table: "`fs_guest`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsGuestModel) Delete(ctx context.Context, guestId int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `guest_id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, guestId)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsGuestModel) FindOne(ctx context.Context, guestId int64) (*FsGuest, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `guest_id` = ? limit 1", fsGuestRows, m.table)
|
||||
var resp FsGuest
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, guestId)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsGuestModel) Insert(ctx context.Context, data *FsGuest) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, fsGuestRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.AuthKey, data.Status, data.IsDel, data.IsOpenRender, data.IsThousandFace, data.IsLowRendering, data.IsRemoveBg)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsGuestModel) Update(ctx context.Context, data *FsGuest) error {
|
||||
query := fmt.Sprintf("update %s set %s where `guest_id` = ?", m.table, fsGuestRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.AuthKey, data.Status, data.IsDel, data.IsOpenRender, data.IsThousandFace, data.IsLowRendering, data.IsRemoveBg, data.GuestId)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsGuestModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ FsMapLibraryModel = (*customFsMapLibraryModel)(nil)
|
||||
|
||||
type (
|
||||
// FsMapLibraryModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsMapLibraryModel.
|
||||
FsMapLibraryModel interface {
|
||||
fsMapLibraryModel
|
||||
}
|
||||
|
||||
customFsMapLibraryModel struct {
|
||||
*defaultFsMapLibraryModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsMapLibraryModel returns a model for the database table.
|
||||
func NewFsMapLibraryModel(conn sqlx.SqlConn) FsMapLibraryModel {
|
||||
return &customFsMapLibraryModel{
|
||||
defaultFsMapLibraryModel: newFsMapLibraryModel(conn),
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsMapLibraryFieldNames = builder.RawFieldNames(&FsMapLibrary{})
|
||||
fsMapLibraryRows = strings.Join(fsMapLibraryFieldNames, ",")
|
||||
fsMapLibraryRowsExpectAutoSet = strings.Join(stringx.Remove(fsMapLibraryFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsMapLibraryRowsWithPlaceHolder = strings.Join(stringx.Remove(fsMapLibraryFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsMapLibraryModel interface {
|
||||
Insert(ctx context.Context, data *FsMapLibrary) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsMapLibrary, error)
|
||||
Update(ctx context.Context, data *FsMapLibrary) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsMapLibraryModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsMapLibrary struct {
|
||||
Id int64 `db:"id"` // Id
|
||||
Title string `db:"title"` // 名称
|
||||
Info string `db:"info"` // 贴图数据
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
Status int64 `db:"status"` // 状态 1启用
|
||||
Ctime int64 `db:"ctime"` // 创建时间
|
||||
TagId int64 `db:"tag_id"` // 模板标签id
|
||||
}
|
||||
)
|
||||
|
||||
func newFsMapLibraryModel(conn sqlx.SqlConn) *defaultFsMapLibraryModel {
|
||||
return &defaultFsMapLibraryModel{
|
||||
conn: conn,
|
||||
table: "`fs_map_library`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsMapLibraryModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsMapLibraryModel) FindOne(ctx context.Context, id int64) (*FsMapLibrary, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsMapLibraryRows, m.table)
|
||||
var resp FsMapLibrary
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsMapLibraryModel) Insert(ctx context.Context, data *FsMapLibrary) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?)", m.table, fsMapLibraryRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Info, data.Sort, data.Status, data.Ctime, data.TagId)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsMapLibraryModel) Update(ctx context.Context, data *FsMapLibrary) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsMapLibraryRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Info, data.Sort, data.Status, data.Ctime, data.TagId, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsMapLibraryModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ FsOrderDetailModel = (*customFsOrderDetailModel)(nil)
|
||||
|
||||
type (
|
||||
// FsOrderDetailModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsOrderDetailModel.
|
||||
FsOrderDetailModel interface {
|
||||
fsOrderDetailModel
|
||||
}
|
||||
|
||||
customFsOrderDetailModel struct {
|
||||
*defaultFsOrderDetailModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsOrderDetailModel returns a model for the database table.
|
||||
func NewFsOrderDetailModel(conn sqlx.SqlConn) FsOrderDetailModel {
|
||||
return &customFsOrderDetailModel{
|
||||
defaultFsOrderDetailModel: newFsOrderDetailModel(conn),
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsOrderDetailFieldNames = builder.RawFieldNames(&FsOrderDetail{})
|
||||
fsOrderDetailRows = strings.Join(fsOrderDetailFieldNames, ",")
|
||||
fsOrderDetailRowsExpectAutoSet = strings.Join(stringx.Remove(fsOrderDetailFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsOrderDetailRowsWithPlaceHolder = strings.Join(stringx.Remove(fsOrderDetailFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsOrderDetailModel interface {
|
||||
Insert(ctx context.Context, data *FsOrderDetail) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsOrderDetail, error)
|
||||
FindOneBySn(ctx context.Context, sn string) (*FsOrderDetail, error)
|
||||
Update(ctx context.Context, data *FsOrderDetail) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsOrderDetailModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsOrderDetail struct {
|
||||
Id int64 `db:"id"`
|
||||
Sn string `db:"sn"` // 唯一编码
|
||||
OrderId int64 `db:"order_id"` // 订单ID
|
||||
UserId sql.NullInt64 `db:"user_id"` // 用户ID
|
||||
FactoryId int64 `db:"factory_id"` // 工厂ID
|
||||
OrderDetailTemplateId int64 `db:"order_detail_template_id"` // 详情templateID
|
||||
ProductId int64 `db:"product_id"` // 产品ID
|
||||
BuyNum int64 `db:"buy_num"` // 购买数量
|
||||
PushNum int64 `db:"push_num"` // 已发数量
|
||||
Amount int64 `db:"amount"` // 单价
|
||||
Cover string `db:"cover"` // 截图
|
||||
Ctime int64 `db:"ctime"` // 添加时间
|
||||
Status int64 `db:"status"` // 状态位 是否推送到厂家 是否生产完成 是否发货完成
|
||||
OptionalId int64 `db:"optional_id"` // 选项ID
|
||||
OptionalTitle string `db:"optional_title"` // 选项名称
|
||||
OptionPrice int64 `db:"option_price"` // 配件价格
|
||||
IsTofactory int64 `db:"is_tofactory"` // 是否推送到工厂
|
||||
IsProduct int64 `db:"is_product"` // 是否生产中
|
||||
IsProductCompletion int64 `db:"is_product_completion"` // 是否生产完成
|
||||
IsCloud int64 `db:"is_cloud"` // 是否是云仓订单
|
||||
IsTocloud int64 `db:"is_tocloud"` // 是否已发云仓(云仓单要发货到云仓,直接发到用户的不需要发到云仓)
|
||||
IsDeliver int64 `db:"is_deliver"` // 是否已发货
|
||||
IsEnd int64 `db:"is_end"` // 是否完成订单(签收)
|
||||
CartId int64 `db:"cart_id"` // 购物车编号
|
||||
}
|
||||
)
|
||||
|
||||
func newFsOrderDetailModel(conn sqlx.SqlConn) *defaultFsOrderDetailModel {
|
||||
return &defaultFsOrderDetailModel{
|
||||
conn: conn,
|
||||
table: "`fs_order_detail`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailModel) FindOne(ctx context.Context, id int64) (*FsOrderDetail, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsOrderDetailRows, m.table)
|
||||
var resp FsOrderDetail
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailModel) FindOneBySn(ctx context.Context, sn string) (*FsOrderDetail, error) {
|
||||
var resp FsOrderDetail
|
||||
query := fmt.Sprintf("select %s from %s where `sn` = ? limit 1", fsOrderDetailRows, m.table)
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, sn)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailModel) Insert(ctx context.Context, data *FsOrderDetail) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsOrderDetailRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.OrderId, data.UserId, data.FactoryId, data.OrderDetailTemplateId, data.ProductId, data.BuyNum, data.PushNum, data.Amount, data.Cover, data.Ctime, data.Status, data.OptionalId, data.OptionalTitle, data.OptionPrice, data.IsTofactory, data.IsProduct, data.IsProductCompletion, data.IsCloud, data.IsTocloud, data.IsDeliver, data.IsEnd, data.CartId)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailModel) Update(ctx context.Context, newData *FsOrderDetail) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsOrderDetailRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.OrderId, newData.UserId, newData.FactoryId, newData.OrderDetailTemplateId, newData.ProductId, newData.BuyNum, newData.PushNum, newData.Amount, newData.Cover, newData.Ctime, newData.Status, newData.OptionalId, newData.OptionalTitle, newData.OptionPrice, newData.IsTofactory, newData.IsProduct, newData.IsProductCompletion, newData.IsCloud, newData.IsTocloud, newData.IsDeliver, newData.IsEnd, newData.CartId, newData.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ FsOrderDetailTemplateModel = (*customFsOrderDetailTemplateModel)(nil)
|
||||
|
||||
type (
|
||||
// FsOrderDetailTemplateModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsOrderDetailTemplateModel.
|
||||
FsOrderDetailTemplateModel interface {
|
||||
fsOrderDetailTemplateModel
|
||||
}
|
||||
|
||||
customFsOrderDetailTemplateModel struct {
|
||||
*defaultFsOrderDetailTemplateModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsOrderDetailTemplateModel returns a model for the database table.
|
||||
func NewFsOrderDetailTemplateModel(conn sqlx.SqlConn) FsOrderDetailTemplateModel {
|
||||
return &customFsOrderDetailTemplateModel{
|
||||
defaultFsOrderDetailTemplateModel: newFsOrderDetailTemplateModel(conn),
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsOrderDetailTemplateFieldNames = builder.RawFieldNames(&FsOrderDetailTemplate{})
|
||||
fsOrderDetailTemplateRows = strings.Join(fsOrderDetailTemplateFieldNames, ",")
|
||||
fsOrderDetailTemplateRowsExpectAutoSet = strings.Join(stringx.Remove(fsOrderDetailTemplateFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsOrderDetailTemplateRowsWithPlaceHolder = strings.Join(stringx.Remove(fsOrderDetailTemplateFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsOrderDetailTemplateModel interface {
|
||||
Insert(ctx context.Context, data *FsOrderDetailTemplate) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsOrderDetailTemplate, error)
|
||||
FindOneBySn(ctx context.Context, sn string) (*FsOrderDetailTemplate, error)
|
||||
Update(ctx context.Context, data *FsOrderDetailTemplate) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsOrderDetailTemplateModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsOrderDetailTemplate struct {
|
||||
Id int64 `db:"id"`
|
||||
Sn string `db:"sn"` // 唯一编码
|
||||
ProductId int64 `db:"product_id"` // 产品ID
|
||||
ModelId int64 `db:"model_id"` // 模型ID
|
||||
TemplateId int64 `db:"template_id"` // 模板ID
|
||||
MaterialId int64 `db:"material_id"` // 材质id
|
||||
SizeId int64 `db:"size_id"` // 尺寸id
|
||||
EachBoxNum int64 `db:"each_box_num"` // 每一箱的个数
|
||||
EachBoxWeight float64 `db:"each_box_weight"` // 每一箱的重量 单位KG
|
||||
DesignId int64 `db:"design_id"` // 设计ID
|
||||
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
|
||||
}
|
||||
)
|
||||
|
||||
func newFsOrderDetailTemplateModel(conn sqlx.SqlConn) *defaultFsOrderDetailTemplateModel {
|
||||
return &defaultFsOrderDetailTemplateModel{
|
||||
conn: conn,
|
||||
table: "`fs_order_detail_template`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailTemplateModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailTemplateModel) FindOne(ctx context.Context, id int64) (*FsOrderDetailTemplate, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsOrderDetailTemplateRows, m.table)
|
||||
var resp FsOrderDetailTemplate
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailTemplateModel) FindOneBySn(ctx context.Context, sn string) (*FsOrderDetailTemplate, error) {
|
||||
var resp FsOrderDetailTemplate
|
||||
query := fmt.Sprintf("select %s from %s where `sn` = ? limit 1", fsOrderDetailTemplateRows, m.table)
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, sn)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailTemplateModel) Insert(ctx context.Context, data *FsOrderDetailTemplate) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsOrderDetailTemplateRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.ProductId, data.ModelId, data.TemplateId, data.MaterialId, data.SizeId, data.EachBoxNum, data.EachBoxWeight, data.DesignId, data.Ctime)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailTemplateModel) Update(ctx context.Context, newData *FsOrderDetailTemplate) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsOrderDetailTemplateRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.ProductId, newData.ModelId, newData.TemplateId, newData.MaterialId, newData.SizeId, newData.EachBoxNum, newData.EachBoxWeight, newData.DesignId, newData.Ctime, newData.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderDetailTemplateModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ FsOrderModel = (*customFsOrderModel)(nil)
|
||||
|
||||
type (
|
||||
// FsOrderModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsOrderModel.
|
||||
FsOrderModel interface {
|
||||
fsOrderModel
|
||||
}
|
||||
|
||||
customFsOrderModel struct {
|
||||
*defaultFsOrderModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsOrderModel returns a model for the database table.
|
||||
func NewFsOrderModel(conn sqlx.SqlConn) FsOrderModel {
|
||||
return &customFsOrderModel{
|
||||
defaultFsOrderModel: newFsOrderModel(conn),
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsOrderFieldNames = builder.RawFieldNames(&FsOrder{})
|
||||
fsOrderRows = strings.Join(fsOrderFieldNames, ",")
|
||||
fsOrderRowsExpectAutoSet = strings.Join(stringx.Remove(fsOrderFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsOrderRowsWithPlaceHolder = strings.Join(stringx.Remove(fsOrderFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsOrderModel interface {
|
||||
Insert(ctx context.Context, data *FsOrder) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsOrder, error)
|
||||
FindOneBySn(ctx context.Context, sn string) (*FsOrder, error)
|
||||
Update(ctx context.Context, data *FsOrder) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsOrderModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsOrder struct {
|
||||
Id int64 `db:"id"`
|
||||
Sn string `db:"sn"` // 订单编号 FS211224OL2XDKNP
|
||||
UserId sql.NullInt64 `db:"user_id"` // 用户ID
|
||||
SellerUserId sql.NullInt64 `db:"seller_user_id"` // 销售员ID 0:自主下单
|
||||
TotalAmount int64 `db:"total_amount"` // 总价
|
||||
PayedAmount int64 `db:"payed_amount"` // 已支付金额
|
||||
PayMethod int64 `db:"pay_method"` // 支付方式 1paypal 2strip
|
||||
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
|
||||
Utime sql.NullInt64 `db:"utime"` // 更新时间
|
||||
Ptime sql.NullInt64 `db:"ptime"` // 最后一次 支付时间(可能多次支付)
|
||||
AddressId int64 `db:"address_id"` // 地址ID或者云仓ID
|
||||
DeliveryMethod int64 `db:"delivery_method"` // 配送方式 1:直接发货到收获地址 2:云仓
|
||||
CustomerMark sql.NullString `db:"customer_mark"` // 客户备注
|
||||
Mark sql.NullString `db:"mark"` // 后台订单备注
|
||||
AddressInfo sql.NullString `db:"address_info"` // 详细地址信息JSON
|
||||
IsSup int64 `db:"is_sup"` // 0不是补货 1是补货
|
||||
Status int64 `db:"status"` // 状态位(0:未支付,1:部分支付,2:支付完成,3:部分生产,4:部分生产完成,5:全部生产,6:全部生产完成,7:部分发货,8:发货完成,9:完成订单,10:取消订单,11:退款中,12:退款完成,13:订单已删除,14:订单已关闭)
|
||||
IsPartPay int64 `db:"is_part_pay"` // 是否部分支付(0:否,1:是)
|
||||
IsPayCompleted int64 `db:"is_pay_completed"` // 是否支付完成(0:否,1:是)
|
||||
IsPartProduct int64 `db:"is_part_product"` // 是否部分生产(0:否,1:是)
|
||||
IsPartProductCompleted int64 `db:"is_part_product_completed"` // 是否部分生产完成(0:否,1:是)
|
||||
IsAllProduct int64 `db:"is_all_product"` // 是否全部生产(0:否,1:是)
|
||||
IsAllProductCompleted int64 `db:"is_all_product_completed"` // 是否全部生产完成(0:否,1:是)
|
||||
IsPartDelivery int64 `db:"is_part_delivery"` // 是否部分发货(0:否,1:是)
|
||||
IsDeliveryCompleted int64 `db:"is_delivery_completed"` // 是否发货完成(0:否,1:是)
|
||||
IsComplated int64 `db:"is_complated"` // 是否完成订单(0:否,1:是)
|
||||
IsCancel int64 `db:"is_cancel"` // 是否取消订单(0:否,1:是)
|
||||
IsRefunding int64 `db:"is_refunding"` // 是否退款中(0:否,1:是)
|
||||
IsRefunded int64 `db:"is_refunded"` // 是否退款完成(0:否,1:是)
|
||||
IsDeleted int64 `db:"is_deleted"` // 是否删除(0:否,1:是)
|
||||
RefundReasonId sql.NullInt64 `db:"refund_reason_id"` // 取消订单原因ID
|
||||
RefundReason sql.NullString `db:"refund_reason"` // 取消订单原因
|
||||
TsTime time.Time `db:"ts_time"`
|
||||
IsSure int64 `db:"is_sure"` // 是否确认订单 1确认0未确认
|
||||
DeliverSn string `db:"deliver_sn"` // 发货单号
|
||||
EmailTime int64 `db:"email_time"` // 邮件发送时间
|
||||
}
|
||||
)
|
||||
|
||||
func newFsOrderModel(conn sqlx.SqlConn) *defaultFsOrderModel {
|
||||
return &defaultFsOrderModel{
|
||||
conn: conn,
|
||||
table: "`fs_order`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderModel) FindOne(ctx context.Context, id int64) (*FsOrder, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsOrderRows, m.table)
|
||||
var resp FsOrder
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderModel) FindOneBySn(ctx context.Context, sn string) (*FsOrder, error) {
|
||||
var resp FsOrder
|
||||
query := fmt.Sprintf("select %s from %s where `sn` = ? limit 1", fsOrderRows, m.table)
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, sn)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderModel) Insert(ctx context.Context, data *FsOrder) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsOrderRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.UserId, data.SellerUserId, data.TotalAmount, data.PayedAmount, data.PayMethod, data.Ctime, data.Utime, data.Ptime, data.AddressId, data.DeliveryMethod, data.CustomerMark, data.Mark, data.AddressInfo, data.IsSup, data.Status, data.IsPartPay, data.IsPayCompleted, data.IsPartProduct, data.IsPartProductCompleted, data.IsAllProduct, data.IsAllProductCompleted, data.IsPartDelivery, data.IsDeliveryCompleted, data.IsComplated, data.IsCancel, data.IsRefunding, data.IsRefunded, data.IsDeleted, data.RefundReasonId, data.RefundReason, data.TsTime, data.IsSure, data.DeliverSn, data.EmailTime)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderModel) Update(ctx context.Context, newData *FsOrder) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsOrderRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.UserId, newData.SellerUserId, newData.TotalAmount, newData.PayedAmount, newData.PayMethod, newData.Ctime, newData.Utime, newData.Ptime, newData.AddressId, newData.DeliveryMethod, newData.CustomerMark, newData.Mark, newData.AddressInfo, newData.IsSup, newData.Status, newData.IsPartPay, newData.IsPayCompleted, newData.IsPartProduct, newData.IsPartProductCompleted, newData.IsAllProduct, newData.IsAllProductCompleted, newData.IsPartDelivery, newData.IsDeliveryCompleted, newData.IsComplated, newData.IsCancel, newData.IsRefunding, newData.IsRefunded, newData.IsDeleted, newData.RefundReasonId, newData.RefundReason, newData.TsTime, newData.IsSure, newData.DeliverSn, newData.EmailTime, newData.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsOrderModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
var _ FsProductDesignModel = (*customFsProductDesignModel)(nil)
|
||||
|
||||
type (
|
||||
// FsProductDesignModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsProductDesignModel.
|
||||
FsProductDesignModel interface {
|
||||
fsProductDesignModel
|
||||
}
|
||||
|
||||
customFsProductDesignModel struct {
|
||||
*defaultFsProductDesignModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsProductDesignModel returns a model for the database table.
|
||||
func NewFsProductDesignModel(conn sqlx.SqlConn) FsProductDesignModel {
|
||||
return &customFsProductDesignModel{
|
||||
defaultFsProductDesignModel: newFsProductDesignModel(conn),
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsProductDesignFieldNames = builder.RawFieldNames(&FsProductDesign{})
|
||||
fsProductDesignRows = strings.Join(fsProductDesignFieldNames, ",")
|
||||
fsProductDesignRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductDesignFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsProductDesignRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductDesignFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsProductDesignModel interface {
|
||||
Insert(ctx context.Context, data *FsProductDesign) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsProductDesign, error)
|
||||
Update(ctx context.Context, data *FsProductDesign) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsProductDesignModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsProductDesign struct {
|
||||
Id int64 `db:"id"`
|
||||
Sn string `db:"sn"` // 唯一标识
|
||||
UserId int64 `db:"user_id"` // 用户ID
|
||||
ProductId int64 `db:"product_id"` // 产品ID
|
||||
TemplateId int64 `db:"template_id"` // 模型ID
|
||||
MaterialId int64 `db:"material_id"` // 材质ID
|
||||
SizeId int64 `db:"size_id"` // 尺寸ID
|
||||
OptionalId int64 `db:"optional_id"` // 选项ID
|
||||
Cover string `db:"cover"` // 封面图
|
||||
Info sql.NullString `db:"info"` // 保留的设计信息
|
||||
Utime time.Time `db:"utime"` // 更新时间
|
||||
Status int64 `db:"status"` // 状态
|
||||
IsDel int64 `db:"is_del"` // 是否删除 0未删除 1删除
|
||||
IsPay int64 `db:"is_pay"` // 是否已有支付 0 未 1 有
|
||||
LogoColor sql.NullString `db:"logo_color"` // logo图片备选项
|
||||
PageGuid string `db:"page_guid"` // 页面识别id
|
||||
}
|
||||
)
|
||||
|
||||
func newFsProductDesignModel(conn sqlx.SqlConn) *defaultFsProductDesignModel {
|
||||
return &defaultFsProductDesignModel{
|
||||
conn: conn,
|
||||
table: "`fs_product_design`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductDesignModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductDesignModel) FindOne(ctx context.Context, id int64) (*FsProductDesign, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductDesignRows, m.table)
|
||||
var resp FsProductDesign
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductDesignModel) Insert(ctx context.Context, data *FsProductDesign) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductDesignRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.UserId, data.ProductId, data.TemplateId, data.MaterialId, data.SizeId, data.OptionalId, data.Cover, data.Info, data.Utime, data.Status, data.IsDel, data.IsPay, data.LogoColor, data.PageGuid)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductDesignModel) Update(ctx context.Context, data *FsProductDesign) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductDesignRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Sn, data.UserId, data.ProductId, data.TemplateId, data.MaterialId, data.SizeId, data.OptionalId, data.Cover, data.Info, data.Utime, data.Status, data.IsDel, data.IsPay, data.LogoColor, data.PageGuid, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductDesignModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsProductModel = (*customFsProductModel)(nil)
|
||||
|
||||
type (
|
||||
// FsProductModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsProductModel.
|
||||
FsProductModel interface {
|
||||
fsProductModel
|
||||
GetProductListByConditions(ctx context.Context, productTypes []string, sort string) ([]FsProduct, error)
|
||||
GetRandomProductList(ctx context.Context, limit int) (resp []FsProduct, err error)
|
||||
GetProductListByIds(ctx context.Context, ids []string, sort string) (resp []FsProduct, err error)
|
||||
}
|
||||
|
||||
customFsProductModel struct {
|
||||
*defaultFsProductModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsProductModel returns a model for the database table.
|
||||
func NewFsProductModel(conn sqlx.SqlConn) FsProductModel {
|
||||
return &customFsProductModel{
|
||||
defaultFsProductModel: newFsProductModel(conn),
|
||||
}
|
||||
}
|
||||
func (m *defaultFsProductModel) GetProductListByConditions(ctx context.Context, productTypes []string, sort string) (resp []FsProduct, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `type` in (?) and `is_del` =? and `is_shelf` = ? and `status` =?",
|
||||
fsProductRows, m.table)
|
||||
switch sort {
|
||||
case "sort-asc":
|
||||
query = fmt.Sprintf("%s order by sort ASC", query)
|
||||
case "sort-desc":
|
||||
query = fmt.Sprintf("%s order by sort DESC", query)
|
||||
default:
|
||||
query = fmt.Sprintf("%s order by sort DESC", query)
|
||||
}
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(productTypes, ","), 0, 1, 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
func (m *defaultFsProductModel) GetRandomProductList(ctx context.Context, limit int) (resp []FsProduct, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `is_del` =? and `is_shelf` = ? order by RAND() limit ?",
|
||||
fsProductRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, 0, 1, limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
func (m *defaultFsProductModel) GetProductListByIds(ctx context.Context, ids []string, sort string) (resp []FsProduct, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` in (?) and `is_del` =? and `is_shelf` = ? and `status` =?",
|
||||
fsProductRows, m.table)
|
||||
switch sort {
|
||||
case "sort-asc":
|
||||
query = fmt.Sprintf("%s order by sort ASC", query)
|
||||
case "sort-desc":
|
||||
query = fmt.Sprintf("%s order by sort DESC", query)
|
||||
default:
|
||||
query = fmt.Sprintf("%s order by sort DESC", query)
|
||||
}
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","), 0, 1, 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsProductModel3dLightModel = (*customFsProductModel3dLightModel)(nil)
|
||||
|
||||
type (
|
||||
// FsProductModel3dLightModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsProductModel3dLightModel.
|
||||
FsProductModel3dLightModel interface {
|
||||
fsProductModel3dLightModel
|
||||
ListByIds(ctx context.Context, ids []string) (resp []FsProductModel3dLight, err error)
|
||||
}
|
||||
|
||||
customFsProductModel3dLightModel struct {
|
||||
*defaultFsProductModel3dLightModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsProductModel3dLightModel returns a model for the database table.
|
||||
func NewFsProductModel3dLightModel(conn sqlx.SqlConn) FsProductModel3dLightModel {
|
||||
return &customFsProductModel3dLightModel{
|
||||
defaultFsProductModel3dLightModel: newFsProductModel3dLightModel(conn),
|
||||
}
|
||||
}
|
||||
func (m *defaultFsProductModel3dLightModel) ListByIds(ctx context.Context, ids []string) (resp []FsProductModel3dLight, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` in (?)", fsProductModel3dLightRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsProductModel3dLightFieldNames = builder.RawFieldNames(&FsProductModel3dLight{})
|
||||
fsProductModel3dLightRows = strings.Join(fsProductModel3dLightFieldNames, ",")
|
||||
fsProductModel3dLightRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductModel3dLightFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsProductModel3dLightRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductModel3dLightFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsProductModel3dLightModel interface {
|
||||
Insert(ctx context.Context, data *FsProductModel3dLight) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsProductModel3dLight, error)
|
||||
Update(ctx context.Context, data *FsProductModel3dLight) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsProductModel3dLightModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsProductModel3dLight struct {
|
||||
Id int64 `db:"id"`
|
||||
Name string `db:"name"` // 灯光名称
|
||||
Info string `db:"info"` // 灯光数据(json格式)
|
||||
Status int64 `db:"status"` // 状态值(1:显示,0:删除)
|
||||
Ctime sql.NullInt64 `db:"ctime"` // 创建时间
|
||||
}
|
||||
)
|
||||
|
||||
func newFsProductModel3dLightModel(conn sqlx.SqlConn) *defaultFsProductModel3dLightModel {
|
||||
return &defaultFsProductModel3dLightModel{
|
||||
conn: conn,
|
||||
table: "`fs_product_model3d_light`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dLightModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dLightModel) FindOne(ctx context.Context, id int64) (*FsProductModel3dLight, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductModel3dLightRows, m.table)
|
||||
var resp FsProductModel3dLight
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dLightModel) Insert(ctx context.Context, data *FsProductModel3dLight) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsProductModel3dLightRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Name, data.Info, data.Status, data.Ctime)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dLightModel) Update(ctx context.Context, data *FsProductModel3dLight) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductModel3dLightRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Name, data.Info, data.Status, data.Ctime, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dLightModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsProductModel3dModel = (*customFsProductModel3dModel)(nil)
|
||||
|
||||
type (
|
||||
// FsProductModel3dModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsProductModel3dModel.
|
||||
FsProductModel3dModel interface {
|
||||
fsProductModel3dModel
|
||||
ListBySizeIdsTag(ctx context.Context, sizeIds []string, tag int) (resp []FsProductModel3d, err error)
|
||||
}
|
||||
|
||||
customFsProductModel3dModel struct {
|
||||
*defaultFsProductModel3dModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsProductModel3dModel returns a model for the database table.
|
||||
func NewFsProductModel3dModel(conn sqlx.SqlConn) FsProductModel3dModel {
|
||||
return &customFsProductModel3dModel{
|
||||
defaultFsProductModel3dModel: newFsProductModel3dModel(conn),
|
||||
}
|
||||
}
|
||||
func (m *defaultFsProductModel3dModel) ListBySizeIdsTag(ctx context.Context, sizeIds []string, tag int) (resp []FsProductModel3d, err error) {
|
||||
if len(sizeIds) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
query := fmt.Sprintf("select %s from %s where `size_id` in (?) and `tag` = ?", fsProductModel3dRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(sizeIds, ","), tag)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsProductModel3dFieldNames = builder.RawFieldNames(&FsProductModel3d{})
|
||||
fsProductModel3dRows = strings.Join(fsProductModel3dFieldNames, ",")
|
||||
fsProductModel3dRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductModel3dFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsProductModel3dRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductModel3dFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsProductModel3dModel interface {
|
||||
Insert(ctx context.Context, data *FsProductModel3d) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsProductModel3d, error)
|
||||
Update(ctx context.Context, data *FsProductModel3d) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsProductModel3dModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsProductModel3d struct {
|
||||
Id int64 `db:"id"`
|
||||
ProductId sql.NullInt64 `db:"product_id"` // 产品ID
|
||||
Tag int64 `db:"tag"` // 类别(1:模型,2:配件,3:场景)
|
||||
Title string `db:"title"` // 标题
|
||||
Name string `db:"name"` // 详情页展示名称
|
||||
ModelInfo string `db:"model_info"` // 模型详情
|
||||
MaterialId int64 `db:"material_id"` // 材质ID
|
||||
SizeId int64 `db:"size_id"` // 尺寸ID
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
Light sql.NullInt64 `db:"light"` // 灯光组
|
||||
LightList sql.NullString `db:"light_list"` // 灯光备选项
|
||||
PartId sql.NullInt64 `db:"part_id"` // 配件选项id(配件就是模型的id)
|
||||
PartList sql.NullString `db:"part_list"` // 配件备选项
|
||||
Status int64 `db:"status"` // 状态位 显示 删除
|
||||
Ctime int64 `db:"ctime"` // 添加时间
|
||||
OptionTemplate sql.NullInt64 `db:"option_template"` // 配件绑定的公共模板
|
||||
Price int64 `db:"price"` // 仅配件用,配件的价格, 单位:美分
|
||||
Sku string `db:"sku"` // sku
|
||||
}
|
||||
)
|
||||
|
||||
func newFsProductModel3dModel(conn sqlx.SqlConn) *defaultFsProductModel3dModel {
|
||||
return &defaultFsProductModel3dModel{
|
||||
conn: conn,
|
||||
table: "`fs_product_model3d`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dModel) FindOne(ctx context.Context, id int64) (*FsProductModel3d, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductModel3dRows, m.table)
|
||||
var resp FsProductModel3d
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dModel) Insert(ctx context.Context, data *FsProductModel3d) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductModel3dRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.Tag, data.Title, data.Name, data.ModelInfo, data.MaterialId, data.SizeId, data.Sort, data.Light, data.LightList, data.PartId, data.PartList, data.Status, data.Ctime, data.OptionTemplate, data.Price, data.Sku)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dModel) Update(ctx context.Context, data *FsProductModel3d) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductModel3dRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.Tag, data.Title, data.Name, data.ModelInfo, data.MaterialId, data.SizeId, data.Sort, data.Light, data.LightList, data.PartId, data.PartList, data.Status, data.Ctime, data.OptionTemplate, data.Price, data.Sku, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel3dModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsProductFieldNames = builder.RawFieldNames(&FsProduct{})
|
||||
fsProductRows = strings.Join(fsProductFieldNames, ",")
|
||||
fsProductRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsProductRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsProductModel interface {
|
||||
Insert(ctx context.Context, data *FsProduct) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsProduct, error)
|
||||
FindOneBySn(ctx context.Context, sn string) (*FsProduct, error)
|
||||
Update(ctx context.Context, data *FsProduct) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsProductModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsProduct struct {
|
||||
Id int64 `db:"id"`
|
||||
Sn string `db:"sn"` // 商品编号 P98f087j
|
||||
Type int64 `db:"type"` // 分类ID
|
||||
Title string `db:"title"` // 名称
|
||||
TitleCn string `db:"title_cn"` // 中文名称
|
||||
Cover string `db:"cover"` // 封面图
|
||||
Imgs string `db:"imgs"` // 一个或多个介绍图或视频
|
||||
Keywords string `db:"keywords"` // 关键字
|
||||
Intro sql.NullString `db:"intro"` // 简要描述
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
SelledNum int64 `db:"selled_num"` // 已卖数量
|
||||
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
|
||||
View int64 `db:"view"` // 浏览量
|
||||
SizeIds sql.NullString `db:"size_ids"` // 尺寸 1,2,3,4
|
||||
MaterialIds string `db:"material_ids"` // 材质 1,2,3
|
||||
TagIds sql.NullString `db:"tag_ids"` // 标签 逗号间隔
|
||||
Status int64 `db:"status"` // 状态位 弃用
|
||||
ProduceDays int64 `db:"produce_days"` // 生产天数
|
||||
DeliveryDays int64 `db:"delivery_days"` // 运送天数
|
||||
CoverImg string `db:"cover_img"` // 背景图
|
||||
IsShelf int64 `db:"is_shelf"` // 是否上架
|
||||
IsRecommend int64 `db:"is_recommend"` // 是否推荐
|
||||
IsHot int64 `db:"is_hot"` // 是否热销
|
||||
IsProtection int64 `db:"is_protection"` // 是否环保
|
||||
IsMicrowave int64 `db:"is_microwave"` // 是否可微波炉
|
||||
IsDel int64 `db:"is_del"` // 是否删除
|
||||
RecommendProduct sql.NullString `db:"recommend_product"` // 推荐产品id例如: 1,3,4,5
|
||||
RecommendProductSort sql.NullString `db:"recommend_product_sort"` // 推荐排序例如:1324
|
||||
SceneIds sql.NullString `db:"scene_ids"` // 关联的场景id
|
||||
}
|
||||
)
|
||||
|
||||
func newFsProductModel(conn sqlx.SqlConn) *defaultFsProductModel {
|
||||
return &defaultFsProductModel{
|
||||
conn: conn,
|
||||
table: "`fs_product`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel) FindOne(ctx context.Context, id int64) (*FsProduct, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductRows, m.table)
|
||||
var resp FsProduct
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel) FindOneBySn(ctx context.Context, sn string) (*FsProduct, error) {
|
||||
var resp FsProduct
|
||||
query := fmt.Sprintf("select %s from %s where `sn` = ? limit 1", fsProductRows, m.table)
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, sn)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel) Insert(ctx context.Context, data *FsProduct) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.Type, data.Title, data.TitleCn, data.Cover, data.Imgs, data.Keywords, data.Intro, data.Sort, data.SelledNum, data.Ctime, data.View, data.SizeIds, data.MaterialIds, data.TagIds, data.Status, data.ProduceDays, data.DeliveryDays, data.CoverImg, data.IsShelf, data.IsRecommend, data.IsHot, data.IsProtection, data.IsMicrowave, data.IsDel, data.RecommendProduct, data.RecommendProductSort, data.SceneIds)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel) Update(ctx context.Context, newData *FsProduct) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.Type, newData.Title, newData.TitleCn, newData.Cover, newData.Imgs, newData.Keywords, newData.Intro, newData.Sort, newData.SelledNum, newData.Ctime, newData.View, newData.SizeIds, newData.MaterialIds, newData.TagIds, newData.Status, newData.ProduceDays, newData.DeliveryDays, newData.CoverImg, newData.IsShelf, newData.IsRecommend, newData.IsHot, newData.IsProtection, newData.IsMicrowave, newData.IsDel, newData.RecommendProduct, newData.RecommendProductSort, newData.SceneIds, newData.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsProductPriceModel = (*customFsProductPriceModel)(nil)
|
||||
|
||||
type (
|
||||
// FsProductPriceModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsProductPriceModel.
|
||||
FsProductPriceModel interface {
|
||||
fsProductPriceModel
|
||||
GetPriceListByProductIds(ctx context.Context, productIds []string) (resp []GetPriceListRsp, err error)
|
||||
GetPriceListBySizeIds(ctx context.Context, sizeIds []string) (resp []FsProductPrice, err error)
|
||||
FindOneByProductIdMaterialIdSizeId(ctx context.Context, productId int64, materialId int64, sizeId int64) (*FsProductPrice, error)
|
||||
}
|
||||
|
||||
customFsProductPriceModel struct {
|
||||
*defaultFsProductPriceModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsProductPriceModel returns a model for the database table.
|
||||
func NewFsProductPriceModel(conn sqlx.SqlConn) FsProductPriceModel {
|
||||
return &customFsProductPriceModel{
|
||||
defaultFsProductPriceModel: newFsProductPriceModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
type GetPriceListRsp struct {
|
||||
ProductId int64 `json:"product_id"`
|
||||
Price string `json:"price"`
|
||||
}
|
||||
|
||||
func (m *defaultFsProductPriceModel) GetPriceListByProductIds(ctx context.Context, productIds []string) (resp []GetPriceListRsp, err error) {
|
||||
if len(productIds) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
query := fmt.Sprintf("select %s from %s where `product_id` in (?) and `status` = ? group by product_id", "product_id,group_concat(step_price) as price ", m.table)
|
||||
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(productIds, ","), 1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
func (m *defaultFsProductPriceModel) FindOneByProductIdMaterialIdSizeId(ctx context.Context, productId int64, materialId int64, sizeId int64) (*FsProductPrice, error) {
|
||||
var resp FsProductPrice
|
||||
query := fmt.Sprintf("select %s from %s where `product_id` = ? and `material_id` = ? and `size_id` = ? limit 1", fsProductPriceRows, m.table)
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, productId, materialId, sizeId)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductPriceModel) GetPriceListBySizeIds(ctx context.Context, sizeIds []string) (resp []FsProductPrice, err error) {
|
||||
if len(sizeIds) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
query := fmt.Sprintf("select %s from %s where `size_id` in (?) and `status` = ? ", fsProductPriceRows, m.table)
|
||||
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(sizeIds, ","), 1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsProductPriceFieldNames = builder.RawFieldNames(&FsProductPrice{})
|
||||
fsProductPriceRows = strings.Join(fsProductPriceFieldNames, ",")
|
||||
fsProductPriceRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductPriceFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsProductPriceRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductPriceFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsProductPriceModel interface {
|
||||
Insert(ctx context.Context, data *FsProductPrice) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsProductPrice, error)
|
||||
Update(ctx context.Context, data *FsProductPrice) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsProductPriceModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsProductPrice struct {
|
||||
Id int64 `db:"id"`
|
||||
Sn string `db:"sn"` // 唯一编码
|
||||
Title string `db:"title"` // 标题描述
|
||||
ProductId int64 `db:"product_id"` // 产品ID
|
||||
MaterialId int64 `db:"material_id"` // 材质ID
|
||||
SizeId int64 `db:"size_id"` // 尺寸ID
|
||||
EachBoxNum int64 `db:"each_box_num"` // 每一箱的个数
|
||||
EachBoxWeight float64 `db:"each_box_weight"` // 每一箱的重量 单位KG
|
||||
MinBuyNum int64 `db:"min_buy_num"` // 最少购买量
|
||||
StepNum string `db:"step_num"` // 数量阶梯 eg:10,20,30
|
||||
StepPrice string `db:"step_price"` // 价格阶梯 eg:100,50,25
|
||||
Status int64 `db:"status"` // 是否可用
|
||||
IsDefault int64 `db:"is_default"` // 是否默认
|
||||
}
|
||||
)
|
||||
|
||||
func newFsProductPriceModel(conn sqlx.SqlConn) *defaultFsProductPriceModel {
|
||||
return &defaultFsProductPriceModel{
|
||||
conn: conn,
|
||||
table: "`fs_product_price`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductPriceModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductPriceModel) FindOne(ctx context.Context, id int64) (*FsProductPrice, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductPriceRows, m.table)
|
||||
var resp FsProductPrice
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductPriceModel) Insert(ctx context.Context, data *FsProductPrice) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductPriceRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.Title, data.ProductId, data.MaterialId, data.SizeId, data.EachBoxNum, data.EachBoxWeight, data.MinBuyNum, data.StepNum, data.StepPrice, data.Status, data.IsDefault)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductPriceModel) Update(ctx context.Context, newData *FsProductPrice) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductPriceRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.Title, newData.ProductId, newData.MaterialId, newData.SizeId, newData.EachBoxNum, newData.EachBoxWeight, newData.MinBuyNum, newData.StepNum, newData.StepPrice, newData.Status, newData.IsDefault, newData.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductPriceModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsProductSizeModel = (*customFsProductSizeModel)(nil)
|
||||
|
||||
type (
|
||||
// FsProductSizeModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsProductSizeModel.
|
||||
FsProductSizeModel interface {
|
||||
fsProductSizeModel
|
||||
CountByStatus(ctx context.Context, status int) (total int, err error)
|
||||
GetAllByProductIds(ctx context.Context, productIds []string, sort string) (resp []FsProductSize, err error)
|
||||
GetAllByIds(ctx context.Context, ids []string, sort string) (resp []FsProductSize, err error)
|
||||
}
|
||||
|
||||
customFsProductSizeModel struct {
|
||||
*defaultFsProductSizeModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsProductSizeModel returns a model for the database table.
|
||||
func NewFsProductSizeModel(conn sqlx.SqlConn) FsProductSizeModel {
|
||||
return &customFsProductSizeModel{
|
||||
defaultFsProductSizeModel: newFsProductSizeModel(conn),
|
||||
}
|
||||
}
|
||||
func (m *defaultFsProductSizeModel) CountByStatus(ctx context.Context, status int) (total int, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `status` = ? limit 1", "count(*) as num", m.table)
|
||||
err = m.conn.QueryRowCtx(ctx, &total, query, status)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return
|
||||
}
|
||||
func (m *defaultFsProductSizeModel) GetAllByProductIds(ctx context.Context, productIds []string, sort string) (resp []FsProductSize, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `product_id` in(?) and `status` = ? ", fsProductSizeRows, m.table)
|
||||
switch sort {
|
||||
case "sort-asc":
|
||||
query = fmt.Sprintf("%s order by `sort` ASC", query)
|
||||
case "sort-desc":
|
||||
query = fmt.Sprintf("%s order by `sort` DESC", query)
|
||||
}
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(productIds, ","), 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (m *defaultFsProductSizeModel) GetAllByIds(ctx context.Context, ids []string, sort string) (resp []FsProductSize, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` in (?) and `status` = ? ", fsProductSizeRows, m.table)
|
||||
switch sort {
|
||||
case "sort-asc":
|
||||
query = fmt.Sprintf("%s order by `sort` ASC", query)
|
||||
case "sort-desc":
|
||||
query = fmt.Sprintf("%s order by `sort` DESC", query)
|
||||
}
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","), 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsProductSizeFieldNames = builder.RawFieldNames(&FsProductSize{})
|
||||
fsProductSizeRows = strings.Join(fsProductSizeFieldNames, ",")
|
||||
fsProductSizeRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductSizeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsProductSizeRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductSizeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsProductSizeModel interface {
|
||||
Insert(ctx context.Context, data *FsProductSize) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsProductSize, error)
|
||||
Update(ctx context.Context, data *FsProductSize) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsProductSizeModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsProductSize struct {
|
||||
Id int64 `db:"id"`
|
||||
ProductId int64 `db:"product_id"` // 产品ID
|
||||
Title string `db:"title"` // 标题 10*10*20
|
||||
Cover sql.NullString `db:"cover"` // 封面图
|
||||
CoverImg sql.NullString `db:"cover_img"` // 背景图
|
||||
Capacity string `db:"capacity"` // 自己填的尺寸名称
|
||||
Status int64 `db:"status"` // 状态位 显示 删除
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
Remark sql.NullString `db:"remark"` // 备注信息
|
||||
PartsCanDeleted int64 `db:"parts_can_deleted"` // 配件是否可移除 1是0否
|
||||
}
|
||||
)
|
||||
|
||||
func newFsProductSizeModel(conn sqlx.SqlConn) *defaultFsProductSizeModel {
|
||||
return &defaultFsProductSizeModel{
|
||||
conn: conn,
|
||||
table: "`fs_product_size`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductSizeModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductSizeModel) FindOne(ctx context.Context, id int64) (*FsProductSize, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductSizeRows, m.table)
|
||||
var resp FsProductSize
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductSizeModel) Insert(ctx context.Context, data *FsProductSize) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductSizeRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.Title, data.Cover, data.CoverImg, data.Capacity, data.Status, data.Sort, data.Remark, data.PartsCanDeleted)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductSizeModel) Update(ctx context.Context, data *FsProductSize) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductSizeRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.Title, data.Cover, data.CoverImg, data.Capacity, data.Status, data.Sort, data.Remark, data.PartsCanDeleted, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductSizeModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsProductTemplateTagsModel = (*customFsProductTemplateTagsModel)(nil)
|
||||
|
||||
type (
|
||||
// FsProductTemplateTagsModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsProductTemplateTagsModel.
|
||||
FsProductTemplateTagsModel interface {
|
||||
fsProductTemplateTagsModel
|
||||
ListByIds(ctx context.Context, ids []string) (resp []FsProductTemplateTags, err error)
|
||||
}
|
||||
|
||||
customFsProductTemplateTagsModel struct {
|
||||
*defaultFsProductTemplateTagsModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsProductTemplateTagsModel returns a model for the database table.
|
||||
func NewFsProductTemplateTagsModel(conn sqlx.SqlConn) FsProductTemplateTagsModel {
|
||||
return &customFsProductTemplateTagsModel{
|
||||
defaultFsProductTemplateTagsModel: newFsProductTemplateTagsModel(conn),
|
||||
}
|
||||
}
|
||||
func (m *defaultFsProductTemplateTagsModel) ListByIds(ctx context.Context, ids []string) (resp []FsProductTemplateTags, err error) {
|
||||
if len(ids) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
query := fmt.Sprintf("select %s from %s where `id` in (?) ", fsProductTemplateTagsRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, ids)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsProductTemplateTagsFieldNames = builder.RawFieldNames(&FsProductTemplateTags{})
|
||||
fsProductTemplateTagsRows = strings.Join(fsProductTemplateTagsFieldNames, ",")
|
||||
fsProductTemplateTagsRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductTemplateTagsFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsProductTemplateTagsRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductTemplateTagsFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsProductTemplateTagsModel interface {
|
||||
Insert(ctx context.Context, data *FsProductTemplateTags) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsProductTemplateTags, error)
|
||||
Update(ctx context.Context, data *FsProductTemplateTags) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsProductTemplateTagsModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsProductTemplateTags struct {
|
||||
Id int64 `db:"id"` // ID
|
||||
Title string `db:"title"` // 标题
|
||||
Status int64 `db:"status"` // 状态 1:可用
|
||||
CreateAt int64 `db:"create_at"` // 创建时间
|
||||
}
|
||||
)
|
||||
|
||||
func newFsProductTemplateTagsModel(conn sqlx.SqlConn) *defaultFsProductTemplateTagsModel {
|
||||
return &defaultFsProductTemplateTagsModel{
|
||||
conn: conn,
|
||||
table: "`fs_product_template_tags`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateTagsModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateTagsModel) FindOne(ctx context.Context, id int64) (*FsProductTemplateTags, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductTemplateTagsRows, m.table)
|
||||
var resp FsProductTemplateTags
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateTagsModel) Insert(ctx context.Context, data *FsProductTemplateTags) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?)", m.table, fsProductTemplateTagsRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Status)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateTagsModel) Update(ctx context.Context, data *FsProductTemplateTags) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductTemplateTagsRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Status, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateTagsModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsProductTemplateV2Model = (*customFsProductTemplateV2Model)(nil)
|
||||
|
||||
type (
|
||||
// FsProductTemplateV2Model is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsProductTemplateV2Model.
|
||||
FsProductTemplateV2Model interface {
|
||||
fsProductTemplateV2Model
|
||||
FindAllByCondition(ctx context.Context, productIds []string) (resp []FsProductTemplateV2, err error)
|
||||
FindAllByModelIdsProduct(ctx context.Context, modelIds []string, productId int64, sort int) (resp []FsProductTemplateV2, err error)
|
||||
FindAllByModelIds(ctx context.Context, modelIds []string, sort int) (resp []FsProductTemplateV2, err error)
|
||||
}
|
||||
|
||||
customFsProductTemplateV2Model struct {
|
||||
*defaultFsProductTemplateV2Model
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsProductTemplateV2Model returns a model for the database table.
|
||||
func NewFsProductTemplateV2Model(conn sqlx.SqlConn) FsProductTemplateV2Model {
|
||||
return &customFsProductTemplateV2Model{
|
||||
defaultFsProductTemplateV2Model: newFsProductTemplateV2Model(conn),
|
||||
}
|
||||
}
|
||||
func (m *defaultFsProductTemplateV2Model) FindAllByCondition(ctx context.Context, productIds []string) (resp []FsProductTemplateV2, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` in (?) and `is_del` = ? and `status` = ?", fsProductTemplateV2Rows, m.table)
|
||||
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(productIds, ","), 0, 1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
func (m *defaultFsProductTemplateV2Model) FindAllByModelIdsProduct(ctx context.Context, modelIds []string, productId int64, sort int) (resp []FsProductTemplateV2, err error) {
|
||||
if len(modelIds) == 0 {
|
||||
return
|
||||
}
|
||||
query := fmt.Sprintf("select %s from %s where `model_id` in (?) and `product_id` = ? and `is_del` = ? and `status` = ?", fsProductTemplateV2Rows, m.table)
|
||||
switch sort {
|
||||
case 1:
|
||||
query = fmt.Sprintf("%s order by `sort` ASC", query)
|
||||
case 2:
|
||||
query = fmt.Sprintf("%s order by `sort` DESC", query)
|
||||
}
|
||||
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(modelIds, ","), productId, 0, 1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateV2Model) FindAllByModelIds(ctx context.Context, modelIds []string, sort int) (resp []FsProductTemplateV2, err error) {
|
||||
if len(modelIds) == 0 {
|
||||
return
|
||||
}
|
||||
query := fmt.Sprintf("select %s from %s where `model_id` in (?) and `is_del` = ? and `status` = ?", fsProductTemplateV2Rows, m.table)
|
||||
switch sort {
|
||||
case 1:
|
||||
query = fmt.Sprintf("%s order by `sort` ASC", query)
|
||||
case 2:
|
||||
query = fmt.Sprintf("%s order by `sort` DESC", query)
|
||||
}
|
||||
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(modelIds, ","), 0, 1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsProductTemplateV2FieldNames = builder.RawFieldNames(&FsProductTemplateV2{})
|
||||
fsProductTemplateV2Rows = strings.Join(fsProductTemplateV2FieldNames, ",")
|
||||
fsProductTemplateV2RowsExpectAutoSet = strings.Join(stringx.Remove(fsProductTemplateV2FieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsProductTemplateV2RowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductTemplateV2FieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsProductTemplateV2Model interface {
|
||||
Insert(ctx context.Context, data *FsProductTemplateV2) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsProductTemplateV2, error)
|
||||
Update(ctx context.Context, data *FsProductTemplateV2) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsProductTemplateV2Model struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsProductTemplateV2 struct {
|
||||
Id int64 `db:"id"`
|
||||
ProductId int64 `db:"product_id"` // 产品ID
|
||||
ModelId int64 `db:"model_id"` // 模型ID
|
||||
Title string `db:"title"` // 模板(sku),预留字段
|
||||
Name string `db:"name"` // 名称
|
||||
CoverImg sql.NullString `db:"cover_img"` // 模板背景图
|
||||
TemplateInfo string `db:"template_info"` // 模板详情
|
||||
MaterialImg sql.NullString `db:"material_img"` // 合成好的贴图
|
||||
Sort int64 `db:"sort"` // 排序
|
||||
LogoWidth int64 `db:"logo_width"` // logo图最大宽度
|
||||
LogoHeight int64 `db:"logo_height"` // logo图最大高度
|
||||
IsPublic int64 `db:"is_public"` // 是否可公用(1:可以,0:不可以)
|
||||
Status int64 `db:"status"` // 状态1正常 2异常
|
||||
Ctime int64 `db:"ctime"` // 添加时间
|
||||
Tag string `db:"tag"` // 标签(用户自填)
|
||||
IsDel int64 `db:"is_del"` // 是否删除 1删除
|
||||
}
|
||||
)
|
||||
|
||||
func newFsProductTemplateV2Model(conn sqlx.SqlConn) *defaultFsProductTemplateV2Model {
|
||||
return &defaultFsProductTemplateV2Model{
|
||||
conn: conn,
|
||||
table: "`fs_product_template_v2`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateV2Model) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateV2Model) FindOne(ctx context.Context, id int64) (*FsProductTemplateV2, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductTemplateV2Rows, m.table)
|
||||
var resp FsProductTemplateV2
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateV2Model) Insert(ctx context.Context, data *FsProductTemplateV2) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductTemplateV2RowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.ModelId, data.Title, data.Name, data.CoverImg, data.TemplateInfo, data.MaterialImg, data.Sort, data.LogoWidth, data.LogoHeight, data.IsPublic, data.Status, data.Ctime, data.Tag, data.IsDel)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsProductTemplateV2Model) Update(ctx context.Context, data *FsProductTemplateV2) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductTemplateV2RowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.ModelId, data.Title, data.Name, data.CoverImg, data.TemplateInfo, data.MaterialImg, data.Sort, data.LogoWidth, data.LogoHeight, data.IsPublic, data.Status, data.Ctime, data.Tag, data.IsDel, data.Id)
|
||||
return err
|
||||
}
|
||||
func (m *defaultFsProductTemplateV2Model) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsQrcodeSetModel = (*customFsQrcodeSetModel)(nil)
|
||||
|
||||
type (
|
||||
// FsQrcodeSetModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsQrcodeSetModel.
|
||||
FsQrcodeSetModel interface {
|
||||
fsQrcodeSetModel
|
||||
GetAll(ctx context.Context) (resp []FsQrcodeSet, err error)
|
||||
}
|
||||
|
||||
customFsQrcodeSetModel struct {
|
||||
*defaultFsQrcodeSetModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsQrcodeSetModel returns a model for the database table.
|
||||
func NewFsQrcodeSetModel(conn sqlx.SqlConn) FsQrcodeSetModel {
|
||||
return &customFsQrcodeSetModel{
|
||||
defaultFsQrcodeSetModel: newFsQrcodeSetModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsQrcodeSetModel) GetAll(ctx context.Context) (resp []FsQrcodeSet, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `status` = ?", fsQrcodeSetRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsQrcodeSetFieldNames = builder.RawFieldNames(&FsQrcodeSet{})
|
||||
fsQrcodeSetRows = strings.Join(fsQrcodeSetFieldNames, ",")
|
||||
fsQrcodeSetRowsExpectAutoSet = strings.Join(stringx.Remove(fsQrcodeSetFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsQrcodeSetRowsWithPlaceHolder = strings.Join(stringx.Remove(fsQrcodeSetFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsQrcodeSetModel interface {
|
||||
Insert(ctx context.Context, data *FsQrcodeSet) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsQrcodeSet, error)
|
||||
Update(ctx context.Context, data *FsQrcodeSet) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsQrcodeSetModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsQrcodeSet struct {
|
||||
Id int64 `db:"id"` // id
|
||||
Name string `db:"name"` // 二维码组件名称
|
||||
Size int64 `db:"size"` // 二维码内容尺寸
|
||||
IndexX int64 `db:"index_x"` // x偏移量
|
||||
IndexY int64 `db:"index_y"` // y偏移量
|
||||
SvgWebsite sql.NullString `db:"svg_website"` // website d数据
|
||||
SvgInstagram sql.NullString `db:"svg_instagram"` // svg instagram d数据
|
||||
SvgFacebook sql.NullString `db:"svg_facebook"` // svg facebook d数据
|
||||
Status int64 `db:"status"` // 状态
|
||||
AdminId int64 `db:"admin_id"` // 操作人
|
||||
Ctime int64 `db:"ctime"` // 添加时间
|
||||
Utime int64 `db:"utime"` // 更新时间
|
||||
}
|
||||
)
|
||||
|
||||
func newFsQrcodeSetModel(conn sqlx.SqlConn) *defaultFsQrcodeSetModel {
|
||||
return &defaultFsQrcodeSetModel{
|
||||
conn: conn,
|
||||
table: "`fs_qrcode_set`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsQrcodeSetModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsQrcodeSetModel) FindOne(ctx context.Context, id int64) (*FsQrcodeSet, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsQrcodeSetRows, m.table)
|
||||
var resp FsQrcodeSet
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsQrcodeSetModel) Insert(ctx context.Context, data *FsQrcodeSet) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsQrcodeSetRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Name, data.Size, data.IndexX, data.IndexY, data.SvgWebsite, data.SvgInstagram, data.SvgFacebook, data.Status, data.AdminId, data.Ctime, data.Utime)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsQrcodeSetModel) Update(ctx context.Context, data *FsQrcodeSet) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsQrcodeSetRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Name, data.Size, data.IndexX, data.IndexY, data.SvgWebsite, data.SvgInstagram, data.SvgFacebook, data.Status, data.AdminId, data.Ctime, data.Utime, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsQrcodeSetModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsStandardLogoModel = (*customFsStandardLogoModel)(nil)
|
||||
|
||||
type (
|
||||
// FsStandardLogoModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsStandardLogoModel.
|
||||
FsStandardLogoModel interface {
|
||||
fsStandardLogoModel
|
||||
GetAll(ctx context.Context) (resp []FsStandardLogo, err error)
|
||||
}
|
||||
|
||||
customFsStandardLogoModel struct {
|
||||
*defaultFsStandardLogoModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsStandardLogoModel returns a model for the database table.
|
||||
func NewFsStandardLogoModel(conn sqlx.SqlConn) FsStandardLogoModel {
|
||||
return &customFsStandardLogoModel{
|
||||
defaultFsStandardLogoModel: newFsStandardLogoModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsStandardLogoModel) GetAll(ctx context.Context) (resp []FsStandardLogo, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `status` = ? ", fsStandardLogoRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsStandardLogoFieldNames = builder.RawFieldNames(&FsStandardLogo{})
|
||||
fsStandardLogoRows = strings.Join(fsStandardLogoFieldNames, ",")
|
||||
fsStandardLogoRowsExpectAutoSet = strings.Join(stringx.Remove(fsStandardLogoFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsStandardLogoRowsWithPlaceHolder = strings.Join(stringx.Remove(fsStandardLogoFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsStandardLogoModel interface {
|
||||
Insert(ctx context.Context, data *FsStandardLogo) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsStandardLogo, error)
|
||||
Update(ctx context.Context, data *FsStandardLogo) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsStandardLogoModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsStandardLogo struct {
|
||||
Id int64 `db:"id"` // ID
|
||||
Name string `db:"name"` // logo名称
|
||||
Image string `db:"image"` // 图片地址
|
||||
Ctime int64 `db:"ctime"` // 添加时间
|
||||
Status int64 `db:"status"` // 状态 1正常 0删除
|
||||
}
|
||||
)
|
||||
|
||||
func newFsStandardLogoModel(conn sqlx.SqlConn) *defaultFsStandardLogoModel {
|
||||
return &defaultFsStandardLogoModel{
|
||||
conn: conn,
|
||||
table: "`fs_standard_logo`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsStandardLogoModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsStandardLogoModel) FindOne(ctx context.Context, id int64) (*FsStandardLogo, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsStandardLogoRows, m.table)
|
||||
var resp FsStandardLogo
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsStandardLogoModel) Insert(ctx context.Context, data *FsStandardLogo) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsStandardLogoRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Name, data.Image, data.Ctime, data.Status)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsStandardLogoModel) Update(ctx context.Context, data *FsStandardLogo) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsStandardLogoRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Name, data.Image, data.Ctime, data.Status, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsStandardLogoModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsTagsModel = (*customFsTagsModel)(nil)
|
||||
|
||||
type (
|
||||
// FsTagsModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsTagsModel.
|
||||
FsTagsModel interface {
|
||||
fsTagsModel
|
||||
GetAllByLevel(ctx context.Context, level int) (resp []FsTags, err error)
|
||||
GetAllByIds(ctx context.Context, ids []string) (resp []FsTags, err error)
|
||||
}
|
||||
|
||||
customFsTagsModel struct {
|
||||
*defaultFsTagsModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsTagsModel returns a model for the database table.
|
||||
func NewFsTagsModel(conn sqlx.SqlConn) FsTagsModel {
|
||||
return &customFsTagsModel{
|
||||
defaultFsTagsModel: newFsTagsModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsTagsModel) GetAllByLevel(ctx context.Context, level int) (resp []FsTags, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `level` = ? and `status` = ?", fsTagsRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, level, 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
func (m *defaultFsTagsModel) GetAllByIds(ctx context.Context, ids []string) (resp []FsTags, err error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` in (?) and `status` = ?", fsTagsRows, m.table)
|
||||
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","), 1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsTagsFieldNames = builder.RawFieldNames(&FsTags{})
|
||||
fsTagsRows = strings.Join(fsTagsFieldNames, ",")
|
||||
fsTagsRowsExpectAutoSet = strings.Join(stringx.Remove(fsTagsFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsTagsRowsWithPlaceHolder = strings.Join(stringx.Remove(fsTagsFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsTagsModel interface {
|
||||
Insert(ctx context.Context, data *FsTags) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsTags, error)
|
||||
Update(ctx context.Context, data *FsTags) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsTagsModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsTags struct {
|
||||
Id int64 `db:"id"` // ID
|
||||
Title string `db:"title"` // 标题
|
||||
Level int64 `db:"level"` // 层级、分类 1 => 二维码分类
|
||||
ClickNum int64 `db:"click_num"` // 点击次数
|
||||
Sort int64 `db:"sort"` // 排序(从大到小)
|
||||
CreateAt int64 `db:"create_at"` // 创建时间
|
||||
Icon sql.NullString `db:"icon"` // 标签图标
|
||||
Status int64 `db:"status"` // 状态 1:可用
|
||||
Description string `db:"description"` // 介绍 Seo
|
||||
RecommendProduct sql.NullString `db:"recommend_product"` // 推荐产品id例如: 1,3,4,5
|
||||
RecommendProductSort sql.NullString `db:"recommend_product_sort"` // 推荐排序例如:1324
|
||||
}
|
||||
)
|
||||
|
||||
func newFsTagsModel(conn sqlx.SqlConn) *defaultFsTagsModel {
|
||||
return &defaultFsTagsModel{
|
||||
conn: conn,
|
||||
table: "`fs_tags`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsTagsModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsTagsModel) FindOne(ctx context.Context, id int64) (*FsTags, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsTagsRows, m.table)
|
||||
var resp FsTags
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsTagsModel) Insert(ctx context.Context, data *FsTags) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsTagsRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.ClickNum, data.Sort, data.Icon, data.Status, data.Description, data.RecommendProduct, data.RecommendProductSort)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsTagsModel) Update(ctx context.Context, data *FsTags) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsTagsRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.ClickNum, data.Sort, data.Icon, data.Status, data.Description, data.RecommendProduct, data.RecommendProductSort, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsTagsModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsUserModel = (*customFsUserModel)(nil)
|
||||
|
||||
type (
|
||||
// FsUserModel is an interface to be customized, add more methods here,
|
||||
// and implement the added methods in customFsUserModel.
|
||||
FsUserModel interface {
|
||||
fsUserModel
|
||||
UpdateVerificationToken(ctx context.Context, userid int64, token string) error
|
||||
}
|
||||
|
||||
customFsUserModel struct {
|
||||
*defaultFsUserModel
|
||||
}
|
||||
)
|
||||
|
||||
// NewFsUserModel returns a model for the database table.
|
||||
func NewFsUserModel(conn sqlx.SqlConn) FsUserModel {
|
||||
return &customFsUserModel{
|
||||
defaultFsUserModel: newFsUserModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) UpdateVerificationToken(ctx context.Context, userid int64, verificationToken string) error {
|
||||
query := fmt.Sprintf("update %s set `verification_token` = ? where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, verificationToken, userid)
|
||||
return err
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var (
|
||||
fsUserFieldNames = builder.RawFieldNames(&FsUser{})
|
||||
fsUserRows = strings.Join(fsUserFieldNames, ",")
|
||||
fsUserRowsExpectAutoSet = strings.Join(stringx.Remove(fsUserFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
||||
fsUserRowsWithPlaceHolder = strings.Join(stringx.Remove(fsUserFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
||||
)
|
||||
|
||||
type (
|
||||
fsUserModel interface {
|
||||
Insert(ctx context.Context, data *FsUser) (sql.Result, error)
|
||||
FindOne(ctx context.Context, id int64) (*FsUser, error)
|
||||
FindOneByEmail(ctx context.Context, email string) (*FsUser, error)
|
||||
FindOneByPasswordResetToken(ctx context.Context, passwordResetToken sql.NullString) (*FsUser, error)
|
||||
FindOneByUsername(ctx context.Context, username sql.NullString) (*FsUser, error)
|
||||
Update(ctx context.Context, data *FsUser) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
defaultFsUserModel struct {
|
||||
conn sqlx.SqlConn
|
||||
table string
|
||||
}
|
||||
|
||||
FsUser struct {
|
||||
Id int64 `db:"id"` // ID
|
||||
FaceId int64 `db:"face_id"` // facebook的userid
|
||||
Sub int64 `db:"sub"` // google的sub
|
||||
FirstName sql.NullString `db:"first_name"` // FirstName
|
||||
LastName sql.NullString `db:"last_name"` // LastName
|
||||
Username sql.NullString `db:"username"` // 用户名
|
||||
Company sql.NullString `db:"company"` // 公司名称
|
||||
Mobile sql.NullString `db:"mobile"` // 手机号码
|
||||
AuthKey string `db:"auth_key"`
|
||||
PasswordHash string `db:"password_hash"`
|
||||
VerificationToken sql.NullString `db:"verification_token"`
|
||||
PasswordResetToken sql.NullString `db:"password_reset_token"`
|
||||
Email string `db:"email"` // 邮箱
|
||||
Type int64 `db:"type"` // 1普通餐厅 2连锁餐厅
|
||||
Status int64 `db:"status"` // 1正常 0不正常
|
||||
IsDel int64 `db:"is_del"` // 是否删除 1删除
|
||||
CreatedAt int64 `db:"created_at"` // 添加时间
|
||||
UpdatedAt int64 `db:"updated_at"` // 更新时间
|
||||
IsOrderStatusEmail int64 `db:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
||||
IsEmailAdvertisement int64 `db:"is_email_advertisement"` // 是否接收邮件广告
|
||||
IsOrderStatusPhone int64 `db:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
||||
IsPhoneAdvertisement int64 `db:"is_phone_advertisement"` // 是否接收短信广告
|
||||
IsOpenRender int64 `db:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
||||
IsThousandFace int64 `db:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在)
|
||||
IsLowRendering int64 `db:"is_low_rendering"` // 是否开启低渲染模型渲染
|
||||
IsRemoveBg int64 `db:"is_remove_bg"` // 用户上传logo是否去除背景
|
||||
}
|
||||
)
|
||||
|
||||
func newFsUserModel(conn sqlx.SqlConn) *defaultFsUserModel {
|
||||
return &defaultFsUserModel{
|
||||
conn: conn,
|
||||
table: "`fs_user`",
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) Delete(ctx context.Context, id int64) error {
|
||||
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) FindOne(ctx context.Context, id int64) (*FsUser, error) {
|
||||
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsUserRows, m.table)
|
||||
var resp FsUser
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) FindOneByEmail(ctx context.Context, email string) (*FsUser, error) {
|
||||
var resp FsUser
|
||||
query := fmt.Sprintf("select %s from %s where `email` = ? limit 1", fsUserRows, m.table)
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, email)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) FindOneByPasswordResetToken(ctx context.Context, passwordResetToken sql.NullString) (*FsUser, error) {
|
||||
var resp FsUser
|
||||
query := fmt.Sprintf("select %s from %s where `password_reset_token` = ? limit 1", fsUserRows, m.table)
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, passwordResetToken)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) FindOneByUsername(ctx context.Context, username sql.NullString) (*FsUser, error) {
|
||||
var resp FsUser
|
||||
query := fmt.Sprintf("select %s from %s where `username` = ? limit 1", fsUserRows, m.table)
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, username)
|
||||
switch err {
|
||||
case nil:
|
||||
return &resp, nil
|
||||
case sqlc.ErrNotFound:
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) Insert(ctx context.Context, data *FsUser) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsUserRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.FaceId, data.Sub, data.FirstName, data.LastName, data.Username, data.Company, data.Mobile, data.AuthKey, data.PasswordHash, data.VerificationToken, data.PasswordResetToken, data.Email, data.Type, data.Status, data.IsDel, data.IsOrderStatusEmail, data.IsEmailAdvertisement, data.IsOrderStatusPhone, data.IsPhoneAdvertisement, data.IsOpenRender, data.IsThousandFace, data.IsLowRendering, data.IsRemoveBg)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) Update(ctx context.Context, newData *FsUser) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsUserRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, newData.FaceId, newData.Sub, newData.FirstName, newData.LastName, newData.Username, newData.Company, newData.Mobile, newData.AuthKey, newData.PasswordHash, newData.VerificationToken, newData.PasswordResetToken, newData.Email, newData.Type, newData.Status, newData.IsDel, newData.IsOrderStatusEmail, newData.IsEmailAdvertisement, newData.IsOrderStatusPhone, newData.IsPhoneAdvertisement, newData.IsOpenRender, newData.IsThousandFace, newData.IsLowRendering, newData.IsRemoveBg, newData.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) tableName() string {
|
||||
return m.table
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_address 用户地址表
|
||||
type FsAddress struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
||||
Name *string `gorm:"default:'';" json:"name"` // 地址名称
|
||||
FirstName *string `gorm:"default:'';" json:"first_name"` // FirstName
|
||||
LastName *string `gorm:"default:'';" json:"last_name"` // LastName
|
||||
Mobile *string `gorm:"default:'';" json:"mobile"` // 手机号码
|
||||
Street *string `gorm:"default:'';" json:"street"` // 街道
|
||||
Suite *string `gorm:"default:'';" json:"suite"` // 房号
|
||||
City *string `gorm:"default:'';" json:"city"` // 城市
|
||||
State *string `gorm:"default:'';" json:"state"` // 州名
|
||||
Country *string `gorm:"default:'';" json:"country"` // 国家
|
||||
ZipCode *string `gorm:"default:'';" json:"zip_code"` // 邮编
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常
|
||||
IsDefault *int64 `gorm:"default:0;" json:"is_default"` // 1默认地址,0非默认地址
|
||||
}
|
||||
type FsAddressModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsAddressModel(db *gorm.DB) *FsAddressModel { return &FsAddressModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,16 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_auth_assignment 用户角色和权限信息
|
||||
type FsAuthAssignment struct {
|
||||
ItemName *string `gorm:"index;default:'';" json:"item_name"` // 角色或权限名称
|
||||
UserId *string `gorm:"index;default:'';" json:"user_id"` // 用户ID
|
||||
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
|
||||
// FsAuthAssignmentIbfk1 foreign `gorm:"" json:"fs_auth_assignment_ibfk_1"`//
|
||||
}
|
||||
type FsAuthAssignmentModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsAuthAssignmentModel(db *gorm.DB) *FsAuthAssignmentModel { return &FsAuthAssignmentModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,16 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_auth_item_child 角色和权限关系表
|
||||
type FsAuthItemChild struct {
|
||||
Parent *string `gorm:"index;default:'';" json:"parent"` // 父角色或权限名称
|
||||
Child *string `gorm:"index;default:'';" json:"child"` // 子角色或权限名称
|
||||
// FsAuthItemChildIbfk1 foreign `gorm:"" json:"fs_auth_item_child_ibfk_1"`//
|
||||
// FsAuthItemChildIbfk2 foreign `gorm:"" json:"fs_auth_item_child_ibfk_2"`//
|
||||
}
|
||||
type FsAuthItemChildModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsAuthItemChildModel(db *gorm.DB) *FsAuthItemChildModel { return &FsAuthItemChildModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,20 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_auth_item 用户角色和权限信息
|
||||
type FsAuthItem struct {
|
||||
Name string `gorm:"primary_key;default:'';" json:"name"` // 角色或权限名称
|
||||
Type *int64 `gorm:"index;default:0;" json:"type"` // 权限类型:1 表示角色,2 表示权限
|
||||
Description *string `gorm:"default:'';" json:"description"` // 角色或权限描述
|
||||
RuleName *string `gorm:"index;default:'';" json:"rule_name"` //
|
||||
Data *[]byte `gorm:"default:'';" json:"data"` // 角色或权限的额外数据
|
||||
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` //
|
||||
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` //
|
||||
// FsAuthItemIbfk1 foreign `gorm:"" json:"fs_auth_item_ibfk_1"`//
|
||||
}
|
||||
type FsAuthItemModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsAuthItemModel(db *gorm.DB) *FsAuthItemModel { return &FsAuthItemModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,16 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_auth_rule 规则表
|
||||
type FsAuthRule struct {
|
||||
Name string `gorm:"primary_key;default:'';" json:"name"` // 规则名称
|
||||
Data *[]byte `gorm:"default:'';" json:"data"` // 规则的额外数据
|
||||
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` //
|
||||
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` //
|
||||
}
|
||||
type FsAuthRuleModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsAuthRuleModel(db *gorm.DB) *FsAuthRuleModel { return &FsAuthRuleModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,20 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_canteen_product 餐厅类别产品对应表
|
||||
type FsCanteenProduct struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // ID
|
||||
CanteenType *int64 `gorm:"index;default:0;" json:"canteen_type"` // 餐厅类别id
|
||||
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品id
|
||||
SizeId *int64 `gorm:"default:0;" json:"size_id"` // 尺寸id
|
||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1启用0停用
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
Sid *string `gorm:"default:'';" json:"sid"` // 前端带入的id
|
||||
}
|
||||
type FsCanteenProductModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCanteenProductModel(db *gorm.DB) *FsCanteenProductModel { return &FsCanteenProductModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,17 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_canteen_type 餐厅类型表
|
||||
type FsCanteenType struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // ID
|
||||
Name *string `gorm:"default:'';" json:"name"` // 餐厅名字
|
||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1启用0停用
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
}
|
||||
type FsCanteenTypeModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCanteenTypeModel(db *gorm.DB) *FsCanteenTypeModel { return &FsCanteenTypeModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,17 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_card 卡号表
|
||||
type FsCard struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // Id
|
||||
CardNo *string `gorm:"default:'';" json:"card_no"` // 卡号
|
||||
GroupId *int64 `gorm:"default:0;" json:"group_id"` // 分组id
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间
|
||||
CardNum *string `gorm:"default:'';" json:"card_num"` // 卡号 无空格
|
||||
}
|
||||
type FsCardModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCardModel(db *gorm.DB) *FsCardModel { return &FsCardModel{db} }
|
||||
@@ -1,17 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_card_group 卡号分组表
|
||||
type FsCardGroup struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
|
||||
GroupName *string `gorm:"default:'';" json:"group_name"` // 分组名字
|
||||
PreNo *string `gorm:"default:'';" json:"pre_no"` // 规则前几位数
|
||||
Num *int64 `gorm:"default:0;" json:"num"` // 生成数量
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` //
|
||||
}
|
||||
type FsCardGroupModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCardGroupModel(db *gorm.DB) *FsCardGroupModel { return &FsCardGroupModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,30 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cart 购物车
|
||||
type FsCart struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` //
|
||||
ProductId *int64 `gorm:"index;default:0;" json:"product_id"` // 产品ID
|
||||
TemplateId *int64 `gorm:"index;default:0;" json:"template_id"` // 模板ID
|
||||
PriceId *int64 `gorm:"index;default:0;" json:"price_id"` // 价格ID
|
||||
MaterialId *int64 `gorm:"index;default:0;" json:"material_id"` // 材质ID
|
||||
SizeId *int64 `gorm:"index;default:0;" json:"size_id"` // 尺寸ID
|
||||
BuyNum *int64 `gorm:"default:0;" json:"buy_num"` // 购买数量
|
||||
Cover *string `gorm:"default:'';" json:"cover"` // 截图
|
||||
DesignId *int64 `gorm:"index;default:0;" json:"design_id"` // 设计ID
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` //
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态位
|
||||
OptionalId *int64 `gorm:"index;default:0;" json:"optional_id"` // 选项ID
|
||||
IsCheck *int64 `gorm:"default:0;" json:"is_check"` // 是否选中状态(0:未选中,1:选中)
|
||||
TsTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ts_time"` //
|
||||
IsEmail *int64 `gorm:"default:0;" json:"is_email"` // 是否发送邮件
|
||||
}
|
||||
type FsCartModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCartModel(db *gorm.DB) *FsCartModel { return &FsCartModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,17 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_change_code 忘记密码code表
|
||||
type FsChangeCode struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
|
||||
Email *string `gorm:"default:'';" json:"email"` //
|
||||
Code *string `gorm:"default:'';" json:"code"` //
|
||||
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
|
||||
IsUse *int64 `gorm:"default:0;" json:"is_use"` // 是否使用 1已使用 0未使用
|
||||
}
|
||||
type FsChangeCodeModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsChangeCodeModel(db *gorm.DB) *FsChangeCodeModel { return &FsChangeCodeModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,20 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud_deliver_every_tmp
|
||||
type FsCloudDeliverEveryTmp struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
AdminId *int64 `gorm:"default:0;" json:"admin_id"` // 管理员
|
||||
CloudId *int64 `gorm:"default:0;" json:"cloud_id"` // 云仓ID 暂且只有一个默认为 1
|
||||
OrderDetailTemplateSn *string `gorm:"default:'';" json:"order_detail_template_sn"` // 详情modelSn
|
||||
Num *int64 `gorm:"default:0;" json:"num"` // 发货数量
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
}
|
||||
type FsCloudDeliverEveryTmpModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudDeliverEveryTmpModel(db *gorm.DB) *FsCloudDeliverEveryTmpModel {
|
||||
return &FsCloudDeliverEveryTmpModel{db}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,25 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud_deliver_tmp
|
||||
type FsCloudDeliverTmp struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
|
||||
CloudId *int64 `gorm:"default:0;" json:"cloud_id"` // 云仓id
|
||||
UserId *int64 `gorm:"default:0;" json:"user_id"` // 用户id
|
||||
AdminId *int64 `gorm:"default:0;" json:"admin_id"` // 操作员id
|
||||
DeliveryType *int64 `gorm:"default:1;" json:"delivery_type"` // 发货公司 之后配置,默认1
|
||||
Fee *int64 `gorm:"default:0;" json:"fee"` // 价格
|
||||
AddressId *int64 `gorm:"default:0;" json:"address_id"` // 地址
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间
|
||||
IsDeliver *int64 `gorm:"default:0;" json:"is_deliver"` // 0未发货,1已发货
|
||||
IsEnd *int64 `gorm:"default:0;" json:"is_end"` // 0未完成,1已完成
|
||||
DeliverId *int64 `gorm:"default:0;" json:"deliver_id"` // 发货总表id
|
||||
}
|
||||
type FsCloudDeliverTmpModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudDeliverTmpModel(db *gorm.DB) *FsCloudDeliverTmpModel {
|
||||
return &FsCloudDeliverTmpModel{db}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,15 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud 云仓表
|
||||
type FsCloud struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
|
||||
Address *string `gorm:"default:'';" json:"address"` // 云仓地址
|
||||
Title *string `gorm:"default:'';" json:"title"` // 云仓名称
|
||||
}
|
||||
type FsCloudModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudModel(db *gorm.DB) *FsCloudModel { return &FsCloudModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,20 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud_pick_up_detail 云仓提货单-详情
|
||||
type FsCloudPickUpDetail struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // Id
|
||||
PickId *int64 `gorm:"index;default:0;" json:"pick_id"` // 提货单id
|
||||
StockId *int64 `gorm:"default:0;" json:"stock_id"` // 用户云仓记录id
|
||||
Num *int64 `gorm:"default:0;" json:"num"` // 提取数量
|
||||
Boxes *int64 `gorm:"default:0;" json:"boxes"` // 提取箱数
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
}
|
||||
type FsCloudPickUpDetailModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudPickUpDetailModel(db *gorm.DB) *FsCloudPickUpDetailModel {
|
||||
return &FsCloudPickUpDetailModel{db}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,23 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud_pick_up 云仓提货单
|
||||
type FsCloudPickUp struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // Id
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户id
|
||||
TrackNum *string `gorm:"default:'';" json:"track_num"` // 运输号
|
||||
AddressId *int64 `gorm:"default:0;" json:"address_id"` // 地址id
|
||||
AddressInfo *string `gorm:"default:'';" json:"address_info"` // 地址信息 json
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 运输状态 1 draw 2shipping 3ups 4arrival
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
ShippingTime *int64 `gorm:"default:0;" json:"shipping_time"` // 发货时间
|
||||
UpsTime *int64 `gorm:"default:0;" json:"ups_time"` // 提货时间
|
||||
ArrivalTime *int64 `gorm:"default:0;" json:"arrival_time"` // 到达时间
|
||||
UpsSn *string `gorm:"default:'';" json:"ups_sn"` // 运输单号
|
||||
}
|
||||
type FsCloudPickUpModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudPickUpModel(db *gorm.DB) *FsCloudPickUpModel { return &FsCloudPickUpModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,19 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud_receive_every
|
||||
type FsCloudReceiveEvery struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
DeliveryId *int64 `gorm:"index;default:0;" json:"delivery_id"` // 云仓收货单id
|
||||
OrderDetailTemplateSn *string `gorm:"index;default:'';" json:"order_detail_template_sn"` // 详情modelSn
|
||||
Num *int64 `gorm:"default:0;" json:"num"` // 收到的数量
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
}
|
||||
type FsCloudReceiveEveryModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudReceiveEveryModel(db *gorm.DB) *FsCloudReceiveEveryModel {
|
||||
return &FsCloudReceiveEveryModel{db}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,21 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud_receive 云仓接收工厂总单
|
||||
type FsCloudReceive struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
CloudId *int64 `gorm:"index;default:0;" json:"cloud_id"` // 入库云仓id
|
||||
AdminId *int64 `gorm:"index;default:0;" json:"admin_id"` // 操作员id
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户id
|
||||
OrderId *int64 `gorm:"index;default:0;" json:"order_id"` // 入库云仓的订单
|
||||
Fee *int64 `gorm:"default:0;" json:"fee"` // 运费
|
||||
Delivery *string `gorm:"default:'';" json:"delivery"` // 运单号
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 0未收到 1收到
|
||||
}
|
||||
type FsCloudReceiveModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudReceiveModel(db *gorm.DB) *FsCloudReceiveModel { return &FsCloudReceiveModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,21 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud_render_log 云渲染日志表
|
||||
type FsCloudRenderLog struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // ID
|
||||
UserId *int64 `gorm:"default:0;" json:"user_id"` // 用户id
|
||||
PostData *string `gorm:"default:'';" json:"post_data"` //
|
||||
PostUrl *string `gorm:"default:'';" json:"post_url"` //
|
||||
Title *string `gorm:"index;default:'';" json:"title"` //
|
||||
Time *int64 `gorm:"default:0;" json:"time"` // 所用时间
|
||||
Result *string `gorm:"default:'';" json:"result"` // 返回结果
|
||||
Tag *string `gorm:"index;default:'';" json:"tag"` // 标识
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
}
|
||||
type FsCloudRenderLogModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudRenderLogModel(db *gorm.DB) *FsCloudRenderLogModel { return &FsCloudRenderLogModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,22 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_cloud_user_apply_back 该表废弃
|
||||
type FsCloudUserApplyBack struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
UserHash *string `gorm:"default:'';" json:"user_hash"` //
|
||||
OrderDetailTemplateId *int64 `gorm:"default:0;" json:"order_detail_template_id"` // 详情modelID
|
||||
Num *int64 `gorm:"default:0;" json:"num"` // 发货数量
|
||||
AddressTo *string `gorm:"default:'';" json:"address_to"` // 收获地址
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
StorageFee *int64 `gorm:"default:0;" json:"storage_fee"` // 存储费用
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 是否已发货 是否处理 是否删除 是否推送
|
||||
}
|
||||
type FsCloudUserApplyBackModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCloudUserApplyBackModel(db *gorm.DB) *FsCloudUserApplyBackModel {
|
||||
return &FsCloudUserApplyBackModel{db}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,20 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_contact 该表暂未使用
|
||||
type FsContact struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
Name *string `gorm:"default:'';" json:"name"` // 名字
|
||||
Email *string `gorm:"index;default:'';" json:"email"` // 邮箱
|
||||
Subject *int64 `gorm:"default:0;" json:"subject"` // 主题
|
||||
Message *string `gorm:"default:'';" json:"message"` // 消息
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` //
|
||||
Status *int64 `gorm:"default:0;" json:"status"` //
|
||||
Mark *string `gorm:"default:'';" json:"mark"` // 后台订单备注
|
||||
}
|
||||
type FsContactModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsContactModel(db *gorm.DB) *FsContactModel { return &FsContactModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,25 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_contact_service
|
||||
type FsContactService struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
Type *string `gorm:"default:'';" json:"type"` // 类型
|
||||
RelationId *int64 `gorm:"index;default:0;" json:"relation_id"` // 关联id
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户id
|
||||
Name *string `gorm:"default:'';" json:"name"` // 联系人姓名
|
||||
Email *string `gorm:"index;default:'';" json:"email"` // 联系人邮箱
|
||||
Phone *string `gorm:"default:'';" json:"phone"` //
|
||||
Remark *string `gorm:"default:'';" json:"remark"` // 备注内容
|
||||
IsHandle *int64 `gorm:"default:0;" json:"is_handle"` // 是否被处理(0:未处理,1:已处理)
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` //
|
||||
HandleRemark *string `gorm:"default:'';" json:"handle_remark"` // 处理备注
|
||||
HandleUid *int64 `gorm:"default:0;" json:"handle_uid"` // 处理人
|
||||
HandleTime *int64 `gorm:"default:0;" json:"handle_time"` // 处理时间
|
||||
}
|
||||
type FsContactServiceModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsContactServiceModel(db *gorm.DB) *FsContactServiceModel { return &FsContactServiceModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,25 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_coupon 代金券(暂未使用)
|
||||
type FsCoupon struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
UserId *int64 `gorm:"default:0;" json:"user_id"` //
|
||||
Sn *string `gorm:"default:'';" json:"sn"` // 优惠券码
|
||||
Type *int64 `gorm:"default:0;" json:"type"` // 类型 1:代金券 2:折扣券 3:满减券
|
||||
Amount *int64 `gorm:"default:0;" json:"amount"` // 代金券金额、折扣比例、满减金额
|
||||
MinAmount *int64 `gorm:"default:0;" json:"min_amount"` // 满足条件的最小金额 0:不限制
|
||||
MaxAmount *int64 `gorm:"default:0;" json:"max_amount"` // 最多优惠的金额 0:不限制
|
||||
Stime *int64 `gorm:"default:0;" json:"stime"` // 开始时间 0:立即生效
|
||||
Etime *int64 `gorm:"default:0;" json:"etime"` // 结束时间 0:永久有效
|
||||
Exclude *int64 `gorm:"default:2;" json:"exclude"` // 是否可以与其他优惠券同时使用 1:可以 2:不可以
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` //
|
||||
GetTime *int64 `gorm:"default:0;" json:"get_time"` //
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态 是否可用 是否已绑定到订单
|
||||
}
|
||||
type FsCouponModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsCouponModel(db *gorm.DB) *FsCouponModel { return &FsCouponModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,16 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_deliver_every 发货详细表(已废弃)
|
||||
type FsDeliverEvery struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
DeliverId *int64 `gorm:"index;default:0;" json:"deliver_id"` // 发货ID
|
||||
OrderDetailTemplateSn *string `gorm:"index;default:'';" json:"order_detail_template_sn"` // 订单详情模板sn
|
||||
Num *int64 `gorm:"default:0;" json:"num"` //
|
||||
}
|
||||
type FsDeliverEveryModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsDeliverEveryModel(db *gorm.DB) *FsDeliverEveryModel { return &FsDeliverEveryModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,40 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_deliver 发货表 云仓 直发 通用(已废弃)
|
||||
type FsDeliver struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
||||
Type *int64 `gorm:"default:0;" json:"type"` // 1直接发货,2云仓发货
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
||||
AdminId *int64 `gorm:"index;default:0;" json:"admin_id"` // 操作人id
|
||||
Fee *int64 `gorm:"default:0;" json:"fee"` // 运费价格
|
||||
Tel *string `gorm:"default:'';" json:"tel"` // 电话
|
||||
DeliveryType *int64 `gorm:"default:0;" json:"delivery_type"` // 发货公司
|
||||
AddressId *int64 `gorm:"index;default:0;" json:"address_id"` // 地址id
|
||||
AddressInfo *string `gorm:"default:'';" json:"address_info"` // 地址信息
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` //
|
||||
OrderId *int64 `gorm:"default:0;" json:"order_id"` // 云仓发货order_id为0
|
||||
WarehouseDeliverSn *string `gorm:"index;default:'';" json:"warehouse_deliver_sn"` //
|
||||
IsConfirm *int64 `gorm:"default:0;" json:"is_confirm"` // 0未确认 1已确认
|
||||
IsDeliver *int64 `gorm:"default:0;" json:"is_deliver"` // 0未发货 1已发货
|
||||
IsPort *int64 `gorm:"default:0;" json:"is_port"` // 是否到达港口 0未到达 1:已到达
|
||||
IsPickUp *int64 `gorm:"default:0;" json:"is_pick_up"` // 美国运输是否已收货 0:未提货 1:已提货
|
||||
IsEnd *int64 `gorm:"default:0;" json:"is_end"` // 0未收货 1已签收
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态值:(0:默认未确认,1:已确认,2:已发货,3:到港口,4:运输中,5:已签收)
|
||||
ConfirmAt *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"confirm_at"` //
|
||||
DeliverAt *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"deliver_at"` //
|
||||
PortAt *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"port_at"` //
|
||||
PickUpAt *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"pick_up_at"` //
|
||||
EndAt *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"end_at"` //
|
||||
FirstDeliverSn *string `gorm:"index;default:'';" json:"first_deliver_sn"` //
|
||||
TwoDeliverSn *string `gorm:"index;default:'';" json:"two_deliver_sn"` //
|
||||
TsTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ts_time"` //
|
||||
}
|
||||
type FsDeliverModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsDeliverModel(db *gorm.DB) *FsDeliverModel { return &FsDeliverModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,17 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_department 部门表
|
||||
type FsDepartment struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
|
||||
Name *string `gorm:"default:'';" json:"name"` // 部门名称
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态 1正常0停用
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
ParentId *int64 `gorm:"default:0;" json:"parent_id"` // 父级id
|
||||
}
|
||||
type FsDepartmentModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsDepartmentModel(db *gorm.DB) *FsDepartmentModel { return &FsDepartmentModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
@@ -1,19 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_email_logs 邮件日志表
|
||||
type FsEmailLogs struct {
|
||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // ID
|
||||
Type *int64 `gorm:"default:0;" json:"type"` // 邮件分类
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 发送时间
|
||||
Email *string `gorm:"default:'';" json:"email"` // 发送邮箱
|
||||
EmailSubject *string `gorm:"default:'';" json:"email_subject"` // 发送标题
|
||||
Result *string `gorm:"default:'';" json:"result"` // 发送结果
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态 1成功0失败
|
||||
}
|
||||
type FsEmailLogsModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsEmailLogsModel(db *gorm.DB) *FsEmailLogsModel { return &FsEmailLogsModel{db} }
|
||||
@@ -1,3 +0,0 @@
|
||||
package gmodel
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user