houyaf 3 سال پیش
والد
کامیت
27f4689555

+ 7 - 7
constant/constant.go

@@ -36,13 +36,13 @@ const (
 )
 
 const (
-	OAM_GET_ONE       = 1
-	OAM_GET_LIST      = 2
-	OAM_GET_PAGE      = 3
-	OAM_CREATE        = 4
-	OAM_UPDATE        = 5
-	OAM_PATCH         = 6
-	OAM_DELETE        = 7
+	OAM_CREATE        = 1
+	OAM_UPDATE        = 2
+	OAM_DELETE        = 3
+	OAM_PATCH         = 4
+	OAM_GET_ONE       = 5
+	OAM_GET_LIST      = 6
+	OAM_GET_PAGE      = 7
 )
 
 const (

+ 11 - 6
repositories/biz_object_oam_mapping_repo.go

@@ -23,11 +23,16 @@ func (d *BizObjectOAMMappingRepo) GetList(m map[string]interface{}) ([]viewmodel
                               B.object_title,
                               B.object_code,
                               C.oam_title,
-                              C.oam_code   `
+                              C.oam_code,
+                              E.model_title  AS mapping_model_title,
+                              F.object_title AS mapping_object_title,
+                              F.object_code  AS mapping_object_code    `
     sqlFrom    := ` FROM      biz_object_oam_mapping AS A
                     LEFT JOIN biz_object             AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)
-                    LEFT JOIN biz_object_oam         AS C ON (A.biz_id = C.biz_id AND A.object_id = C.object_id AND A.oam_id = C.oam_id)`
-    sqlWhere   := ` WHERE  A.deleted_flag = 0    `
+                    LEFT JOIN biz_object_oam         AS C ON (A.biz_id = C.biz_id AND A.object_id = C.object_id AND A.oam_id = C.oam_id)
+                    LEFT JOIN ds_model               AS E ON (A.mapping_model_id = E.model_id)
+                    LEFT JOIN ds_object              AS F ON (A.mapping_model_id = F.model_id AND A.mapping_object_id = F.object_id)`
+    sqlWhere   := ` WHERE  1=1   `
     if bizId, ok := m["bizId"]; ok {
         sqlWhere += fmt.Sprintf(" AND A.biz_id = %d ", bizId)
     }
@@ -37,7 +42,7 @@ func (d *BizObjectOAMMappingRepo) GetList(m map[string]interface{}) ([]viewmodel
     if oamId, ok := m["oamId"]; ok {
         sqlWhere += fmt.Sprintf(" AND A.oam_id = %d ", oamId)
     }
-    sqlOrderBy := " ORDER BY A.param_id ASC "
+    sqlOrderBy := " ORDER BY A.sort_no ASC "
     
     datalist   := make([]viewmodels.BizObjectOAMMappingInfo, 0)
     err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere + sqlOrderBy).Find(&datalist)
@@ -57,7 +62,7 @@ func (d *BizObjectOAMMappingRepo) GetById(bizId, objectId, oamId, orId int64) (*
     sqlFrom    := ` FROM      biz_object_oam_mapping AS A
                     LEFT JOIN biz_object             AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)
                     LEFT JOIN biz_object_oam         AS C ON (A.biz_id = C.biz_id AND A.object_id = C.object_id AND A.oam_id = C.oam_id)`
-    sqlWhere   := ` WHERE A.deleted_flag = 0    `
+    sqlWhere   := ` WHERE 1=1    `
     sqlWhere   += fmt.Sprintf(" AND A.biz_id    = %d ", bizId)
     sqlWhere   += fmt.Sprintf(" AND A.object_id = %d ", objectId)
     sqlWhere   += fmt.Sprintf(" AND A.oam_id    = %d ", oamId)
@@ -81,7 +86,7 @@ func (d *BizObjectOAMMappingRepo) GetListById(bizId, objectId, oamId int64) ([]v
     sqlFrom    := ` FROM      biz_object_oam_mapping AS A
                     LEFT JOIN biz_object             AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)
                     LEFT JOIN biz_object_oam         AS C ON (A.biz_id = C.biz_id AND A.object_id = C.object_id AND A.oam_id = C.oam_id)`
-    sqlWhere   := ` WHERE A.deleted_flag = 0    `
+    sqlWhere   := ` WHERE 1=1     `
     sqlWhere   += fmt.Sprintf(" AND A.biz_id    = %d ", bizId)
     sqlWhere   += fmt.Sprintf(" AND A.object_id = %d ", objectId)
     sqlWhere   += fmt.Sprintf(" AND A.oam_id    = %d ", oamId)

+ 2 - 2
repositories/biz_object_oam_params_repo.go

@@ -48,7 +48,7 @@ func (d *BizObjectOAMParamsRepo) GetList(m map[string]interface{}) ([]viewmodels
     }
 }
 
-func (d *BizObjectOAMParamsRepo) GetById(bizId, objectId, oamId, orId int64) (*viewmodels.BizObjectOAMParamsInfo, error) {
+func (d *BizObjectOAMParamsRepo) GetById(bizId, objectId, oamId, paramId int64) (*viewmodels.BizObjectOAMParamsInfo, error) {
     sqlSelect  := ` SELECT    A.* ,
                               B.object_title,
                               B.object_code,
