正在显示
9 个修改的文件
包含
15 行增加
和
33 行删除
@@ -80,7 +80,7 @@ type ( | @@ -80,7 +80,7 @@ type ( | ||
80 | //标签下拉列表 | 80 | //标签下拉列表 |
81 | type ( | 81 | type ( |
82 | CategoryOptionsRequest { | 82 | CategoryOptionsRequest { |
83 | - CompanyId int64 `path:",optional"` // 公司ID | 83 | + Enable int `form:"enable,optional"` // 启用状态 1:启用 |
84 | } | 84 | } |
85 | CategoryOptionsResponse { | 85 | CategoryOptionsResponse { |
86 | Options []CategoryOptions `json:"options"` | 86 | Options []CategoryOptions `json:"options"` |
1 | package tags | 1 | package tags |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" | ||
4 | "net/http" | 5 | "net/http" |
5 | 6 | ||
6 | "github.com/zeromicro/go-zero/rest/httpx" | 7 | "github.com/zeromicro/go-zero/rest/httpx" |
@@ -19,10 +20,6 @@ func ArticleCategoryDeleteHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | @@ -19,10 +20,6 @@ func ArticleCategoryDeleteHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
19 | 20 | ||
20 | l := tags.NewArticleCategoryDeleteLogic(r.Context(), svcCtx) | 21 | l := tags.NewArticleCategoryDeleteLogic(r.Context(), svcCtx) |
21 | resp, err := l.ArticleCategoryDelete(&req) | 22 | resp, err := l.ArticleCategoryDelete(&req) |
22 | - if err != nil { | ||
23 | - httpx.ErrorCtx(r.Context(), w, err) | ||
24 | - } else { | ||
25 | - httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | - } | 23 | + result.HttpResult(r, w, resp, err) |
27 | } | 24 | } |
28 | } | 25 | } |
1 | package tags | 1 | package tags |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" | ||
4 | "net/http" | 5 | "net/http" |
5 | 6 | ||
6 | "github.com/zeromicro/go-zero/rest/httpx" | 7 | "github.com/zeromicro/go-zero/rest/httpx" |
@@ -19,10 +20,6 @@ func ArticleCategoryGetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | @@ -19,10 +20,6 @@ func ArticleCategoryGetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
19 | 20 | ||
20 | l := tags.NewArticleCategoryGetLogic(r.Context(), svcCtx) | 21 | l := tags.NewArticleCategoryGetLogic(r.Context(), svcCtx) |
21 | resp, err := l.ArticleCategoryGet(&req) | 22 | resp, err := l.ArticleCategoryGet(&req) |
22 | - if err != nil { | ||
23 | - httpx.ErrorCtx(r.Context(), w, err) | ||
24 | - } else { | ||
25 | - httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | - } | 23 | + result.HttpResult(r, w, resp, err) |
27 | } | 24 | } |
28 | } | 25 | } |
1 | package tags | 1 | package tags |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" | ||
4 | "net/http" | 5 | "net/http" |
5 | 6 | ||
6 | "github.com/zeromicro/go-zero/rest/httpx" | 7 | "github.com/zeromicro/go-zero/rest/httpx" |
@@ -19,10 +20,6 @@ func ArticleCategoryOptionsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc | @@ -19,10 +20,6 @@ func ArticleCategoryOptionsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc | ||
19 | 20 | ||
20 | l := tags.NewArticleCategoryOptionsLogic(r.Context(), svcCtx) | 21 | l := tags.NewArticleCategoryOptionsLogic(r.Context(), svcCtx) |
21 | resp, err := l.ArticleCategoryOptions(&req) | 22 | resp, err := l.ArticleCategoryOptions(&req) |
22 | - if err != nil { | ||
23 | - httpx.ErrorCtx(r.Context(), w, err) | ||
24 | - } else { | ||
25 | - httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | - } | 23 | + result.HttpResult(r, w, resp, err) |
27 | } | 24 | } |
28 | } | 25 | } |
1 | package tags | 1 | package tags |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" | ||
4 | "net/http" | 5 | "net/http" |
5 | 6 | ||
6 | "github.com/zeromicro/go-zero/rest/httpx" | 7 | "github.com/zeromicro/go-zero/rest/httpx" |
@@ -19,10 +20,6 @@ func ArticleCategorySaveHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | @@ -19,10 +20,6 @@ func ArticleCategorySaveHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
19 | 20 | ||
20 | l := tags.NewArticleCategorySaveLogic(r.Context(), svcCtx) | 21 | l := tags.NewArticleCategorySaveLogic(r.Context(), svcCtx) |
21 | resp, err := l.ArticleCategorySave(&req) | 22 | resp, err := l.ArticleCategorySave(&req) |
22 | - if err != nil { | ||
23 | - httpx.ErrorCtx(r.Context(), w, err) | ||
24 | - } else { | ||
25 | - httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | - } | 23 | + result.HttpResult(r, w, resp, err) |
27 | } | 24 | } |
28 | } | 25 | } |
1 | package tags | 1 | package tags |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" | ||
4 | "net/http" | 5 | "net/http" |
5 | 6 | ||
6 | "github.com/zeromicro/go-zero/rest/httpx" | 7 | "github.com/zeromicro/go-zero/rest/httpx" |
@@ -19,10 +20,6 @@ func ArticleCategorySearchHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | @@ -19,10 +20,6 @@ func ArticleCategorySearchHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
19 | 20 | ||
20 | l := tags.NewArticleCategorySearchLogic(r.Context(), svcCtx) | 21 | l := tags.NewArticleCategorySearchLogic(r.Context(), svcCtx) |
21 | resp, err := l.ArticleCategorySearch(&req) | 22 | resp, err := l.ArticleCategorySearch(&req) |
22 | - if err != nil { | ||
23 | - httpx.ErrorCtx(r.Context(), w, err) | ||
24 | - } else { | ||
25 | - httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | - } | 23 | + result.HttpResult(r, w, resp, err) |
27 | } | 24 | } |
28 | } | 25 | } |
1 | package tags | 1 | package tags |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" | ||
4 | "net/http" | 5 | "net/http" |
5 | 6 | ||
6 | "github.com/zeromicro/go-zero/rest/httpx" | 7 | "github.com/zeromicro/go-zero/rest/httpx" |
@@ -19,10 +20,6 @@ func ArticleCategoryUpdateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | @@ -19,10 +20,6 @@ func ArticleCategoryUpdateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
19 | 20 | ||
20 | l := tags.NewArticleCategoryUpdateLogic(r.Context(), svcCtx) | 21 | l := tags.NewArticleCategoryUpdateLogic(r.Context(), svcCtx) |
21 | resp, err := l.ArticleCategoryUpdate(&req) | 22 | resp, err := l.ArticleCategoryUpdate(&req) |
22 | - if err != nil { | ||
23 | - httpx.ErrorCtx(r.Context(), w, err) | ||
24 | - } else { | ||
25 | - httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | - } | 23 | + result.HttpResult(r, w, resp, err) |
27 | } | 24 | } |
28 | } | 25 | } |
@@ -32,7 +32,7 @@ func (l *ArticleCategoryOptionsLogic) ArticleCategoryOptions(req *types.Category | @@ -32,7 +32,7 @@ func (l *ArticleCategoryOptionsLogic) ArticleCategoryOptions(req *types.Category | ||
32 | userToken = contextdata.GetUserTokenFromCtx(l.ctx) | 32 | userToken = contextdata.GetUserTokenFromCtx(l.ctx) |
33 | ) | 33 | ) |
34 | 34 | ||
35 | - queryOptions := domain.NewQueryOptions().WithKV("enable", 1) | 35 | + queryOptions := domain.NewQueryOptions().WithKV("enable", req.Enable) |
36 | 36 | ||
37 | _, dms, err = l.svcCtx.ArticleCategoryRepository.Find(l.ctx, conn, userToken.CompanyId, queryOptions) | 37 | _, dms, err = l.svcCtx.ArticleCategoryRepository.Find(l.ctx, conn, userToken.CompanyId, queryOptions) |
38 | list := make([]types.CategoryOptions, 0) | 38 | list := make([]types.CategoryOptions, 0) |
@@ -1756,7 +1756,7 @@ type ArticleCategoryItem struct { | @@ -1756,7 +1756,7 @@ type ArticleCategoryItem struct { | ||
1756 | } | 1756 | } |
1757 | 1757 | ||
1758 | type CategoryOptionsRequest struct { | 1758 | type CategoryOptionsRequest struct { |
1759 | - CompanyId int64 `path:",optional"` // 公司ID | 1759 | + Enable int `form:"enable,optional"` // 启用状态 1:启用 |
1760 | } | 1760 | } |
1761 | 1761 | ||
1762 | type CategoryOptionsResponse struct { | 1762 | type CategoryOptionsResponse struct { |
-
请 注册 或 登录 后发表评论