qryAccMgr.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /**
  2. * @Author: zou.yingbin
  3. * @Create : 2021/3/30 13:37
  4. * @Modify : 2021/3/30 13:37
  5. * @Note : 账户管理
  6. **/
  7. package ermcp
  8. import (
  9. "github.com/gin-gonic/gin"
  10. "mtp2_if/global/app"
  11. "mtp2_if/models"
  12. )
  13. // QryLoginUserReq
  14. type QryLoginUserReq struct {
  15. UserId int64 `form:"userid" binding:"required"` // 用户id
  16. QueryType int32 `form:"querytype" binding:"required"` // 查询类型 1-业务账户 2-交易账户 3-管理账户
  17. }
  18. // QueryAccMgrLoginUser
  19. // @Summary 查询账户管理登录账号(账户管理/登录账号)
  20. // @Produce json
  21. // @Security ApiKeyAuth
  22. // @Param userid query int true "用户ID"
  23. // @Param querytype query int true "查询类型 1-业务账户 2-交易账户 3-管理账户"
  24. // @Success 200 {array} models.ErmcpLoginUserEx
  25. // @Failure 500 {object} app.Response
  26. // @Router /Ermcp/QueryAccMgrLoginUser [get]
  27. // @Tags 企业风险管理(app)
  28. func QueryAccMgrLoginUser(c *gin.Context) {
  29. a := app.GinUtils{Gin: app.Gin{C: c}}
  30. req := QryLoginUserReq{}
  31. a.DoBindReq(&req)
  32. m := models.ErmcpLoginUser{MEMBERUSERID: req.UserId, USERID: req.UserId, QueryType: req.QueryType}
  33. a.DoGetDataI(&m)
  34. }
  35. // QueryAccMgrTaaccount
  36. // @Summary 查询账户管理期货账号(账户管理/期货账号)
  37. // @Produce json
  38. // @Security ApiKeyAuth
  39. // @Param userid query int true "用户ID"
  40. // @Success 200 {array} models.ErmcpTaAccountEx
  41. // @Failure 500 {object} app.Response
  42. // @Router /Ermcp/QueryAccMgrTaaccount [get]
  43. // @Tags 企业风险管理(app)
  44. func QueryAccMgrTaaccount(c *gin.Context) {
  45. a := app.GinUtils{Gin: app.Gin{C: c}}
  46. req := struct {
  47. UserId int64 `form:"userid" binding:"required"` // 用户id
  48. }{}
  49. a.DoBindReq(&req)
  50. m := models.ErmcpTaAccount{USERID: req.UserId}
  51. a.DoGetDataI(&m)
  52. }
  53. // QueryAccountReq 查主账号请求
  54. type QueryAccountReq struct {
  55. UserId int64 `form:"userid"` // 用户id
  56. AccountId string `form:"accountid"` // 主账号id
  57. }
  58. // QueryAccMgrMainAccountInfo
  59. // @Summary 查询账户管理主账号详情(账户管理/期货主账号详情)
  60. // @Produce json
  61. // @Security ApiKeyAuth
  62. // @Param userid query int false "用户ID"
  63. // @Param accountid query int false "主账号id"
  64. // @Success 200 {array} models.MainAccountInfo
  65. // @Failure 500 {object} app.Response
  66. // @Router /Ermcp/QueryAccMgrMainAccountInfo [get]
  67. // @Tags 企业风险管理(app)
  68. func QueryAccMgrMainAccountInfo(c *gin.Context) {
  69. a := app.GinUtils{Gin: app.Gin{C: c}}
  70. req := QueryAccountReq{}
  71. a.DoBindReq(&req)
  72. m := models.MainAccountInfo{RELATEDUSERID: req.UserId, ACCOUNTID: req.AccountId}
  73. a.DoGetDataI(&m)
  74. }
  75. // QueryAccMgrRole
  76. // @Summary 查询账户管理角色设置(账户管理/角色设置)
  77. // @Produce json
  78. // @Security ApiKeyAuth
  79. // @Param userid query int true "用户ID"
  80. // @Success 200 {array} models.ErmcpRole
  81. // @Failure 500 {object} app.Response
  82. // @Router /Ermcp/QueryAccMgrRole [get]
  83. // @Tags 企业风险管理(app)
  84. func QueryAccMgrRole(c *gin.Context) {
  85. a := app.GinUtils{Gin: app.Gin{C: c}}
  86. req := struct {
  87. UserId int64 `form:"userid" binding:"required"` // 用户id
  88. }{}
  89. a.DoBindReq(&req)
  90. m := models.ErmcpRole{AREAUSERID: req.UserId}
  91. a.DoGetDataI(&m)
  92. }
  93. // QryRoleMenuReq
  94. type QryRoleMenuReq struct {
  95. UserId int64 `form:"userid" binding:"required"` // 用户id
  96. RoleId string `form:"roleid"` // 角色id(可多个,逗号隔开)
  97. }
  98. // QueryAccMgrRoleMenu
  99. // @Summary 查询账户管理角色详情(账户管理/角色设置/角色详情)
  100. // @Produce json
  101. // @Security ApiKeyAuth
  102. // @Param userid query int true "用户ID"
  103. // @Param roleid query string false "角色id(可多个,逗号隔开)"
  104. // @Success 200 {array} models.ErmcpRoleMenuEx
  105. // @Failure 500 {object} app.Response
  106. // @Router /Ermcp/QueryAccMgrRoleMenu [get]
  107. // @Tags 企业风险管理(app)
  108. func QueryAccMgrRoleMenu(c *gin.Context) {
  109. a := app.GinUtils{Gin: app.Gin{C: c}}
  110. req := QryRoleMenuReq{}
  111. a.DoBindReq(&req)
  112. m := models.ErmcpRoleMenu{USERID: req.UserId, FilterRoleId: req.RoleId}
  113. a.DoGetDataI(&m)
  114. }
  115. // QueryAccMgrBizGroupSet
  116. // @Summary 查询业务类型分组(账户管理/账户设置)
  117. // @Produce json
  118. // @Security ApiKeyAuth
  119. // @Param userid query int true "用户ID"
  120. // @Param deliverygoodsid query int false "现货商品id"
  121. // @Success 200 {array} models.ErmcpBizGroupEx
  122. // @Failure 500 {object} app.Response
  123. // @Router /Ermcp/QueryAccMgrBizGroupSet [get]
  124. // @Tags 企业风险管理(app)
  125. func QueryAccMgrBizGroupSet(c *gin.Context) {
  126. a := app.GinUtils{Gin: app.Gin{C: c}}
  127. req := struct {
  128. USERID int64 `form:"userid" binding:"required"` // 用户id
  129. DELIVERYGOODSID int32 `form:"deliverygoodsid"` // 现货商品id
  130. }{}
  131. a.DoBindReq(&req)
  132. m := models.ErmcpBizGroupEx{AREAUSERID: req.USERID, DELIVERYGOODSID: req.DELIVERYGOODSID}
  133. a.DoGetDataI(&m)
  134. }
  135. // QryTaAccountReq 查询资金账号
  136. type QryTaAccountReq struct {
  137. UserId int64 `form:"userid"` // 用户id
  138. AccountId int64 `form:"accountid"` // 账号id
  139. }
  140. // QueryAccMgrTaAccountInfo
  141. // @Summary 查询账户管理授信(账户管理/账户设置/授信)
  142. // @Produce json
  143. // @Security ApiKeyAuth
  144. // @Param userid query int true "用户ID"
  145. // @Param accountid query int false "账号id"
  146. // @Success 200 {array} models.ErmcpTaAccountInfo
  147. // @Failure 500 {object} app.Response
  148. // @Router /Ermcp/QueryAccMgrTaAccountInfo [get]
  149. // @Tags 企业风险管理(app)
  150. func QueryAccMgrTaAccountInfo(c *gin.Context) {
  151. a := app.GinUtils{Gin: app.Gin{C: c}}
  152. req := QryTaAccountReq{}
  153. a.DoBindReq(&req)
  154. m := models.ErmcpTaAccountInfo{RELATEDUSERID: req.UserId, ACCOUNTID: req.AccountId}
  155. a.DoGetDataI(&m)
  156. }