models

package
v0.0.0-...-15558e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProductCategories

func AddProductCategories(par *ProductCategories) error

AddProductCategories 添加分类

func AddReports

func AddReports(par *Reports) error

AddProductCategories 保存报表

func CheckAuth

func CheckAuth(username, password string) (bool, error)

CheckAuth checks if authentication information exists

func CloseDB

func CloseDB()

CloseDB closes database connection (unnecessary)

func ExistProductCategories

func ExistProductCategories(par *ProductCategories) (bool, error)

ExistProductCategories 检查sku对应的

func ExistReports

func ExistReports(par *Reports) (bool, error)

ExistReports 检查报告是否存在

func Setup

func Setup()

Setup initializes the database instance

Types

type Auth

type Auth struct {
	ID       int    `gorm:"primary_key" json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

Auth 结构体

type Model

type Model struct {
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `sql:"index" json:"deleted_at"`
	UUID      uuid.UUID  `gorm:"type:char(36);primary_key;UNIQUE_INDEX" json:"uuid"`
}

Model 公共模型

type ProductCategories

type ProductCategories struct {
	Model
	SellerID                  string `json:"seller_id" sql:"index" `
	MarketplaceID             string `json:"marketplace_id" sql:"index" `
	SellerSKU                 string `json:"seller_sku" sql:"index" `
	Asin                      string `json:"asin"`
	ProductCategoryID         int64  `json:"product_category_id"`
	ProductCategoryName       string `json:"product_category_name"`
	ParentProductCategoryID   int64  `json:"parent_product_category_id"`
	ParentProductCategoryName string `json:"parent_product_category_name"`
	SecondProductCategoryID   int64  `json:"second_product_category_id"`
	SecondProductCategoryName string `json:"product_category_name"`
}

ProductCategories 商品分类

func GetProductCategories

func GetProductCategories(par *ProductCategories) (categories ProductCategories, err error)

GetProductCategories 获取分类

type Reports

type Reports struct {
	Model
	SellerID               string    `json:"seller_id" sql:"index" `
	MarketplaceID          string    `json:"marketplace_id" sql:"index" `
	SellerSKU              string    `json:"seller_sku" sql:"index" `
	Asin                   string    `json:"asin"`
	ReportRequestID        string    `json:"report_request_id"`
	ReportType             string    `json:"report_type"`
	StartDate              time.Time `json:"start_date"`
	EndDate                time.Time `json:"end_date"`
	Scheduled              string    `json:"scheduled"`
	SubmittedDate          time.Time `json:"submitted_date"`
	ReportProcessingStatus string    `json:"report_processing_status"`
	GeneratedReportID      string    `json:"generated_report_id"`
	StartedProcessingDate  time.Time `json:"started_processing_date"`
	CompletedDate          time.Time `json:"completed_date"`
}

Reports 报告表

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL