Bläddra i källkod

update

master
shenjiachi 1 vecka sedan
förälder
incheckning
aadde4c368
2 ändrade filer med 14 tillägg och 3 borttagningar
  1. +13
    -2
      app/hdl/member_center/hdl_tag__management.go
  2. +1
    -1
      go.mod

+ 13
- 2
app/hdl/member_center/hdl_tag__management.go Visa fil

@@ -7,6 +7,7 @@ import (
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"errors"
"github.com/gin-gonic/gin"
"time"
)
@@ -126,7 +127,7 @@ func UpdateTag(c *gin.Context) {
Memo: req.Memo,
}

forceColumns := []string{"tag_name", "memo", "is_punish"}
forceColumns := []string{"tag_name", "memo"}

tagDb := implement.NewUserTagDb(db.Db)
affected, err := tagDb.UserTagUpdate(tagID, tag, forceColumns...)
@@ -160,7 +161,17 @@ func DeleteTag(c *gin.Context) {
session := db.Db.NewSession()
defer session.Close()

_, err := tagDb.UserTagDeleteBySession(session, req.TagID)
isUsed, err := recordsDb.UserTagRecordsIsUsedBySession(session, utils.StrToInt(req.TagID))
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if isUsed {
e.OutErr(c, e.ERR, errors.New("该标签已被使用,无法删除").Error())
return
}

_, err = tagDb.UserTagDeleteBySession(session, req.TagID)
if err != nil {
session.Rollback()
e.OutErr(c, e.ERR_DB_ORM, err.Error())


+ 1
- 1
go.mod Visa fil

@@ -33,7 +33,7 @@ require (
)

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241207095049-e0ad89412565
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241209061118-ae1be0db6a70
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241205075006-9c0bf995c788
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5


Laddar…
Avbryt
Spara