@@ -61,7 +61,7 @@ func (d *BizObjectOAMParamsRepo) GetById(bizId, objectId, oamId, orId int64) (*v
     sqlWhere   += fmt.Sprintf(" AND A.biz_id    = %d ", bizId)
     sqlWhere   += fmt.Sprintf(" AND A.object_id = %d ", objectId)
     sqlWhere   += fmt.Sprintf(" AND A.oam_id    = %d ", oamId)
-    sqlWhere   += fmt.Sprintf(" AND A.or_id     = %d ", orId)
+    sqlWhere   += fmt.Sprintf(" AND A.param_id  = %d ", paramId)
     
     data    := &viewmodels.BizObjectOAMParamsInfo{}
     has, err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere).Get(data)

+ 18 - 0
repositories/biz_object_repo.go

@@ -78,6 +78,24 @@ func (d *BizObjectRepo) GetList(m map[string]interface{}) ([]viewmodels.BizObjec
     }
 }
 
+func (d *BizObjectRepo) GetListById(bizId int64) ([]viewmodels.BizObjectInfo, error) {
+    sqlSelect := ` SELECT    A.*,
+                             B.biz_title      `
+    sqlFrom   := ` FROM      biz_object   AS A
+                   LEFT JOIN biz AS B ON (A.biz_id = B.biz_id)  `
+    sqlWhere  := ` WHERE A.deleted_flag = 0 AND A.biz_id =` + fmt.Sprintf("%d", bizId)
+    sqlOrderBy := " ORDER BY A.biz_id, A.object_id "
+    
+    datalist := make([]viewmodels.BizObjectInfo, 0)
+    err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere + sqlOrderBy).Find(&datalist)
+    if err != nil {
+        return nil, err
+    } else {
+        return datalist, nil
+    }
+}
+
+
 func (d *BizObjectRepo) GetAll() ([]viewmodels.BizObjectInfo, error) {
     sqlSelect  := ` SELECT    A.*,
                               B.biz_title      `

+ 19 - 0
repositories/model_object_repo.go

@@ -77,6 +77,25 @@ func (d *ModelObjectRepo) GetList(m map[string]interface{}) ([]viewmodels.ModelO
 	}
 }
 
