作者 yangfu

Merge branch 'dev' into test

... ... @@ -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)
}
}
... ...
... ... @@ -46,7 +46,7 @@ func (l *SystemDeleteArticleLogic) SystemDeleteArticle(req *types.SystemArticleD
if err != nil {
return err
}
_, err = l.svcCtx.ArticleRepository.Delete(l.ctx, l.conn, article)
_, err = l.svcCtx.ArticleRepository.Delete(l.ctx, conn, article)
if err != nil {
return 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)
... ...
... ... @@ -90,6 +90,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
ArticleSectionRepository: repository.NewArticleSectionRepository(cache.NewCachedRepository(mlCache)),
ArticleAndTagRepository: repository.NewArticleAndTagRepository(cache.NewCachedRepository(mlCache)),
ArticleCategoryRepository: repository.NewArticleCategoryRepository(cache.NewCachedRepository(mlCache)),
ArticleDraftOperationRepository: repository.NewArticleDraftOperationRepository(cache.NewCachedRepository(mlCache)),
CompanyRepository: repository.NewCompanyRepository(cache.NewCachedRepository(mlCache)),
DepartmentRepository: repository.NewDepartmentRepository(cache.NewCachedRepository(mlCache)),
... ...
... ... @@ -1756,7 +1756,7 @@ type ArticleCategoryItem struct {
}
type CategoryOptionsRequest struct {
CompanyId int64 `path:",optional"` // 公司ID
Enable int `form:"enable,optional"` // 启用状态 1:启用
}
type CategoryOptionsResponse struct {
... ...