平台物料分类
This commit is contained in:
15
business/model/dao/dao_matter.go
Normal file
15
business/model/dao/dao_matter.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
func GetVendorMatterCategory(db *DaoDB, vendorID int) (vendorMatterCat []*model.VendorMatterCategory, err error) {
|
||||
sql := `
|
||||
SELECT * FROM vendor_matter_catgory WHERE deleted_at = ? AND vendor_id = ?
|
||||
`
|
||||
sqlParams := []interface{}{utils.DefaultTimeValue, vendorID}
|
||||
err = GetRows(db, &vendorMatterCat, sql, sqlParams)
|
||||
return vendorMatterCat, err
|
||||
}
|
||||
17
business/model/matter.go
Normal file
17
business/model/matter.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
type VendorMatterCategory struct {
|
||||
ModelIDCULD
|
||||
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
CategoryID int `orm:"column(category_id)" json:"categoryID"`
|
||||
CategoryName string `json:"categoryName"`
|
||||
ParentID int `orm:"column(parent_id)" json:"parentID"`
|
||||
Level int `json:"level"`
|
||||
}
|
||||
|
||||
func (v *VendorMatterCategory) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"VendorID", "CategoryID"},
|
||||
}
|
||||
}
|
||||
@@ -596,3 +596,17 @@ func (c *JobController) GetUnionJobOrderInfo() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查询平台物料分类
|
||||
// @Description 查询平台物料分类
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorID query int true "平台ID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetVendorMatterCategory [get]
|
||||
func (c *JobController) GetVendorMatterCategory() {
|
||||
c.callGetVendorMatterCategory(func(params *tJobGetVendorMatterCategoryParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = dao.GetVendorMatterCategory(dao.GetDB(), params.VendorID)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ func Init() {
|
||||
orm.RegisterModel(&model.OperateEvent{})
|
||||
orm.RegisterModel(&model.NewConfig{}, &legacymodel.Config{})
|
||||
orm.RegisterModel(&model.AddressDistinguish{})
|
||||
orm.RegisterModel(&model.VendorMatterCategory{}) //平台物流分类(手动添的)
|
||||
// create table
|
||||
orm.RunSyncdb("default", false, true)
|
||||
}
|
||||
|
||||
@@ -619,6 +619,15 @@ func init() {
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetVendorMatterCategory",
|
||||
Router: "/GetVendorMatterCategory",
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"],
|
||||
beego.ControllerComments{
|
||||
Method: "SubmitJob",
|
||||
|
||||
Reference in New Issue
Block a user