Explorar el Código

增加查询新品发布接口(增加条数限制)

zou.yingbin hace 3 años
padre
commit
8c97dcf4fd

+ 1 - 0
controllers/wrTrade2/qryWrTrade.go

@@ -725,6 +725,7 @@ func QuerySpotGroupTradeSumDetail(c *gin.Context) {
 // @param marketid query int false "市场id"
 // @param presalestatus query string false "预售状态(逗号隔开,如1,2,3)  1:未开始 2:进行中 3:已结束 4:已关闭"
 // @param lotteryflag query int false "摇号标识 - 0:未摇号 1:已摇号"
+// @param lastnum query int false "最近多少条记录(按创建时间排序)"
 // @Success 200 {array} models.WrSpotGroupTradeSumDetail
 // @Failure 500 {object} app.Response
 // @Router /WrTrade2/QueryWrPreSaleInfo [get]

+ 0 - 6
controllers/wrtrade/wrTrade.go

@@ -14,12 +14,6 @@ import (
 )
 
 // GetAllDeliveryGoods 获取带仓单分类的种类信息
-// @Summary 获取带仓单分类的种类信息
-// @Produce json
-// @Security ApiKeyAuth
-// @Success 200 {object} app.Response
-// @Failure 500 {object} app.Response
-// @Router /WRTrade/GetAllDeliveryGoods [get]
 // @Tags 仓单贸易
 // @Summary 获取带仓单分类的种类信息
 // @Produce json

+ 6 - 4
docs/docs.go

@@ -11994,13 +11994,9 @@ var doc = `{
                 "security": [
                     {
                         "ApiKeyAuth": []
-                    },
-                    {
-                        "ApiKeyAuth": []
                     }
                 ],
                 "produces": [
-                    "application/json",
                     "application/json"
                 ],
                 "tags": [
@@ -13649,6 +13645,12 @@ var doc = `{
                         "description": "摇号标识 - 0:未摇号 1:已摇号",
                         "name": "lotteryflag",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "最近多少条记录(按创建时间排序)",
+                        "name": "lastnum",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 6 - 4
docs/swagger.json

@@ -11979,13 +11979,9 @@
                 "security": [
                     {
                         "ApiKeyAuth": []
-                    },
-                    {
-                        "ApiKeyAuth": []
                     }
                 ],
                 "produces": [
-                    "application/json",
                     "application/json"
                 ],
                 "tags": [
@@ -13634,6 +13630,12 @@
                         "description": "摇号标识 - 0:未摇号 1:已摇号",
                         "name": "lotteryflag",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "最近多少条记录(按创建时间排序)",
+                        "name": "lastnum",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 4 - 2
docs/swagger.yaml

@@ -26921,7 +26921,6 @@ paths:
     get:
       produces:
       - application/json
-      - application/json
       responses:
         "200":
           description: OK
@@ -26933,7 +26932,6 @@ paths:
             $ref: '#/definitions/app.Response'
       security:
       - ApiKeyAuth: []
-      - ApiKeyAuth: []
       summary: 获取带仓单分类的种类信息
       tags:
       - 仓单贸易
@@ -27967,6 +27965,10 @@ paths:
         in: query
         name: lotteryflag
         type: integer
+      - description: 最近多少条记录(按创建时间排序)
+        in: query
+        name: lastnum
+        type: integer
       produces:
       - application/json
       responses:

+ 6 - 0
models/wrTrade2.go

@@ -4498,6 +4498,7 @@ type WrPreSaleInfo struct {
 	USERNAME           string  `json:"username"  xorm:"'USERNAME'"`                                    // 发行方用户名称
 	ENUMDICNAME        string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`                              // 单位名称
 
+	LastNum      int    `json:"-" form:"lastnum"`       // 最近多少条记录
 	FilterStatus string `json:"-" form:"presalestatus"` // 预售状态(逗号隔开,如1,2,3)  1:未开始 2:进行中 3:已结束 4:已关闭
 }
 
@@ -4550,6 +4551,11 @@ SELECT t.PRESALEAPPLYID,
 	sqlId.AndEx("t.LOTTERYFLAG", r.LOTTERYFLAG, r.LOTTERYFLAG >= 0)
 	sqlId.JoinEx(r.FilterStatus != "", fmt.Sprintf(" and t.PRESALESTATUS in(%s)", r.FilterStatus))
 	sqlId.Join(" order by t.createtime desc")
+
+	if r.LastNum > 0 {
+		sqlId.Page(1, r.LastNum)
+	}
+
 	return sqlId.String()
 }