+func (d *ModelObjectRepo) GetListById(modelId int64) ([]viewmodels.ModelObjectInfo, error) {
+	
+	sqlSelect  := ` SELECT    A.*,
+                              B.model_title      `
+	sqlFrom    := ` FROM      ds_object  AS A
+                    LEFT JOIN ds_model   AS B ON (A.model_id = B.model_id)  `
+	sqlWhere   := ` WHERE A.deleted_flag = 0 `
+    sqlWhere   += fmt.Sprintf(" AND A.model_id = %d " , modelId)
+	sqlOrderBy := " ORDER BY A.model_id, A.object_id "
+	
+	datalist := make([]viewmodels.ModelObjectInfo, 0)
+	err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere + sqlOrderBy).Find(&datalist)
+	if err != nil {
+		return nil, err
+	} else {
+		return datalist, nil
+	}
+}
+
 func (d *ModelObjectRepo) GetAll() ([]viewmodels.ModelObjectInfo, error) {
 	sqlSelect  := ` SELECT    A.*,
                               B.model_title      `

+ 3 - 3
service/biz_object_oam_params_service.go

@@ -12,7 +12,7 @@ import (
 
 type BizObjectOAMParamsService interface {
     GetList(m map[string]interface{}) ([]viewmodels.BizObjectOAMParamsInfo, error)
-    GetById(bizId, objectId, oamId, paramsId int64) (*viewmodels.BizObjectOAMParamsInfo, error)
+    GetById(bizId, objectId, oamId, paramId int64) (*viewmodels.BizObjectOAMParamsInfo, error)
     Create(param *datamodels.BizObjectOAMParams) error
     Update(param *datamodels.BizObjectOAMParams) error
     Delete(m map[string]interface{}) error
@@ -36,8 +36,8 @@ func (s *bizObjectOAMParamsService) GetList(m map[string]interface{}) ([]viewmod
     return s.oamParamsRepo.GetList(m)
 }
 
-func (s *bizObjectOAMParamsService) GetById(bizId, objectId, oamId, paramsId int64) (*viewmodels.BizObjectOAMParamsInfo, error) {
-    return s.oamParamsRepo.GetById(bizId, objectId, oamId, paramsId)
+func (s *bizObjectOAMParamsService) GetById(bizId, objectId, oamId, paramId int64) (*viewmodels.BizObjectOAMParamsInfo, error) {
+    return s.oamParamsRepo.GetById(bizId, objectId, oamId, paramId)
 }
 
 func (s *bizObjectOAMParamsService) Create(param *datamodels.BizObjectOAMParams) error {

+ 5 - 0
service/biz_object_service.go

@@ -13,6 +13,7 @@ type BizObjectService interface {
     GetList(m map[string]interface{}) ([]viewmodels.BizObjectInfo, error)
     GetPage(m map[string]interface{}) (*viewmodels.PageResult, error)
     GetById(bizId, objectId int64) (*viewmodels.BizObjectInfo, error)
+    GetListById(bizId int64) ([]viewmodels.BizObjectInfo, error)
     Create(d *datamodels.BizObject) error
     Update(d *datamodels.BizObject) error
     Delete(m map[string]interface{}) error
@@ -36,6 +37,10 @@ func (s *bizObjectService) GetList(m map[string]interface{}) ([]viewmodels.BizOb
     return s.bizObjectRepo.GetList(m)
 }
 
+func (s *bizObjectService) GetListById(bizId int64) ([]viewmodels.BizObjectInfo, error) {
+    return s.bizObjectRepo.GetListById(bizId)
+}
+
 func (s *bizObjectService) GetPage(m map[string]interface{}) (*viewmodels.PageResult, error) {
     return s.bizObjectRepo.GetPage(m)
 }

+ 6 - 0
service/model_object_service.go

@@ -13,6 +13,7 @@ type ModelObjectService interface {
 	GetList(m map[string]interface{}) ([]viewmodels.ModelObjectInfo, error)
 	GetPage(m map[string]interface{}) (*viewmodels.PageResult, error)
 	GetById(modelId, objectId int64) (*viewmodels.ModelObjectInfo, error)
+	GetListById(modelId int64) ([]viewmodels.ModelObjectInfo, error)
 	Create(o *datamodels.ModelObject) error
 	Update(o *datamodels.ModelObject) error
 	Delete(m map[string]interface{}) error
@@ -37,6 +38,11 @@ func (s *modelObjectService) GetList(m map[string]interface{}) ([]viewmodels.Mod
 	return s.modelObjectRepo.GetList(m)
 }
 
+func (s *modelObjectService) GetListById(modelId int64) ([]viewmodels.ModelObjectInfo, error) {
+	return s.modelObjectRepo.GetListById(modelId)
+}
+
+
 func (s *modelObjectService) Select(modelId, targetBizId, targetObjectId int64) ([]viewmodels.ModelObjectInfo, error) {
 	return s.modelObjectRepo.SelectForBizObjectMapping(modelId, targetBizId, targetObjectId)
 }

+ 8 - 11
service/x_gateway_service.go

@@ -107,18 +107,16 @@ func (a *xGatewayService) Create(objectCode, oamCode string, m map[string]interf
         return err1
     }
     
-
-    
     data, err2 := a.Mapping2ModelObjectAttr(objectCode, m)
     if err2 != nil {
         return err2
     }
     
-    objectMappingList, err3 := cache.GetBizObjectMapping(objectCode)
+    objectOAMMappingList, err3 := cache.GetBizObjectOAMMapping(objectCode, oamCode)
     if err3 != nil {
         return err3
     }
-    for _, mappingObject := range objectMappingList {
+    for _, mappingObject := range objectOAMMappingList {
         mappingObjectCode := mappingObject.MappingObjectCode
         err4 := a.xBus.Create(mappingObjectCode, data)
         if err4 != nil {
@@ -140,12 +138,12 @@ func (a *xGatewayService) Update(objectCode, oamCode string, m map[string]interf
         return err2
     }
     
-    objectMappingList, err3 := cache.GetBizObjectMapping(objectCode)
+    objectOAMMappingList, err3 := cache.GetBizObjectOAMMapping(objectCode, oamCode)
     if err3 != nil {
         return err3
     }
     
-    for _, mappingObject := range objectMappingList {
+    for _, mappingObject := range objectOAMMappingList {
         mappingObjectCode := mappingObject.MappingObjectCode
         err4 := a.xBus.Update(mappingObjectCode, data)
         if err4 != nil {
@@ -167,12 +165,11 @@ func (a *xGatewayService) Patch(objectCode, oamCode string, m map[string]interfa
         return err2
     }
     
-    objectMappingList, err3 := cache.GetBizObjectMapping(objectCode)
+    objectOAMMappingList, err3 := cache.GetBizObjectOAMMapping(objectCode, oamCode)
     if err3 != nil {
         return err3
     }
-    
-    for _, mappingObject := range objectMappingList {
+    for _, mappingObject := range objectOAMMappingList {
         mappingObjectCode := mappingObject.MappingObjectCode
         err4 := a.xBus.Patch(mappingObjectCode, data)
         if err4 != nil {
@@ -193,12 +190,12 @@ func (a *xGatewayService) Delete(objectCode, oamCode string, m map[string]interf
         return err2
     }
     
-    objectMappingList, err3 := cache.GetBizObjectMapping(objectCode)
+    objectOAMMappingList, err3 := cache.GetBizObjectOAMMapping(objectCode, oamCode)
     if err3 != nil {
         return err3
     }
     
-    for _, mappingObject := range objectMappingList {
+    for _, mappingObject := range objectOAMMappingList {
         mappingObjectCode := mappingObject.MappingObjectCode
         err4 := a.xBus.Delete(mappingObjectCode, data)
         if err4 != nil {

+ 15 - 12
viewmodels/biz_object_oam_mapping_info.go

@@ -1,18 +1,21 @@
 package viewmodels
 
 type BizObjectOAMMappingInfo struct {
-    MappingId       int64     `json:"mappingId"         xorm:"'mapping_id'        bigint    pk  comment('Mapping ID')       "`
-    BizId           int64     `json:"bizId"             xorm:"'biz_id'            bigint        comment('Biz ID')           "`
-    ObjectId        int64     `json:"objectId"          xorm:"'object_id'         bigint        comment('Object ID')        "`
-    ObjectTitle     string    `json:"objectTitle"      xorm:"'object_title'     varchar(127)   comment('Object Title')    "`
-    ObjectCode      string    `json:"objectCode"        xorm:"'object_code'       varchar(127)   comment('Object Code')     "`
-    OamId           int64     `json:"oamId"             xorm:"'oam_id'            bigint        comment('OAM ID')           "`
-    OamCode         string    `json:"oamCode"           xorm:"'oam_code'          varchar(127)   comment('OAM Code')        "`
-    MappingModelId  int64     `json:"mappingModelId"    xorm:"'mapping_model_id'  bigint        comment('Mapping Model ID') "`
-    MappingObjectId int64     `json:"mappingObjectId"   xorm:"'mapping_object_id' bigint        comment('Mapping Object ID')"`
-    MappingOamId    int64     `json:"mappingOamId"      xorm:"'mapping_oam_id'    bigint        comment('Mapping OAM ID')   "`
-    SortNo          int64     `json:"sortNo"            xorm:"'sort_no'           bigint        comment('Sort No')          "`
-    Remark          string    `json:"remark"            xorm:"'remark'            varchar(255)  comment('Remark')           "`
+    MappingId           int64     `json:"mappingId"             xorm:"'mapping_id'              bigint    pk  comment('Mapping ID')       "`
+    BizId               int64     `json:"bizId"                 xorm:"'biz_id'                  bigint        comment('Biz ID')           "`
+    ObjectId            int64     `json:"objectId"              xorm:"'object_id'               bigint        comment('Object ID')        "`
+    ObjectTitle         string    `json:"objectTitle"           xorm:"'object_title'            varchar(127)  comment('Object Title')     "`
+    ObjectCode          string    `json:"objectCode"            xorm:"'object_code'             varchar(127)  comment('Object Code')      "`
+    OamId               int64     `json:"oamId"                 xorm:"'oam_id'                  bigint        comment('OAM ID')           "`
+    OamCode             string    `json:"oamCode"               xorm:"'oam_code'                varchar(127)  comment('OAM Code')         "`
+    MappingModelId      int64     `json:"mappingModelId"        xorm:"'mapping_model_id'        bigint        comment('Mapping Model ID') "`
+    MappingModelTitle   string    `json:"mappingModelTitle"     xorm:"'mapping_model_title'     varchar(127)  comment('Mapping Model Title')    "`
+    MappingObjectId     int64     `json:"mappingObjectId"       xorm:"'mapping_object_id'       bigint        comment('Mapping Object ID')      "`
+    MappingObjectTitle  string    `json:"mappingObjectTitle"    xorm:"'mapping_object_title'    varchar(127)  comment('Mapping Object Title')   "`
+    MappingObjectCode   string    `json:"mappingObjectCode"     xorm:"'mapping_object_code'     varchar(127)  comment('Mapping Object Code')    "`
+    MappingOamId        int64     `json:"mappingOamId"          xorm:"'mapping_oam_id'          bigint        comment('Mapping OAM ID')     "`
+    SortNo              int64     `json:"sortNo"                xorm:"'sort_no'                 bigint        comment('Sort No')            "`
+    Remark              string    `json:"remark"                xorm:"'remark'                  varchar(255)  comment('Remark')             "`
 }
 
 func (t *BizObjectOAMMappingInfo) TableName() string {

+ 19 - 9
web/controllers/biz_object_controller.go

@@ -12,21 +12,22 @@ type BizObjectController struct {
 }
 
 func (c *BizObjectController) BeforeActivation(b mvc.BeforeActivation) {
-    b.Handle("GET",         "/",                                 "GetList"   )
-    b.Handle("GET",         "/page",                             "GetPage"   )
-    b.Handle("GET",         "/{bizId:int64}/{objectId:int64}",   "GetById"   )
-    b.Handle("POST",        "/add",                              "Create"    )
-    b.Handle("PUT",         "/update",                           "Update"    )
-    b.Handle("DELETE",      "/{bizId:int64}/{objectId:int64}",   "DeleteByID")
+    b.Handle("GET",         "/",                                 "GetList"    )
+    b.Handle("GET",         "/page",                             "GetPage"    )
+    b.Handle("GET",         "/{bizId:int64}",                    "GetListById")
+    b.Handle("GET",         "/{bizId:int64}/{objectId:int64}",   "GetById"    )
+    b.Handle("POST",        "/add",                              "Create"     )
+    b.Handle("PUT",         "/update",                           "Update"     )
+    b.Handle("DELETE",      "/{bizId:int64}/{objectId:int64}",   "DeleteByID" )
 }
 
 func (c *BizObjectController) GetList() *JsonResult {
     params := c.buildParams()
     bizId  := c.Ctx.URLParamInt64Default("bizId", 0)
-    if bizId <= 0 {
-        return ResultErr("参数不完整", nil)
+    if bizId > 0 {
+        params["bizId"] = bizId
     }
-    params["bizId"] = bizId
+    
     data, err := c.Service.GetList(params)
     if err != nil {
         return ResultErr(err.Error(), nil)
@@ -35,6 +36,15 @@ func (c *BizObjectController) GetList() *JsonResult {
     }
 }
 
+func (c *BizObjectController) GetListById(bizId int64) *JsonResult {
+    data, err := c.Service.GetListById(bizId)
+    if err != nil {
+        return ResultErr(err.Error(), nil)
+    } else {
+        return ResultOk("获取成功", data)
+    }
+}
+
 func (c *BizObjectController) GetPage() *JsonResult {
     params := c.buildParams()
     bizId  := c.Ctx.URLParamInt64Default("bizId", 0)

+ 6 - 6
web/controllers/biz_object_oam_params_controller.go

@@ -14,10 +14,10 @@ type BizObjectOAMParamsController struct {
 func (c *BizObjectOAMParamsController) BeforeActivation(b mvc.BeforeActivation) {
     b.Handle("GET",     "/",                                                              "GetList"      )
     b.Handle("GET",     "/{bizId:int64}/{objectId:int64}/{oamId:int64}",                  "GetListById"  )
-    b.Handle("GET",     "/{bizId:int64}/{objectId:int64}/{oamId:int64}/{paramsId:int64}", "GetById"      )
+    b.Handle("GET",     "/{bizId:int64}/{objectId:int64}/{oamId:int64}/{paramId:int64}",  "GetById"      )
     b.Handle("POST",    "/add",                                                           "Create"       )
     b.Handle("PUT",     "/update",                                                        "Update"       )
-    b.Handle("DELETE",  "/{bizId:int64}/{objectId:int64}/{oamId:int64}/{paramsId:int64}", "DeleteByID"   )
+    b.Handle("DELETE",  "/{bizId:int64}/{objectId:int64}/{oamId:int64}/{paramId:int64}",  "DeleteByID"   )
 }
 
 func (c *BizObjectOAMParamsController) GetList() *JsonResult {
@@ -43,8 +43,8 @@ func (c *BizObjectOAMParamsController) GetListById(bizId, objectId, oamId int64)
     }
 }
 
-func (c *BizObjectOAMParamsController) GetById(bizId, objectId, oamId, paramsId int64) *JsonResult {
-    data, err := c.Service.GetById(bizId, objectId, oamId, paramsId)
+func (c *BizObjectOAMParamsController) GetById(bizId, objectId, oamId, paramId int64) *JsonResult {
+    data, err := c.Service.GetById(bizId, objectId, oamId, paramId)
     if err != nil {
         return ResultErr(err.Error(), nil)
     } else {
@@ -78,12 +78,12 @@ func (c *BizObjectOAMParamsController) Update() *JsonResult {
     }
 }
 
-func (c *BizObjectOAMParamsController) DeleteByID(bizId, objectId, oamId, paramsId int64) *JsonResult {
+func (c *BizObjectOAMParamsController) DeleteByID(bizId, objectId, oamId, paramId int64) *JsonResult {
     m := make(map[string]interface{})
     m["bizId"]    = bizId
     m["objectId"] = objectId
     m["oamId"]    = oamId
-    m["paramsId"] = paramsId
+    m["paramId"]  = paramId
     if err := c.Service.Delete(m); err != nil {
         return ResultErr(err.Error(), nil)
     } else {

+ 17 - 7
web/controllers/model_object_controller.go

@@ -12,13 +12,14 @@ type ModelObjectController struct {
 }
 
 func (c *ModelObjectController) BeforeActivation(b mvc.BeforeActivation) {
-	b.Handle("GET",         "/",                                                                    "GetList"   )
-	b.Handle("GET",         "/page",                                                                "GetPage"   )
-	b.Handle("GET",         "/{modelId:int64}/{objectId:int64}",                                    "GetById"   )
-	b.Handle("GET",         "/select/{modelId:int64}/{targetBizId:int64}/{targetObjectId:int64}",   "Select"    )
-	b.Handle("POST",        "/add",                                                                 "Create"    )
-	b.Handle("PUT",         "/update",                                                              "Update"    )
-	b.Handle("DELETE",      "/{modelId:int64}/{objectId:int64}",                                    "DeleteByID")
+	b.Handle("GET",         "/",                                                                    "GetList"       )
+	b.Handle("GET",         "/page",                                                                "GetPage"       )
+	b.Handle("GET",         "/{modelId:int64}/{objectId:int64}",                                    "GetById"       )
+	b.Handle("GET",         "/{modelId:int64}",                                                     "GetListById"   )
+	b.Handle("GET",         "/select/{modelId:int64}/{targetBizId:int64}/{targetObjectId:int64}",   "Select"        )
+	b.Handle("POST",        "/add",                                                                 "Create"        )
+	b.Handle("PUT",         "/update",                                                              "Update"        )
+	b.Handle("DELETE",      "/{modelId:int64}/{objectId:int64}",                                    "DeleteByID"    )
 }
 
 func (c *ModelObjectController) GetList() *JsonResult {
@@ -36,6 +37,15 @@ func (c *ModelObjectController) GetList() *JsonResult {
 	}
 }
 
+func (c *ModelObjectController) GetListById(modelId int64) *JsonResult {
+	data, err := c.Service.GetListById(modelId)
+	if err != nil {
+		return ResultErr(err.Error(), nil)
+	} else {
+		return ResultOk("获取成功", data)
+	}
+}
+
 func (c *ModelObjectController) Select(modelId, targetBizId, targetObjectId int64) *JsonResult {
 	data, err := c.Service.Select(modelId, targetBizId, targetObjectId)
 	if err != nil {