作者 庄敏学
... ... @@ -80,7 +80,7 @@ type (
//标签下拉列表
type (
CategoryOptionsRequest {
CompanyId int64 `path:",optional"` // 公司ID
Enable int `form:"enable,optional"` // 启用状态 1:启用
}
CategoryOptionsResponse {
Options []CategoryOptions `json:"options"`
... ...
package tags
import (
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
... ... @@ -19,10 +20,6 @@ func ArticleCategoryDeleteHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
l := tags.NewArticleCategoryDeleteLogic(r.Context(), svcCtx)
resp, err := l.ArticleCategoryDelete(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
result.HttpResult(r, w, resp, err)
}
}
... ...
package tags
import (
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
... ... @@ -19,10 +20,6 @@ func ArticleCategoryGetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
l := tags.NewArticleCategoryGetLogic(r.Context(), svcCtx)
resp, err := l.ArticleCategoryGet(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
result.HttpResult(r, w, resp, err)
}
}
... ...
package tags
import (
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
... ... @@ -19,10 +20,6 @@ func ArticleCategoryOptionsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc
l := tags.NewArticleCategoryOptionsLogic(r.Context(), svcCtx)
resp, err := l.ArticleCategoryOptions(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
result.HttpResult(r, w, resp, err)
}
}
... ...
package tags
import (
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
... ... @@ -19,10 +20,6 @@ func ArticleCategorySaveHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
l := tags.NewArticleCategorySaveLogic(r.Context(), svcCtx)
resp, err := l.ArticleCategorySave(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
result.HttpResult(r, w, resp, err)
}
}
... ...
package tags
import (
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
... ... @@ -19,10 +20,6 @@ func ArticleCategorySearchHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
l := tags.NewArticleCategorySearchLogic(r.Context(), svcCtx)
resp, err := l.ArticleCategorySearch(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
result.HttpResult(r, w, resp, err)
}
}
... ...
package tags
import (
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
... ... @@ -19,10 +20,6 @@ func ArticleCategoryUpdateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
l := tags.NewArticleCategoryUpdateLogic(r.Context(), svcCtx)
resp, err := l.ArticleCategoryUpdate(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
result.HttpResult(r, w, resp, err)
}
}
... ...
... ... @@ -32,7 +32,7 @@ func (l *ArticleCategoryOptionsLogic) ArticleCategoryOptions(req *types.Category
userToken = contextdata.GetUserTokenFromCtx(l.ctx)
)
queryOptions := domain.NewQueryOptions().WithKV("enable", 1)
queryOptions := domain.NewQueryOptions().WithKV("enable", req.Enable)
_, dms, err = l.svcCtx.ArticleCategoryRepository.Find(l.ctx, conn, userToken.CompanyId, queryOptions)
list := make([]types.CategoryOptions, 0)
... ...
... ... @@ -1758,7 +1758,7 @@ type ArticleCategoryItem struct {
}
type CategoryOptionsRequest struct {
CompanyId int64 `path:",optional"` // 公司ID
Enable int `form:"enable,optional"` // 启用状态 1:启用
}
type CategoryOptionsResponse struct {
... ...