|
|
@@ -114,9 +114,16 @@ func QueryImageConfigs(c *gin.Context) {
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, imageConfigs)
|
|
|
}
|
|
|
|
|
|
+// GetAllEnumsReq 获取所有枚举信息请求参数
|
|
|
+type GetAllEnumsReq struct {
|
|
|
+ Autoid int `form:"autoid"`
|
|
|
+}
|
|
|
+
|
|
|
// GetAllEnums 获取所有枚举信息
|
|
|
// @Summary 获取所有枚举信息
|
|
|
+// @Description autoid传入后则返回这个ID之后的数据;如不传则返回所有
|
|
|
// @Produce json
|
|
|
+// @Param autoid query int false "起始自增ID"
|
|
|
// @Success 200 {object} models.Enumdicitem
|
|
|
// @Failure 500 {object} app.Response
|
|
|
// @Router /Common/GetAllEnums [get]
|
|
|
@@ -124,7 +131,15 @@ func QueryImageConfigs(c *gin.Context) {
|
|
|
func GetAllEnums(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
|
|
|
- enums, err := models.GetEnums()
|
|
|
+ // 获取请求参数
|
|
|
+ var req GetAllEnumsReq
|
|
|
+ if err := appG.C.ShouldBindQuery(&req); err != nil {
|
|
|
+ logger.GetLogger().Errorf("GetAllEnums failed: %s", err.Error())
|
|
|
+ appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ enums, err := models.GetEnums(req.Autoid)
|
|
|
if err != nil {
|
|
|
// 查询失败
|
|
|
logger.GetLogger().Errorf("GetAllEnums failed: %s", err.Error())
|