/** * @Author: zou.yingbin * @Create : 2021/1/18 9:26 * @Modify : 2021/1/18 9:26 */ package ermcp import ( "github.com/gin-gonic/gin" "mtp2_if/global/app" "mtp2_if/global/e" "mtp2_if/logger" "mtp2_if/models" "net/http" ) //敞口相关查询 //实时敞口查询请求 type RealtimeExposureReq struct { AreaUserID uint32 `form:"AreaUserID" binding:"required"` //所属机构ID } //实时敞口查询应答 type RealtimeExposureRsp models.ErmcpRealExposureModel // QueryUserInfo 查询实时敞口 // @Summary 查询实时敞口 // @Produce json // @Security ApiKeyAuth // @Param AreaUserID query int true "所属机构ID" // @Success 200 {array} RealtimeExposureRsp // @Failure 500 {object} app.Response // @Router /Ermcp/QueryRealtimeExposure [get] // @Tags 企业风险管理(app) func QueryRealtimeExposure(c *gin.Context) { appG := app.Gin{C: c} var req RealtimeExposureReq if err := c.ShouldBind(&req); err != nil{ logger.GetLogger().Errorf("QueryRealtimeExposure fail, %v", err) appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil) return } m := models.ErmcpRealExposureModel{AreaUserID: req.AreaUserID} if d, err := m.GetData(); err == nil{ appG.Response(http.StatusOK, e.SUCCESS, d) }else{ appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil) } }