Explorar el Código

update

master
shenjiachi hace 1 semana
padre
commit
0e8cf7840a
Se han modificado 7 ficheros con 57 adiciones y 14 borrados
  1. +8
    -4
      app/hdl/hdl_home_page.go
  2. +33
    -6
      app/hdl/member_center/hdl_tag__management.go
  3. +4
    -3
      app/md/member_center/md_tag_management.go
  4. +4
    -0
      docs/docs.go
  5. +4
    -0
      docs/swagger.json
  6. +3
    -0
      docs/swagger.yaml
  7. +1
    -1
      go.mod

+ 8
- 4
app/hdl/hdl_home_page.go Ver fichero

@@ -146,7 +146,8 @@ func GetGrowData(c *gin.Context) {
return
}
kind := req.Kind

var yData []interface{}
var xData []interface{}
now := time.Now()
dataDb := implement.NewPlatformGrowDataDb(db.Db)
m, has, err := dataDb.PlatformGrowDataGetLastOne()
@@ -155,11 +156,14 @@ func GetGrowData(c *gin.Context) {
return
}
if !has {
e.OutErr(c, e.ERR_NO_DATA, "未查询到数据")
resp := md.GetPriceCurveResp{
XData: xData,
YData: yData,
}
e.OutSuc(c, resp, nil)
return
}
var yData []interface{}
var xData []interface{}

switch kind {
case "1":
// 日


+ 33
- 6
app/hdl/member_center/hdl_tag__management.go Ver fichero

@@ -99,16 +99,43 @@ func UpdateTag(c *gin.Context) {
return
}
tagID := utils.StrToInt(req.TagID)

tagDb := implement.NewUserTagDb(db.Db)
oldTag, err := tagDb.UserTagGetOneByParams(map[string]interface{}{"key": "id", "value": tagID})
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if oldTag == nil {
e.OutErr(c, e.ERR_NO_DATA, errors.New("标签不存在").Error())
return
}
if req.IsPunish != "" && oldTag.IsPunish != utils.StrToInt(req.IsPunish) {
// 标签在被使用情况下不允许修改是否为处罚标签
recordsDb := implement.NewUserTagRecordsDb(db.Db)
exist, err := recordsDb.UserTagRecordsExist(0, tagID)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if exist {
e.OutErr(c, e.ERR, errors.New("该标签已被使用,无法修改是否为处罚标签").Error())
return
}
}
tag := &model.UserTag{
Id: tagID,
TagName: req.Name,
Memo: req.Memo,
Id: tagID,
}

forceColumns := []string{"tag_name", "memo"}
if req.Name != "" {
tag.TagName = req.Name
}

if req.Memo != "" {
tag.Memo = req.Memo
}

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

tagDb := implement.NewUserTagDb(db.Db)
affected, err := tagDb.UserTagUpdate(tagID, tag, forceColumns...)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())


+ 4
- 3
app/md/member_center/md_tag_management.go Ver fichero

@@ -21,9 +21,10 @@ type AddTagReq struct {
}

type UpdateTagReq struct {
TagID string `json:"tag_id,required"` // 标签 ID
Name string `json:"name,required"` // 标签名称
Memo string `json:"memo,required"` // 备注
TagID string `json:"tag_id,required"` // 标签 ID
Name string `json:"name,required"` // 标签名称
Memo string `json:"memo,required"` // 备注
IsPunish string `json:"is_punish"` // 是否是惩罚标签
}

type DeleteTagReq struct {


+ 4
- 0
docs/docs.go Ver fichero

@@ -14267,6 +14267,10 @@ const docTemplate = `{
"md.UpdateTagReq": {
"type": "object",
"properties": {
"is_punish": {
"description": "是否是惩罚标签",
"type": "string"
},
"memo": {
"description": "备注",
"type": "string"


+ 4
- 0
docs/swagger.json Ver fichero

@@ -14260,6 +14260,10 @@
"md.UpdateTagReq": {
"type": "object",
"properties": {
"is_punish": {
"description": "是否是惩罚标签",
"type": "string"
},
"memo": {
"description": "备注",
"type": "string"


+ 3
- 0
docs/swagger.yaml Ver fichero

@@ -3952,6 +3952,9 @@ definitions:
type: object
md.UpdateTagReq:
properties:
is_punish:
description: 是否是惩罚标签
type: string
memo:
description: 备注
type: string


+ 1
- 1
go.mod Ver fichero

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

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241209094543-8aafc254a593
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241210101917-218ac8890613
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


Cargando…
Cancelar
Guardar