Selaa lähdekoodia

增加PCWEB菜单表增删改查的操作接口

zhou.xiaoning 3 vuotta sitten
vanhempi
commit
0ffc27413f
6 muutettua tiedostoa jossa 857 lisäystä ja 0 poistoa
  1. 138 0
      controllers/common/menu.go
  2. 246 0
      docs/docs.go
  3. 246 0
      docs/swagger.json
  4. 159 0
      docs/swagger.yaml
  5. 63 0
      models/common.go
  6. 5 0
      routers/router.go

+ 138 - 0
controllers/common/menu.go

@@ -375,3 +375,141 @@ func toString(v interface{}) string {
 	}
 	return ""
 }
+
+// FindNewFuncmenu 获取菜单表数据
+// @Summary 获取菜单表数据
+// @Produce json
+// @Security ApiKeyAuth
+// @Param resourcecode query string false "资源代码"
+// @Param parentcode query string false "上级资源代码"
+// @Param resourcename query string false "资源名(Title), 模糊查询"
+// @Success 200 {object} app.Response
+// @Failure 500 {object} app.Response
+// @Router /Common/FindNewFuncmenu [get]
+// @Tags 通用服务
+func FindNewFuncmenu(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req models.NewFuncmenulistReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("FindNewFuncmenu failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	newFuncmenulist := models.NewFuncmenulist{}
+	rst, err := newFuncmenulist.Find(req)
+	if err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("FindNewFuncmenu failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 查询成功
+	logger.GetLogger().Debugln("FindNewFuncmenu successed")
+	appG.Response(http.StatusOK, e.SUCCESS, rst)
+}
+
+// InsertNewFuncmenu 插入菜单表数据
+// @Summary 插入菜单表数据
+// @accept application/json
+// @Produce application/json
+// @Security ApiKeyAuth
+// @Param data body models.NewFuncmenulist true "菜单表数据"
+// @Success 200 {object} app.Response
+// @Failure 500 {object} app.Response
+// @Router /Common/InsertNewFuncmenu [post]
+// @Tags 通用服务
+func InsertNewFuncmenu(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req models.NewFuncmenulist
+	if err := appG.C.ShouldBindJSON(&req); err != nil {
+		logger.GetLogger().Errorf("InsertNewFuncmenu failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	err := req.Insert()
+	if err != nil {
+		// 失败
+		logger.GetLogger().Errorf("InsertNewFuncmenu failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 成功
+	logger.GetLogger().Debugln("InsertNewFuncmenu successed")
+	appG.Response(http.StatusOK, e.SUCCESS, struct{}{})
+}
+
+// UpdateNewFuncmenu 更新菜单表数据
+// @Summary 更新菜单表数据
+// @accept application/json
+// @Produce application/json
+// @Security ApiKeyAuth
+// @Param data body models.NewFuncmenulist true "菜单表数据"
+// @Success 200 {object} app.Response
+// @Failure 500 {object} app.Response
+// @Router /Common/UpdateNewFuncmenu [put]
+// @Tags 通用服务
+func UpdateNewFuncmenu(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req models.NewFuncmenulist
+	if err := appG.C.ShouldBindJSON(&req); err != nil {
+		logger.GetLogger().Errorf("UpdateNewFuncmenu failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	err := req.Update()
+	if err != nil {
+		// 失败
+		logger.GetLogger().Errorf("UpdateNewFuncmenu failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 成功
+	logger.GetLogger().Debugln("UpdateNewFuncmenu successed")
+	appG.Response(http.StatusOK, e.SUCCESS, struct{}{})
+}
+
+// DeleteNewFuncmenu 删除菜单表数据
+// @Summary 删除菜单表数据
+// @accept application/json
+// @Produce application/json
+// @Security ApiKeyAuth
+// @Param data body models.NewFuncmenulist true "菜单表数据,只需要resourcecode字段即可"
+// @Success 200 {object} app.Response
+// @Failure 500 {object} app.Response
+// @Router /Common/DeleteNewFuncmenu [delete]
+// @Tags 通用服务
+func DeleteNewFuncmenu(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req models.NewFuncmenulist
+	if err := appG.C.ShouldBindJSON(&req); err != nil {
+		logger.GetLogger().Errorf("DeleteNewFuncmenu failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	err := req.Delete()
+	if err != nil {
+		// 失败
+		logger.GetLogger().Errorf("DeleteNewFuncmenu failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 成功
+	logger.GetLogger().Debugln("DeleteNewFuncmenu successed")
+	appG.Response(http.StatusOK, e.SUCCESS, struct{}{})
+}

+ 246 - 0
docs/docs.go

@@ -368,6 +368,100 @@ var doc = `{
                 }
             }
         },
+        "/Common/DeleteNewFuncmenu": {
+            "delete": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "通用服务"
+                ],
+                "summary": "删除菜单表数据",
+                "parameters": [
+                    {
+                        "description": "菜单表数据,只需要resourcecode字段即可",
+                        "name": "data",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.NewFuncmenulist"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Common/FindNewFuncmenu": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "通用服务"
+                ],
+                "summary": "获取菜单表数据",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "资源代码",
+                        "name": "resourcecode",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "上级资源代码",
+                        "name": "parentcode",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "资源名(Title), 模糊查询",
+                        "name": "resourcename",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Common/GetAllEnums": {
             "get": {
                 "description": "autoid传入后则返回这个ID之后的数据;如不传则返回所有",
@@ -554,6 +648,50 @@ var doc = `{
                 }
             }
         },
+        "/Common/InsertNewFuncmenu": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "通用服务"
+                ],
+                "summary": "插入菜单表数据",
+                "parameters": [
+                    {
+                        "description": "菜单表数据",
+                        "name": "data",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.NewFuncmenulist"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Common/NoticeReaded": {
             "post": {
                 "security": [
@@ -848,6 +986,50 @@ var doc = `{
                 }
             }
         },
+        "/Common/UpdateNewFuncmenu": {
+            "put": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "通用服务"
+                ],
+                "summary": "更新菜单表数据",
+                "parameters": [
+                    {
+                        "description": "菜单表数据",
+                        "name": "data",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.NewFuncmenulist"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Delivery/QueryDeliveryRelation": {
             "get": {
                 "security": [
@@ -31630,6 +31812,70 @@ var doc = `{
                 }
             }
         },
+        "models.NewFuncmenulist": {
+            "type": "object",
+            "required": [
+                "resourcecode"
+            ],
+            "properties": {
+                "authtype": {
+                    "description": "权限类型 - 1:菜单 2:组件 3:按钮",
+                    "type": "integer"
+                },
+                "buttontype": {
+                    "description": "按钮类型 - 存按钮样式",
+                    "type": "string"
+                },
+                "component": {
+                    "description": "组件名或组件地址",
+                    "type": "string"
+                },
+                "hidden": {
+                    "description": "是否隐藏 - 0:显示 1:隐藏",
+                    "type": "integer"
+                },
+                "iconame": {
+                    "description": "菜单图标",
+                    "type": "string"
+                },
+                "menutype": {
+                    "description": "菜单类型 - 1:管理端 2:PC(C#) 3:移动(云平台) 4:终端(交易所) 5:PC(云平台)",
+                    "type": "integer"
+                },
+                "parentcode": {
+                    "description": "上级资源代码",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "Remark",
+                    "type": "string"
+                },
+                "resourcecode": {
+                    "description": "资源代码",
+                    "type": "string"
+                },
+                "resourcelevel": {
+                    "description": "级别1-一级 2-二级 3-三级4-四级",
+                    "type": "integer"
+                },
+                "resourcename": {
+                    "description": "资源名(Title)",
+                    "type": "string"
+                },
+                "sort": {
+                    "description": "排序",
+                    "type": "integer"
+                },
+                "url": {
+                    "description": "Url",
+                    "type": "string"
+                },
+                "urltype": {
+                    "description": "地址类型 - 1:路由 2:外链 3:内联框架",
+                    "type": "integer"
+                }
+            }
+        },
         "models.OperationPrimaryMenu": {
             "type": "object",
             "properties": {

+ 246 - 0
docs/swagger.json

@@ -352,6 +352,100 @@
                 }
             }
         },
+        "/Common/DeleteNewFuncmenu": {
+            "delete": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "通用服务"
+                ],
+                "summary": "删除菜单表数据",
+                "parameters": [
+                    {
+                        "description": "菜单表数据,只需要resourcecode字段即可",
+                        "name": "data",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.NewFuncmenulist"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Common/FindNewFuncmenu": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "通用服务"
+                ],
+                "summary": "获取菜单表数据",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "资源代码",
+                        "name": "resourcecode",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "上级资源代码",
+                        "name": "parentcode",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "资源名(Title), 模糊查询",
+                        "name": "resourcename",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Common/GetAllEnums": {
             "get": {
                 "description": "autoid传入后则返回这个ID之后的数据;如不传则返回所有",
@@ -538,6 +632,50 @@
                 }
             }
         },
+        "/Common/InsertNewFuncmenu": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "通用服务"
+                ],
+                "summary": "插入菜单表数据",
+                "parameters": [
+                    {
+                        "description": "菜单表数据",
+                        "name": "data",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.NewFuncmenulist"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Common/NoticeReaded": {
             "post": {
                 "security": [
@@ -832,6 +970,50 @@
                 }
             }
         },
+        "/Common/UpdateNewFuncmenu": {
+            "put": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "通用服务"
+                ],
+                "summary": "更新菜单表数据",
+                "parameters": [
+                    {
+                        "description": "菜单表数据",
+                        "name": "data",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.NewFuncmenulist"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Delivery/QueryDeliveryRelation": {
             "get": {
                 "security": [
@@ -31614,6 +31796,70 @@
                 }
             }
         },
+        "models.NewFuncmenulist": {
+            "type": "object",
+            "required": [
+                "resourcecode"
+            ],
+            "properties": {
+                "authtype": {
+                    "description": "权限类型 - 1:菜单 2:组件 3:按钮",
+                    "type": "integer"
+                },
+                "buttontype": {
+                    "description": "按钮类型 - 存按钮样式",
+                    "type": "string"
+                },
+                "component": {
+                    "description": "组件名或组件地址",
+                    "type": "string"
+                },
+                "hidden": {
+                    "description": "是否隐藏 - 0:显示 1:隐藏",
+                    "type": "integer"
+                },
+                "iconame": {
+                    "description": "菜单图标",
+                    "type": "string"
+                },
+                "menutype": {
+                    "description": "菜单类型 - 1:管理端 2:PC(C#) 3:移动(云平台) 4:终端(交易所) 5:PC(云平台)",
+                    "type": "integer"
+                },
+                "parentcode": {
+                    "description": "上级资源代码",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "Remark",
+                    "type": "string"
+                },
+                "resourcecode": {
+                    "description": "资源代码",
+                    "type": "string"
+                },
+                "resourcelevel": {
+                    "description": "级别1-一级 2-二级 3-三级4-四级",
+                    "type": "integer"
+                },
+                "resourcename": {
+                    "description": "资源名(Title)",
+                    "type": "string"
+                },
+                "sort": {
+                    "description": "排序",
+                    "type": "integer"
+                },
+                "url": {
+                    "description": "Url",
+                    "type": "string"
+                },
+                "urltype": {
+                    "description": "地址类型 - 1:路由 2:外链 3:内联框架",
+                    "type": "integer"
+                }
+            }
+        },
         "models.OperationPrimaryMenu": {
             "type": "object",
             "properties": {

+ 159 - 0
docs/swagger.yaml

@@ -11814,6 +11814,53 @@ definitions:
     - coupontypeid
     - orderid
     type: object
+  models.NewFuncmenulist:
+    properties:
+      authtype:
+        description: 权限类型 - 1:菜单 2:组件 3:按钮
+        type: integer
+      buttontype:
+        description: 按钮类型 - 存按钮样式
+        type: string
+      component:
+        description: 组件名或组件地址
+        type: string
+      hidden:
+        description: 是否隐藏 - 0:显示 1:隐藏
+        type: integer
+      iconame:
+        description: 菜单图标
+        type: string
+      menutype:
+        description: 菜单类型 - 1:管理端 2:PC(C#) 3:移动(云平台) 4:终端(交易所) 5:PC(云平台)
+        type: integer
+      parentcode:
+        description: 上级资源代码
+        type: string
+      remark:
+        description: Remark
+        type: string
+      resourcecode:
+        description: 资源代码
+        type: string
+      resourcelevel:
+        description: 级别1-一级 2-二级 3-三级4-四级
+        type: integer
+      resourcename:
+        description: 资源名(Title)
+        type: string
+      sort:
+        description: 排序
+        type: integer
+      url:
+        description: Url
+        type: string
+      urltype:
+        description: 地址类型 - 1:路由 2:外链 3:内联框架
+        type: integer
+    required:
+    - resourcecode
+    type: object
   models.OperationPrimaryMenu:
     properties:
       Children:
@@ -22029,6 +22076,64 @@ paths:
       summary: 查询远期订单信息
       tags:
       - 产能预售
+  /Common/DeleteNewFuncmenu:
+    delete:
+      consumes:
+      - application/json
+      parameters:
+      - description: 菜单表数据,只需要resourcecode字段即可
+        in: body
+        name: data
+        required: true
+        schema:
+          $ref: '#/definitions/models.NewFuncmenulist'
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/app.Response'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 删除菜单表数据
+      tags:
+      - 通用服务
+  /Common/FindNewFuncmenu:
+    get:
+      parameters:
+      - description: 资源代码
+        in: query
+        name: resourcecode
+        type: string
+      - description: 上级资源代码
+        in: query
+        name: parentcode
+        type: string
+      - description: 资源名(Title), 模糊查询
+        in: query
+        name: resourcename
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/app.Response'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 获取菜单表数据
+      tags:
+      - 通用服务
   /Common/GetAllEnums:
     get:
       description: autoid传入后则返回这个ID之后的数据;如不传则返回所有
@@ -22147,6 +22252,33 @@ paths:
       summary: 获取服务器时间
       tags:
       - 通用服务
+  /Common/InsertNewFuncmenu:
+    post:
+      consumes:
+      - application/json
+      parameters:
+      - description: 菜单表数据
+        in: body
+        name: data
+        required: true
+        schema:
+          $ref: '#/definitions/models.NewFuncmenulist'
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/app.Response'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 插入菜单表数据
+      tags:
+      - 通用服务
   /Common/NoticeReaded:
     post:
       parameters:
@@ -22335,6 +22467,33 @@ paths:
       summary: 查询交易端菜单
       tags:
       - 通用服务
+  /Common/UpdateNewFuncmenu:
+    put:
+      consumes:
+      - application/json
+      parameters:
+      - description: 菜单表数据
+        in: body
+        name: data
+        required: true
+        schema:
+          $ref: '#/definitions/models.NewFuncmenulist'
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/app.Response'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 更新菜单表数据
+      tags:
+      - 通用服务
   /Delivery/QueryDeliveryRelation:
     get:
       parameters:

+ 63 - 0
models/common.go

@@ -968,3 +968,66 @@ func IsTrader(loginID int) (bool, error) {
 
 	return false, nil
 }
+
+// NewFuncmenulist 功能菜单表
+type NewFuncmenulist struct {
+	RESOURCECODE  *string `json:"resourcecode"  xorm:"RESOURCECODE" binding:"required"` // 资源代码
+	RESOURCENAME  *string `json:"resourcename"  xorm:"RESOURCENAME"`                    // 资源名(Title)
+	RESOURCELEVEL *int32  `json:"resourcelevel"  xorm:"RESOURCELEVEL"`                  // 级别1-一级 2-二级 3-三级4-四级
+	MENUTYPE      *int32  `json:"menutype"  xorm:"MENUTYPE"`                            // 菜单类型 - 1:管理端 2:PC(C#) 3:移动(云平台) 4:终端(交易所) 5:PC(云平台)
+	PARENTCODE    *string `json:"parentcode"  xorm:"PARENTCODE"`                        // 上级资源代码
+	URL           *string `json:"url"  xorm:"URL"`                                      // Url
+	SORT          *int32  `json:"sort"  xorm:"SORT"`                                    // 排序
+	ICONAME       *string `json:"iconame"  xorm:"ICONAME"`                              // 菜单图标
+	REMARK        *string `json:"remark"  xorm:"REMARK"`                                // Remark
+	AUTHTYPE      *int32  `json:"authtype"  xorm:"AUTHTYPE"`                            // 权限类型 - 1:菜单 2:组件 3:按钮
+	URLTYPE       *int32  `json:"urltype"  xorm:"URLTYPE"`                              // 地址类型 - 1:路由 2:外链 3:内联框架
+	COMPONENT     *string `json:"component"  xorm:"COMPONENT"`                          // 组件名或组件地址
+	BUTTONTYPE    *string `json:"buttontype"  xorm:"BUTTONTYPE"`                        // 按钮类型 - 存按钮样式
+	HIDDEN        *int32  `json:"hidden"  xorm:"HIDDEN"`                                // 是否隐藏 - 0:显示 1:隐藏
+}
+
+type NewFuncmenulistReq struct {
+	RESOURCECODE string `form:"resourcecode"` // 资源代码
+	PARENTCODE   string `form:"parentcode"`   // 上级资源代码
+	RESOURCENAME string `form:"resourcename"` // 资源名(Title), 模糊查询
+}
+
+// TableName is FUNCMENULIST
+func (r *NewFuncmenulist) TableName() string {
+	return "FUNCMENULIST"
+}
+
+func (r *NewFuncmenulist) Find(req NewFuncmenulistReq) ([]NewFuncmenulist, error) {
+	funcMenuLists := make([]NewFuncmenulist, 0)
+	session := db.GetEngine().Table("FUNCMENULIST T").Where("T.MENUTYPE = 5")
+	if len(req.RESOURCECODE) != 0 {
+		session = session.And("T.RESOURCECODE = ?", req.RESOURCECODE)
+	}
+	if len(req.PARENTCODE) != 0 {
+		session = session.And("T.PARENTCODE = ?", req.PARENTCODE)
+	}
+	if len(req.RESOURCENAME) != 0 {
+		session = session.And("T.RESOURCENAME LIKE ?", "%"+req.RESOURCENAME+"%")
+	}
+	if err := session.Find(&funcMenuLists); err != nil {
+		return nil, err
+	}
+
+	return funcMenuLists, nil
+}
+
+func (r *NewFuncmenulist) Insert() error {
+	_, err := db.GetEngine().Insert(r)
+	return err
+}
+
+func (r *NewFuncmenulist) Update() error {
+	_, err := db.GetEngine().Where("RESOURCECODE = ?", r.RESOURCECODE).Update(r)
+	return err
+}
+
+func (r *NewFuncmenulist) Delete() error {
+	_, err := db.GetEngine().Where("RESOURCECODE = ?", r.RESOURCECODE).Delete(r)
+	return err
+}

+ 5 - 0
routers/router.go

@@ -136,6 +136,11 @@ func InitRouter() *gin.Engine {
 		commonR.Use(token.Auth()).GET("/GetClientMenus", common.GetClientMenus)
 		// 获取PCWeb交易端菜单(V6版本之后使用)
 		commonR.Use(token.Auth()).GET("/GetPCWebMenus", common.GetPCWebMenus)
+
+		commonR.Use(token.Auth()).GET("/FindNewFuncmenu", common.FindNewFuncmenu)
+		commonR.Use(token.Auth()).POST("/InsertNewFuncmenu", common.InsertNewFuncmenu)
+		commonR.Use(token.Auth()).PUT("/UpdateNewFuncmenu", common.UpdateNewFuncmenu)
+		commonR.Use(token.Auth()).DELETE("/DeleteNewFuncmenu", common.DeleteNewFuncmenu)
 	}
 	// ************************ 通用市场 ************************
 	marketR := apiR.Group("Market")