| | |
| | | package v1 |
| | | |
| | | import ( |
| | | "aps_crm/pkg/contextx" |
| | | "aps_crm/pkg/ecode" |
| | | "github.com/gin-gonic/gin" |
| | | ) |
| | | |
| | | type GetAllDataApi struct{} |
| | | |
| | | // GetAllData |
| | | // |
| | | // @Tags Data |
| | | // @Summary 获取所有数据 |
| | | // @Produce application/json |
| | | // @Success 200 {object} contextx.Response{data=response.DataResponse} |
| | | // @Router /api/data/getAllData [get] |
| | | func (g *GetAllDataApi) GetAllData(c *gin.Context) { |
| | | ctx, ok := contextx.NewContext(c, nil) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | errCode, data := allDataServer.GetAllData() |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | ctx.OkWithDetailed(data) |
| | | } |