Browse Source

#7100 【Go查询】添加接口"用户积分明细查询": /User/QueryUserScoreDetail, 按到期日顺序

deng.yinping 3 tháng trước cách đây
mục cha
commit
68856263d6
6 tập tin đã thay đổi với 252 bổ sung252 xóa
  1. 2 2
      controllers/user/user.go
  2. 88 88
      docs/docs.go
  3. 88 88
      docs/swagger.json
  4. 65 65
      docs/swagger.yaml
  5. 5 5
      models/common.go
  6. 4 4
      models/ori.go

+ 2 - 2
controllers/user/user.go

@@ -769,7 +769,7 @@ type QueryUserScoreReq struct {
 // @Produce  json
 // @Security ApiKeyAuth
 // @Param    userID query    int true "用户ID"
-// @Success  200       {object} models.QuerUserScoreRsp
+// @Success  200       {object} models.QueryUserScoreRsp
 // @Failure  500    {object} app.Response
 // @Router   /User/QueryUserScore [get]
 // @Tags     用户信息
@@ -801,7 +801,7 @@ func QueryUserScore(c *gin.Context) {
 // @Produce  json
 // @Security ApiKeyAuth
 // @Param    userID query    int true "用户ID"
-// @Success  200       {object} models.QuerUserScoreDetailRsp
+// @Success  200       {object} models.QueryUserScoreDetailRsp
 // @Failure  500    {object} app.Response
 // @Router   /User/QueryUserScoreDetail [get]
 // @Tags     用户信息

+ 88 - 88
docs/docs.go

@@ -20588,7 +20588,7 @@ const docTemplate = `{
                     "200": {
                         "description": "OK",
                         "schema": {
-                            "$ref": "#/definitions/models.QuerUserScoreRsp"
+                            "$ref": "#/definitions/models.QueryUserScoreRsp"
                         }
                     },
                     "500": {
@@ -20627,7 +20627,7 @@ const docTemplate = `{
                     "200": {
                         "description": "OK",
                         "schema": {
-                            "$ref": "#/definitions/models.QuerUserScoreDetailRsp"
+                            "$ref": "#/definitions/models.QueryUserScoreDetailRsp"
                         }
                     },
                     "500": {
@@ -52883,92 +52883,6 @@ const docTemplate = `{
                 }
             }
         },
-        "models.QuerUserScoreDetailRsp": {
-            "type": "object",
-            "properties": {
-                "createdtime": {
-                    "description": "创建时间",
-                    "type": "string"
-                },
-                "detailid": {
-                    "description": "明细单号",
-                    "type": "integer"
-                },
-                "expiredate": {
-                    "description": "到期日期",
-                    "type": "string"
-                },
-                "remainscore": {
-                    "description": "剩余积分",
-                    "type": "integer"
-                },
-                "score": {
-                    "description": "积分",
-                    "type": "integer"
-                },
-                "scoretypeid": {
-                    "description": "积分类型ID",
-                    "type": "integer"
-                },
-                "scoretypename": {
-                    "description": "积分类型名称",
-                    "type": "string"
-                },
-                "tradedate": {
-                    "description": "交易日",
-                    "type": "integer"
-                },
-                "userid": {
-                    "description": "用户ID",
-                    "type": "integer"
-                },
-                "validtype": {
-                    "description": "有效类型(枚举'ValidType')",
-                    "type": "integer"
-                }
-            }
-        },
-        "models.QuerUserScoreRsp": {
-            "type": "object",
-            "properties": {
-                "curscore": {
-                    "description": "期末积分",
-                    "type": "integer"
-                },
-                "freezescore": {
-                    "description": "冻结积分",
-                    "type": "integer"
-                },
-                "oriscore": {
-                    "description": "期初积分",
-                    "type": "integer"
-                },
-                "scoretypeid": {
-                    "description": "积分类型ID",
-                    "type": "integer"
-                },
-                "scoretypename": {
-                    "description": "积分类型名称",
-                    "type": "string"
-                },
-                "todaydecrease": {
-                    "description": "今日减少",
-                    "type": "integer"
-                },
-                "todayincrease": {
-                    "description": "今日增加",
-                    "type": "integer"
-                },
-                "userid": {
-                    "description": "用户ID",
-                    "type": "integer"
-                },
-                "withholdsocre": {
-                    "description": "代扣积分[积分服务商]",
-                    "type": "integer"
-                }
-            }
-        },
         "models.QueryErrorInfosRsp": {
             "type": "object",
             "required": [
@@ -53501,6 +53415,92 @@ const docTemplate = `{
                 }
             }
         },
+        "models.QueryUserScoreDetailRsp": {
+            "type": "object",
+            "properties": {
+                "createdtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "detailid": {
+                    "description": "明细单号",
+                    "type": "string"
+                },
+                "expiredate": {
+                    "description": "到期日期",
+                    "type": "string"
+                },
+                "remainscore": {
+                    "description": "剩余积分",
+                    "type": "integer"
+                },
+                "score": {
+                    "description": "积分",
+                    "type": "integer"
+                },
+                "scoretypeid": {
+                    "description": "积分类型ID",
+                    "type": "integer"
+                },
+                "scoretypename": {
+                    "description": "积分类型名称",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日",
+                    "type": "integer"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "validtype": {
+                    "description": "有效类型(枚举'ValidType')",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.QueryUserScoreRsp": {
+            "type": "object",
+            "properties": {
+                "curscore": {
+                    "description": "期末积分",
+                    "type": "integer"
+                },
+                "freezescore": {
+                    "description": "冻结积分",
+                    "type": "integer"
+                },
+                "oriscore": {
+                    "description": "期初积分",
+                    "type": "integer"
+                },
+                "scoretypeid": {
+                    "description": "积分类型ID",
+                    "type": "integer"
+                },
+                "scoretypename": {
+                    "description": "积分类型名称",
+                    "type": "string"
+                },
+                "todaydecrease": {
+                    "description": "今日减少",
+                    "type": "integer"
+                },
+                "todayincrease": {
+                    "description": "今日增加",
+                    "type": "integer"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "withholdsocre": {
+                    "description": "代扣积分[积分服务商]",
+                    "type": "integer"
+                }
+            }
+        },
         "models.QuotePrimaryMenu": {
             "type": "object",
             "properties": {

+ 88 - 88
docs/swagger.json

@@ -20579,7 +20579,7 @@
                     "200": {
                         "description": "OK",
                         "schema": {
-                            "$ref": "#/definitions/models.QuerUserScoreRsp"
+                            "$ref": "#/definitions/models.QueryUserScoreRsp"
                         }
                     },
                     "500": {
@@ -20618,7 +20618,7 @@
                     "200": {
                         "description": "OK",
                         "schema": {
-                            "$ref": "#/definitions/models.QuerUserScoreDetailRsp"
+                            "$ref": "#/definitions/models.QueryUserScoreDetailRsp"
                         }
                     },
                     "500": {
@@ -52874,92 +52874,6 @@
                 }
             }
         },
-        "models.QuerUserScoreDetailRsp": {
-            "type": "object",
-            "properties": {
-                "createdtime": {
-                    "description": "创建时间",
-                    "type": "string"
-                },
-                "detailid": {
-                    "description": "明细单号",
-                    "type": "integer"
-                },
-                "expiredate": {
-                    "description": "到期日期",
-                    "type": "string"
-                },
-                "remainscore": {
-                    "description": "剩余积分",
-                    "type": "integer"
-                },
-                "score": {
-                    "description": "积分",
-                    "type": "integer"
-                },
-                "scoretypeid": {
-                    "description": "积分类型ID",
-                    "type": "integer"
-                },
-                "scoretypename": {
-                    "description": "积分类型名称",
-                    "type": "string"
-                },
-                "tradedate": {
-                    "description": "交易日",
-                    "type": "integer"
-                },
-                "userid": {
-                    "description": "用户ID",
-                    "type": "integer"
-                },
-                "validtype": {
-                    "description": "有效类型(枚举'ValidType')",
-                    "type": "integer"
-                }
-            }
-        },
-        "models.QuerUserScoreRsp": {
-            "type": "object",
-            "properties": {
-                "curscore": {
-                    "description": "期末积分",
-                    "type": "integer"
-                },
-                "freezescore": {
-                    "description": "冻结积分",
-                    "type": "integer"
-                },
-                "oriscore": {
-                    "description": "期初积分",
-                    "type": "integer"
-                },
-                "scoretypeid": {
-                    "description": "积分类型ID",
-                    "type": "integer"
-                },
-                "scoretypename": {
-                    "description": "积分类型名称",
-                    "type": "string"
-                },
-                "todaydecrease": {
-                    "description": "今日减少",
-                    "type": "integer"
-                },
-                "todayincrease": {
-                    "description": "今日增加",
-                    "type": "integer"
-                },
-                "userid": {
-                    "description": "用户ID",
-                    "type": "integer"
-                },
-                "withholdsocre": {
-                    "description": "代扣积分[积分服务商]",
-                    "type": "integer"
-                }
-            }
-        },
         "models.QueryErrorInfosRsp": {
             "type": "object",
             "required": [
@@ -53492,6 +53406,92 @@
                 }
             }
         },
+        "models.QueryUserScoreDetailRsp": {
+            "type": "object",
+            "properties": {
+                "createdtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "detailid": {
+                    "description": "明细单号",
+                    "type": "string"
+                },
+                "expiredate": {
+                    "description": "到期日期",
+                    "type": "string"
+                },
+                "remainscore": {
+                    "description": "剩余积分",
+                    "type": "integer"
+                },
+                "score": {
+                    "description": "积分",
+                    "type": "integer"
+                },
+                "scoretypeid": {
+                    "description": "积分类型ID",
+                    "type": "integer"
+                },
+                "scoretypename": {
+                    "description": "积分类型名称",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日",
+                    "type": "integer"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "validtype": {
+                    "description": "有效类型(枚举'ValidType')",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.QueryUserScoreRsp": {
+            "type": "object",
+            "properties": {
+                "curscore": {
+                    "description": "期末积分",
+                    "type": "integer"
+                },
+                "freezescore": {
+                    "description": "冻结积分",
+                    "type": "integer"
+                },
+                "oriscore": {
+                    "description": "期初积分",
+                    "type": "integer"
+                },
+                "scoretypeid": {
+                    "description": "积分类型ID",
+                    "type": "integer"
+                },
+                "scoretypename": {
+                    "description": "积分类型名称",
+                    "type": "string"
+                },
+                "todaydecrease": {
+                    "description": "今日减少",
+                    "type": "integer"
+                },
+                "todayincrease": {
+                    "description": "今日增加",
+                    "type": "integer"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "withholdsocre": {
+                    "description": "代扣积分[积分服务商]",
+                    "type": "integer"
+                }
+            }
+        },
         "models.QuotePrimaryMenu": {
             "type": "object",
             "properties": {

+ 65 - 65
docs/swagger.yaml

@@ -21228,69 +21228,6 @@ definitions:
         description: 现货商品ID
         type: integer
     type: object
-  models.QuerUserScoreDetailRsp:
-    properties:
-      createdtime:
-        description: 创建时间
-        type: string
-      detailid:
-        description: 明细单号
-        type: integer
-      expiredate:
-        description: 到期日期
-        type: string
-      remainscore:
-        description: 剩余积分
-        type: integer
-      score:
-        description: 积分
-        type: integer
-      scoretypeid:
-        description: 积分类型ID
-        type: integer
-      scoretypename:
-        description: 积分类型名称
-        type: string
-      tradedate:
-        description: 交易日
-        type: integer
-      userid:
-        description: 用户ID
-        type: integer
-      validtype:
-        description: 有效类型(枚举'ValidType')
-        type: integer
-    type: object
-  models.QuerUserScoreRsp:
-    properties:
-      curscore:
-        description: 期末积分
-        type: integer
-      freezescore:
-        description: 冻结积分
-        type: integer
-      oriscore:
-        description: 期初积分
-        type: integer
-      scoretypeid:
-        description: 积分类型ID
-        type: integer
-      scoretypename:
-        description: 积分类型名称
-        type: string
-      todaydecrease:
-        description: 今日减少
-        type: integer
-      todayincrease:
-        description: 今日增加
-        type: integer
-      userid:
-        description: 用户ID
-        type: integer
-      withholdsocre:
-        description: 代扣积分[积分服务商]
-        type: integer
-    type: object
   models.QueryErrorInfosRsp:
     properties:
       description:
@@ -21687,6 +21624,69 @@ definitions:
         description: 用户ID(默认为0, 核心为为机构用户ID)
         type: integer
     type: object
+  models.QueryUserScoreDetailRsp:
+    properties:
+      createdtime:
+        description: 创建时间
+        type: string
+      detailid:
+        description: 明细单号
+        type: string
+      expiredate:
+        description: 到期日期
+        type: string
+      remainscore:
+        description: 剩余积分
+        type: integer
+      score:
+        description: 积分
+        type: integer
+      scoretypeid:
+        description: 积分类型ID
+        type: integer
+      scoretypename:
+        description: 积分类型名称
+        type: string
+      tradedate:
+        description: 交易日
+        type: integer
+      userid:
+        description: 用户ID
+        type: integer
+      validtype:
+        description: 有效类型(枚举'ValidType')
+        type: integer
+    type: object
+  models.QueryUserScoreRsp:
+    properties:
+      curscore:
+        description: 期末积分
+        type: integer
+      freezescore:
+        description: 冻结积分
+        type: integer
+      oriscore:
+        description: 期初积分
+        type: integer
+      scoretypeid:
+        description: 积分类型ID
+        type: integer
+      scoretypename:
+        description: 积分类型名称
+        type: string
+      todaydecrease:
+        description: 今日减少
+        type: integer
+      todayincrease:
+        description: 今日增加
+        type: integer
+      userid:
+        description: 用户ID
+        type: integer
+      withholdsocre:
+        description: 代扣积分[积分服务商]
+        type: integer
+    type: object
   models.QuotePrimaryMenu:
     properties:
       Index:
@@ -45364,7 +45364,7 @@ paths:
         "200":
           description: OK
           schema:
-            $ref: '#/definitions/models.QuerUserScoreRsp'
+            $ref: '#/definitions/models.QueryUserScoreRsp'
         "500":
           description: Internal Server Error
           schema:
@@ -45388,7 +45388,7 @@ paths:
         "200":
           description: OK
           schema:
-            $ref: '#/definitions/models.QuerUserScoreDetailRsp'
+            $ref: '#/definitions/models.QueryUserScoreDetailRsp'
         "500":
           description: Internal Server Error
           schema:

+ 5 - 5
models/common.go

@@ -1630,9 +1630,9 @@ func GetClientDocumnetConfigs() (datas []ClientDocumentConfig, err error) {
 	return
 }
 
-func GetUserScore(userID int) (datas []QuerUserScoreRsp, err error) {
+func GetUserScore(userID int) (datas []QueryUserScoreRsp, err error) {
 	engine := db.GetEngine()
-	rspdatas := make([]QuerUserScoreRsp, 0)
+	rspdatas := make([]QueryUserScoreRsp, 0)
 	if err := engine.Table("USERSCORE T").
 		Join("LEFT", "SCORETYPE ST", `T.SCORETYPEID = ST.SCORETYPEID`).
 		Select("T.*, ST.SCORETYPENAME AS SCORETYPENAME").
@@ -1643,12 +1643,12 @@ func GetUserScore(userID int) (datas []QuerUserScoreRsp, err error) {
 	return rspdatas, nil
 }
 
-func GetUserScoreDetail(userID int) (datas []QuerUserScoreDetailRsp, err error) {
+func GetUserScoreDetail(userID int) (datas []QueryUserScoreDetailRsp, err error) {
 	engine := db.GetEngine()
-	rspdatas := make([]QuerUserScoreDetailRsp, 0)
+	rspdatas := make([]QueryUserScoreDetailRsp, 0)
 	if err := engine.Table("USERSCOREDETAIL T").
 		Join("LEFT", "SCORETYPE ST", `T.SCORETYPEID = ST.SCORETYPEID`).
-		Select("T.DETAILID, T.TRADEDATE, T.USERID, T.SCORETYPEID, T.SCORE, T.REMAINSCORE, "+
+		Select("TO_CHAR(T.DETAILID) DETAILID, T.TRADEDATE, T.USERID, T.SCORETYPEID, T.SCORE, T.REMAINSCORE, "+
 			"T.VALIDTYPE, CASE WHEN T.VALIDTYPE = 1 OR T.VALIDTYPE = 3 THEN T.EXPIREDATE ELSE '-' END AS EXPIREDATE, "+
 			"TO_CHAR(T.CREATETIME, 'YYYY-MM-DD HH24:MI:SS') CREATETIME, ST.SCORETYPENAME AS SCORETYPENAME").
 		Where("T.USERID = ?", userID).

+ 4 - 4
models/ori.go

@@ -1399,7 +1399,7 @@ func (r *Hybridamtrec) TableName() string {
 }
 
 // QuerUserScoreRsp 用户积分查询返回请求
-type QuerUserScoreRsp struct {
+type QueryUserScoreRsp struct {
 	USERID        int64 `json:"userid" xorm:"USERID"`               // 用户ID
 	SCORETYPEID   int32 `json:"scoretypeid" xorm:"SCORETYPEID"`     // 积分类型ID
 	ORISCORE      int32 `json:"oriscore" xorm:"ORISCORE"`           // 期初积分
@@ -1412,9 +1412,9 @@ type QuerUserScoreRsp struct {
 	SCORETYPENAME string `json:"scoretypename" xorm:"SCORETYPENAME"` // 积分类型名称
 }
 
-// QuerUserScoreDetailRsp 用户积分明细查询返回请求
-type QuerUserScoreDetailRsp struct {
-	DETAILID    int64  `json:"detailid" xorm:"DETAILID"`       // 明细单号
+// QueryUserScoreDetailRsp 用户积分明细查询返回请求
+type QueryUserScoreDetailRsp struct {
+	DETAILID    string `json:"detailid" xorm:"DETAILID"`       // 明细单号
 	TRADEDATE   int64  `json:"tradedate" xorm:"TRADEDATE"`     // 交易日
 	USERID      int64  `json:"userid" xorm:"USERID"`           // 用户ID
 	SCORETYPEID int32  `json:"scoretypeid" xorm:"SCORETYPEID"` // 积分类型ID