| 107 | } |
| 108 | |
| 109 | func (c *imlPublishController) ListPage(ctx *gin.Context, serviceId string, page, pageSize string) ([]*dto.Publish, int, int, int64, error) { |
| 110 | pageNum, _ := strconv.Atoi(page) |
| 111 | pageSizeNum, _ := strconv.Atoi(pageSize) |
| 112 | if pageNum < 1 { |
| 113 | pageNum = 1 |
| 114 | } |
| 115 | if pageSizeNum <= 0 { |
| 116 | pageSizeNum = 50 |
| 117 | } |
| 118 | list, total, err := c.publishModule.List(ctx, serviceId, pageNum, pageSizeNum) |
| 119 | if err != nil { |
| 120 | return nil, 0, 0, 0, err |
| 121 | } |
| 122 | |
| 123 | return list, pageNum, pageSizeNum, total, nil |
| 124 | } |
| 125 | |
| 126 | func (c *imlPublishController) Detail(ctx *gin.Context, serviceId string, id string) (*dto.PublishDetail, error) { |
| 127 | return c.publishModule.Detail(ctx, serviceId, id) |