更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -10,12 +10,6 @@ import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// =============================================================
|
||||
// 平台官网 - 标签管理 /platform/website/tag/*
|
||||
// - 评论管理 /platform/website/comment/*
|
||||
// 表:yz_platform_website_tag / yz_platform_website_comment
|
||||
// =============================================================
|
||||
|
||||
type PlatformWebsiteTagController struct {
|
||||
beego.Controller
|
||||
}
|
||||
@@ -26,7 +20,6 @@ type platformWebsiteTagPayload struct {
|
||||
Status *int8 `json:"status"`
|
||||
}
|
||||
|
||||
// List GET /platform/website/tag/list — 分页
|
||||
func (c *PlatformWebsiteTagController) List() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -53,7 +46,6 @@ func (c *PlatformWebsiteTagController) List() {
|
||||
websiteOK(&c.Controller, map[string]interface{}{"list": rows, "total": total})
|
||||
}
|
||||
|
||||
// All GET /platform/website/tag/all — 全量返回,供文章编辑选择标签
|
||||
func (c *PlatformWebsiteTagController) All() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -69,7 +61,6 @@ func (c *PlatformWebsiteTagController) All() {
|
||||
websiteOK(&c.Controller, rows)
|
||||
}
|
||||
|
||||
// Get GET /platform/website/tag/:id
|
||||
func (c *PlatformWebsiteTagController) Get() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -89,7 +80,6 @@ func (c *PlatformWebsiteTagController) Get() {
|
||||
websiteOK(&c.Controller, row)
|
||||
}
|
||||
|
||||
// Create POST /platform/website/tag
|
||||
func (c *PlatformWebsiteTagController) Create() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -103,7 +93,6 @@ func (c *PlatformWebsiteTagController) Create() {
|
||||
return
|
||||
}
|
||||
name := strings.TrimSpace(*p.Name)
|
||||
// 同名标签去重,避免前台聚合出现重复项
|
||||
exist, err := models.Orm.QueryTable(new(models.PlatformWebsiteTag)).
|
||||
Filter("name", name).
|
||||
Filter("delete_time__isnull", true).
|
||||
@@ -132,7 +121,6 @@ func (c *PlatformWebsiteTagController) Create() {
|
||||
websiteOK(&c.Controller, map[string]interface{}{"id": id})
|
||||
}
|
||||
|
||||
// Update POST /platform/website/tag/:id
|
||||
func (c *PlatformWebsiteTagController) Update() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -194,7 +182,6 @@ func (c *PlatformWebsiteTagController) Update() {
|
||||
websiteOK(&c.Controller, nil)
|
||||
}
|
||||
|
||||
// UpdateStatus PATCH /platform/website/tag/:id/status — body { status }
|
||||
func (c *PlatformWebsiteTagController) UpdateStatus() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -225,7 +212,6 @@ func (c *PlatformWebsiteTagController) UpdateStatus() {
|
||||
websiteOK(&c.Controller, nil)
|
||||
}
|
||||
|
||||
// Delete DELETE /platform/website/tag/:id
|
||||
func (c *PlatformWebsiteTagController) Delete() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -247,23 +233,16 @@ func (c *PlatformWebsiteTagController) Delete() {
|
||||
jsonErr(&c.Controller, 404, 404, "标签不存在")
|
||||
return
|
||||
}
|
||||
// 同步清理文章关联,避免前台聚合到已删除标签
|
||||
_, _ = models.Orm.QueryTable(new(models.PlatformWebsiteArticleTag)).
|
||||
Filter("tag_id", id).
|
||||
Delete()
|
||||
websiteOK(&c.Controller, nil)
|
||||
}
|
||||
|
||||
// =============================================================
|
||||
// 评论管理
|
||||
// =============================================================
|
||||
|
||||
type PlatformWebsiteCommentController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
// List GET /platform/website/comment/list
|
||||
// query: keyword(内容/昵称)、status、article_id、page、pageSize
|
||||
func (c *PlatformWebsiteCommentController) List() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -323,7 +302,6 @@ func (c *PlatformWebsiteCommentController) List() {
|
||||
websiteOK(&c.Controller, map[string]interface{}{"list": list, "total": total})
|
||||
}
|
||||
|
||||
// Get GET /platform/website/comment/:id
|
||||
func (c *PlatformWebsiteCommentController) Get() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -343,7 +321,6 @@ func (c *PlatformWebsiteCommentController) Get() {
|
||||
websiteOK(&c.Controller, row)
|
||||
}
|
||||
|
||||
// Audit POST /platform/website/comment/:id/audit — body { status: 1 通过 / 2 拒绝 }
|
||||
func (c *PlatformWebsiteCommentController) Audit() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -378,7 +355,6 @@ func (c *PlatformWebsiteCommentController) Audit() {
|
||||
websiteOK(&c.Controller, nil)
|
||||
}
|
||||
|
||||
// Reply POST /platform/website/comment/:id/reply — body { reply }
|
||||
func (c *PlatformWebsiteCommentController) Reply() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -412,7 +388,6 @@ func (c *PlatformWebsiteCommentController) Reply() {
|
||||
websiteOK(&c.Controller, nil)
|
||||
}
|
||||
|
||||
// Delete DELETE /platform/website/comment/:id
|
||||
func (c *PlatformWebsiteCommentController) Delete() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
@@ -437,7 +412,6 @@ func (c *PlatformWebsiteCommentController) Delete() {
|
||||
websiteOK(&c.Controller, nil)
|
||||
}
|
||||
|
||||
// BatchDelete POST /platform/website/comment/batchdelete — body { ids: [] }
|
||||
func (c *PlatformWebsiteCommentController) BatchDelete() {
|
||||
if _, ok := websiteAuth(&c.Controller); !ok {
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user