Documentation ¶
Index ¶
- Variables
- func CreateRecipe(args *ArgsCreateRecipe) (id int64, err error)
- func DeleteRecipe(args *ArgsDeleteRecipe) (err error)
- func GetRecipeNameByID(id int64) (name string)
- func ImportData(args *ArgsImportData, excelData *excelize.File, waitDeleteFile string) (errCode string, importCount int, skipImportCount int, err error)
- func ImportDataByUpload(args *ArgsImportData, c *gin.Context, ...) (errCode string, importCount int, skipImportCount int, err error)
- func Init() (err error)
- func UpdateRecipe(args *ArgsUpdateRecipe) (err error)
- type ArgsCreateRecipe
- type ArgsDeleteRecipe
- type ArgsGetRecipeByID
- type ArgsGetRecipeList
- type ArgsImportData
- type ArgsUpdateRecipe
- type FieldsRecipe
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //Sort 菜品分类 Sort = ClassSort.Sort{ SortTableName: "restaurant_recipe_sort", } )
Functions ¶
func CreateRecipe ¶
func CreateRecipe(args *ArgsCreateRecipe) (id int64, err error)
CreateRecipe 创建Recipe
func ImportData ¶ added in v5.1.30
func ImportData(args *ArgsImportData, excelData *excelize.File, waitDeleteFile string) (errCode string, importCount int, skipImportCount int, err error)
ImportData 批量导入数据 excelData 为文件的excel文件结构体,请参考ToolsLoadExcel.UploadFileAndGetExcelData实现获取 waitDeleteFile 为导入完成后需要删除的文件路径
func ImportDataByUpload ¶ added in v5.1.30
func ImportDataByUpload(args *ArgsImportData, c *gin.Context, argsUploadTemp *BaseFileUpload.ArgsUploadToTemp) (errCode string, importCount int, skipImportCount int, err error)
ImportDataByUpload 上传文件并导入
Types ¶
type ArgsCreateRecipe ¶
type ArgsCreateRecipe struct { //分类ID CategoryID int64 `db:"category_id" json:"categoryID" check:"id" empty:"true"` //菜品名称 Name string `db:"name" json:"name" check:"des" min:"1" max:"300" empty:"true"` //单位 Unit string `db:"unit" json:"unit" check:"des" min:"1" max:"60" empty:"true"` //单位ID UnitID int64 `db:"unit_id" json:"unitID" check:"id" empty:"true"` //分公司ID OrgID int64 `db:"org_id" json:"orgID" check:"id"` //门店ID StoreID int64 `db:"store_id" json:"storeID" check:"id"` // 建议售价 Price int64 `db:"price" json:"price" check:"int64Than0"` //备注 Remark string `db:"remark" json:"remark" check:"des" min:"0" max:"3000" empty:"true"` }
ArgsCreateRecipe 创建Recipe参数
type ArgsDeleteRecipe ¶
type ArgsDeleteRecipe struct { //ID ID int64 `db:"id" json:"id" check:"id"` }
ArgsDeleteRecipe 删除Recipe参数
type ArgsGetRecipeByID ¶
type ArgsGetRecipeByID struct { //ID ID int64 `db:"id" json:"id" check:"id"` //分公司ID OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` //门店ID StoreID int64 `db:"store_id" json:"storeID" check:"id" empty:"true"` }
ArgsGetRecipeByID 获取Recipe数据包参数
type ArgsGetRecipeList ¶
type ArgsGetRecipeList struct { //分页参数 Pages CoreSQL2.ArgsPages `json:"pages"` //分类ID CategoryID int64 `db:"category_id" json:"categoryID" check:"id" empty:"true"` //分公司ID OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` //门店ID StoreID int64 `db:"store_id" json:"storeID" check:"id" empty:"true"` //是否删除 IsRemove bool `json:"isRemove" check:"bool"` //搜索 Search string `json:"search" check:"search" empty:"true"` }
ArgsGetRecipeList 获取Recipe列表参数
type ArgsImportData ¶ added in v5.1.30
type ArgsImportData struct { //分公司ID OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` //门店ID // 暂时不启用 StoreID int64 `db:"store_id" json:"storeID" check:"id" empty:"true"` }
ArgsImportData 批量导入数据参数
type ArgsUpdateRecipe ¶
type ArgsUpdateRecipe struct { //ID ID int64 `db:"id" json:"id" check:"id"` //分类ID CategoryID int64 `db:"category_id" json:"categoryID" check:"id" empty:"true"` //菜品名称 Name string `db:"name" json:"name" check:"des" min:"1" max:"300" empty:"true"` //单位 Unit string `db:"unit" json:"unit" check:"des" min:"1" max:"60" empty:"true"` //单位ID UnitID int64 `db:"unit_id" json:"unitID" check:"id" empty:"true"` //分公司ID OrgID int64 `db:"org_id" json:"orgID" check:"id"` //门店ID StoreID int64 `db:"store_id" json:"storeID" check:"id"` // 建议售价 Price int64 `db:"price" json:"price" check:"int64Than0"` //备注 Remark string `db:"remark" json:"remark" check:"des" min:"0" max:"3000" empty:"true"` }
ArgsUpdateRecipe 修改Recipe参数
type FieldsRecipe ¶
type FieldsRecipe struct { // ID ID int64 `db:"id" json:"id" check:"id"` //创建时间 CreateAt time.Time `db:"create_at" json:"createAt"` //更新时间 UpdateAt time.Time `db:"update_at" json:"updateAt"` //删除时间 DeleteAt time.Time `db:"delete_at" json:"deleteAt"` //分类ID CategoryID int64 `db:"category_id" json:"categoryID" check:"id" empty:"true"` //菜品名称 Name string `db:"name" json:"name" check:"des" min:"1" max:"300" empty:"true"` //单位 Unit string `db:"unit" json:"unit" check:"des" min:"1" max:"60" empty:"true"` //单位ID UnitID int64 `db:"unit_id" json:"unitID" check:"id" empty:"true"` //分公司ID OrgID int64 `db:"org_id" json:"orgID" check:"id"` //门店ID StoreID int64 `db:"store_id" json:"storeID" check:"id" empty:"true"` //建议售价 Price int64 `db:"price" json:"price" check:"int64Than0"` //备注 Remark string `db:"remark" json:"remark" check:"des" min:"0" max:"3000" empty:"true"` }
FieldsRecipe 菜品模块表结构
func GetRecipeByID ¶
func GetRecipeByID(args *ArgsGetRecipeByID) (data FieldsRecipe, err error)
GetRecipeByID 获取Recipe数
func GetRecipeByName ¶ added in v5.1.30
func GetRecipeByName(orgID int64, storeID int64, name string) (data FieldsRecipe)
GetRecipeByName 通过名称找到菜品
func GetRecipeList ¶
func GetRecipeList(args *ArgsGetRecipeList) (dataList []FieldsRecipe, dataCount int64, err error)
GetRecipeList 获取Recipe列表
Click to show internal directories.
Click to hide internal directories.