Browse Source

update

master
shenjiachi 1 week ago
parent
commit
0e8cf7840a
7 changed files with 57 additions and 14 deletions
  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 View File

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

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

switch kind { switch kind {
case "1": case "1":
// 日 // 日


+ 33
- 6
app/hdl/member_center/hdl_tag__management.go View File

@@ -99,16 +99,43 @@ func UpdateTag(c *gin.Context) {
return return
} }
tagID := utils.StrToInt(req.TagID) 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{ 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...) affected, err := tagDb.UserTagUpdate(tagID, tag, forceColumns...)
if err != nil { if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error()) e.OutErr(c, e.ERR_DB_ORM, err.Error())


+ 4
- 3
app/md/member_center/md_tag_management.go View File

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


type UpdateTagReq 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 { type DeleteTagReq struct {


+ 4
- 0
docs/docs.go View File

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


+ 4
- 0
docs/swagger.json View File

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


+ 3
- 0
docs/swagger.yaml View File

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


+ 1
- 1
go.mod View File

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


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/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_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5


Loading…
Cancel
Save