qryOPLog.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @Author: zou.yingbin
  3. * @Create : 2021/1/14 11:43
  4. * @Modify : 2021/1/14 11:43
  5. */
  6. package ermcp
  7. import (
  8. "github.com/gin-gonic/gin"
  9. "mtp2_if/global/app"
  10. "mtp2_if/global/e"
  11. "mtp2_if/models"
  12. "net/http"
  13. )
  14. // 查询变更记录请求
  15. type QryOPLogReq struct {
  16. RelatedId string `form:"RelatedId" binding:"required"` // 现货合同ID\套保计划
  17. }
  18. // 查询变更记录响应
  19. type QryOPLogRsp models.ErmcpOPLogModel
  20. // QueryChangeLog 查询变更记录
  21. // @Summary 查询变更记录
  22. // @Produce json
  23. // @Security ApiKeyAuth
  24. // @Param RelatedId query string true "合同ID"
  25. // @Success 200 {array} QryOPLogRsp
  26. // @Failure 500 {object} app.Response
  27. // @Router /Ermcp/QueryChangeLog [get]
  28. // @Tags 企业风险管理(app)
  29. func QueryChangeLog(c *gin.Context) {
  30. appG := app.Gin{C: c}
  31. var req QryOPLogReq
  32. if err := c.ShouldBind(&req); err != nil {
  33. appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  34. return
  35. }
  36. m := models.ErmcpOPLogModel{RELATEDID: req.RelatedId}
  37. if d, err := m.GetData(); err == nil {
  38. appG.Response(http.StatusOK, e.SUCCESS, d)
  39. } else {
  40. appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  41. }
  42. }