106 lines
3.0 KiB
Go
106 lines
3.0 KiB
Go
package errfeedbackctrl
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"91porn-server/common"
|
|
"91porn-server/common/constant"
|
|
"91porn-server/common/stderr"
|
|
"91porn-server/models/commod"
|
|
"91porn-server/models/l/operatorlgmod"
|
|
"91porn-server/models/v/errfedbkmod"
|
|
"91porn-server/models/v/verifyreportmod"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// List doc
|
|
// @Summary
|
|
// @Description 查询楼凤举报信息
|
|
// @Tags loufeng
|
|
// @Accept mpfd,json
|
|
// @Produce json,html
|
|
// @Success 200 {string} json "{"msg": "操作成功"}"
|
|
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
|
// @Router /loufeng/getVerifyReport [post]
|
|
func List(ctx *gin.Context) {
|
|
var p struct {
|
|
errfedbkmod.QuerySelector
|
|
commod.Page
|
|
}
|
|
if err := ctx.ShouldBind(&p); err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
|
|
return
|
|
}
|
|
data, total, err := errfedbkmod.StdFind(p.QuerySelector, p.Page)
|
|
if err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrDbQueryError, err.Error())
|
|
return
|
|
}
|
|
common.ServeJSON(ctx, stderr.Success, gin.H{
|
|
"list": data,
|
|
"total": total,
|
|
"v": verifyreportmod.VerifyReport{},
|
|
})
|
|
}
|
|
|
|
// Process doc
|
|
// @Summary 处理举报信息
|
|
// @Description 处理举报信息
|
|
// @Tags loufeng
|
|
// @Accept mpfd,json
|
|
// @Produce json,html
|
|
// @Success 200 {string} json "{"msg": "操作成功"}"
|
|
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
|
// @Router /loufeng/processVerifyReport [post]
|
|
func Process(ctx *gin.Context) {
|
|
manager, err := common.GetAdminAct(ctx)
|
|
if err != nil {
|
|
common.ServeJSON(ctx, stderr.AdminIDErr, err.Error())
|
|
return
|
|
}
|
|
s := errfedbkmod.EditSelector{}
|
|
if err = ctx.ShouldBind(&s); err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
|
|
return
|
|
}
|
|
if _, err = errfedbkmod.FindUpdate(&s); err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrDbInsertError, err.Error())
|
|
return
|
|
}
|
|
log, _ := json.Marshal(s)
|
|
_ = operatorlgmod.RecordOperation(manager, constant.VerifyReport, constant.Modify, string(log), ctx.Request.URL.RequestURI())
|
|
common.ServeJSON(ctx, stderr.Success, nil)
|
|
}
|
|
|
|
// DelFeedback doc
|
|
// @Summary 删除举报信息
|
|
// @Description 处理举报信息
|
|
// @Tags loufeng
|
|
// @Accept mpfd,json
|
|
// @Produce json,html
|
|
// @Success 200 {string} json "{"msg": "操作成功"}"
|
|
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
|
// @Router /verifyReport/del [post]
|
|
func DelVerifyReport(ctx *gin.Context) {
|
|
manager, err := common.GetAdminAct(ctx)
|
|
if err != nil {
|
|
common.ServeJSON(ctx, stderr.AdminIDErr, err.Error())
|
|
return
|
|
}
|
|
var p struct {
|
|
ID string `json:"id"`
|
|
}
|
|
if err = ctx.ShouldBind(&p); err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
|
|
return
|
|
}
|
|
if err = verifyreportmod.Remove(p.ID); err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrDbDeleteError, err.Error())
|
|
return
|
|
}
|
|
log, _ := json.Marshal(p)
|
|
_ = operatorlgmod.RecordOperation(manager, constant.VerifyReport, constant.Delete, string(log), ctx.Request.URL.RequestURI())
|
|
common.ServeJSON(ctx, stderr.Success, nil)
|
|
}
|