Browse Source

Merge remote-tracking branch 'origin/master'

master
huangjiajun 1 week ago
parent
commit
4e954ed57c
19 changed files with 515 additions and 236 deletions
  1. +7
    -9
      app/db/im/model/customer_service.go
  2. +36
    -6
      app/hdl/friend_circle/hdl_dynamic.go
  3. +1
    -1
      app/hdl/im/hdl_basic.go
  4. +23
    -9
      app/md/friend_circle/md_dynamic.go
  5. +1
    -0
      app/md/im/md_customer_service.go
  6. +6
    -5
      app/md/im/md_emoticon.go
  7. +12
    -1
      app/md/member_center/md_user_management.go
  8. +24
    -7
      app/svc/im/svc_customer_service.go
  9. +6
    -3
      app/svc/im/svc_emoticon.go
  10. +1
    -0
      app/svc/im/svc_group.go
  11. +12
    -10
      app/svc/member_center/svc_user_management.go
  12. +1
    -0
      app/task/init.go
  13. +67
    -0
      app/task/svc/svc_egg_energy_auto_update_user_access.go
  14. +83
    -64
      docs/docs.go
  15. +80
    -62
      docs/swagger.json
  16. +59
    -46
      docs/swagger.yaml
  17. +40
    -12
      etc/task.yml
  18. +1
    -1
      go.mod
  19. +55
    -0
      k8s/container-task.yaml

+ 7
- 9
app/db/im/model/customer_service.go View File

@@ -1,15 +1,13 @@
package model package model


import "time"

// CustomerService 客服表 // CustomerService 客服表
type CustomerService struct { type CustomerService struct {
Id int64 Id int64
Uid int64 // 用户id
Weight int32 // 权重
State int32 // 状态
HasUserNums int // 拥有用户数量
Memo string // 备注
CreateTime time.Time // 创建时间
UpdateTime time.Time // 更新时间
Uid int64 // 用户id
Weight int32 // 权重
State int32 // 状态
HasUserNums int // 拥有用户数量
Memo string // 备注
CreateTime string // 创建时间
UpdateTime string // 更新时间
} }

+ 36
- 6
app/hdl/friend_circle/hdl_dynamic.go View File

@@ -17,6 +17,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/olivere/elastic/v7" "github.com/olivere/elastic/v7"
"strconv" "strconv"
"strings"
"time" "time"
) )


@@ -135,20 +136,37 @@ func GetDynamic(c *gin.Context) {
} }
redisConn := cache.GetPool().Get() redisConn := cache.GetPool().Get()
scheme, domain := svc2.ImageBucket(db.Db, redisConn) scheme, domain := svc2.ImageBucket(db.Db, redisConn)
list := make([]md.DynamicRespNode, len(docs))
for _, doc := range docs { for _, doc := range docs {
switch doc.Kind { switch doc.Kind {
case 1: case 1:
doc.Username = userMap[doc.Uid] doc.Username = userMap[doc.Uid]
case 2: case 2:
doc.Username = adminMap[doc.Uid] doc.Username = adminMap[doc.Uid]

} }
doc.Image = svc2.ImageFormatWithBucket(scheme, domain, doc.Image)
doc.Video = svc2.ImageFormatWithBucket(scheme, domain, doc.Video)
imageStr := svc2.ImageFormatWithBucketForDataInfo(scheme, domain, doc.Image)
videoStr := svc2.ImageFormatWithBucketForDataInfo(scheme, domain, doc.Video)
images := strings.Split(imageStr, ";")
videos := strings.Split(videoStr, ";")
temp := md.DynamicRespNode{
IndexId: doc.IndexId,
Uid: doc.Uid,
Username: doc.Username,
Kind: doc.Kind,
Content: doc.Content,
Image: images,
Video: videos,
State: doc.State,
IsTopUp: doc.IsTopUp,
IsPraise: doc.IsPraise,
CreatedAt: doc.CreatedAt,
UpdatedAt: doc.UpdatedAt,
}
list = append(list, temp)
} }


resp := md.GetDynamicResp{ resp := md.GetDynamicResp{
List: docs,
List: list,
Paginate: md.Paginate{ Paginate: md.Paginate{
Limit: req.Limit, Limit: req.Limit,
Page: req.Page, Page: req.Page,
@@ -271,14 +289,26 @@ func ReleaseDynamic(c *gin.Context) {
if req.IsTopUp == 0 { if req.IsTopUp == 0 {
req.IsTopUp = 2 req.IsTopUp = 2
} }
redisConn := cache.GetPool().Get()
scheme, domain := svc2.ImageBucket(db.Db, redisConn)
var imageStr string
if len(req.Image) > 0 {
imageStr = strings.Join(req.Image, ";")
imageStr = strings.ReplaceAll(imageStr, fmt.Sprintf("%s://%s/", scheme, domain), "{{tempHost}}")
}


var videoStr string
if len(req.Video) > 0 {
videoStr = strings.Join(req.Video, ";")
videoStr = strings.ReplaceAll(videoStr, fmt.Sprintf("%s://%s/", scheme, domain), "{{tempHost}}")
}
now := time.Now() now := time.Now()
m := md2.EggFriendCircleEs{ m := md2.EggFriendCircleEs{
Uid: int64(user.AdmId), Uid: int64(user.AdmId),
Kind: req.Kind, Kind: req.Kind,
Content: req.Content, Content: req.Content,
Image: utils.SerializeStr(req.Image),
Video: req.Video,
Image: imageStr,
Video: videoStr,
LikesNums: 0, LikesNums: 0,
ShareNums: 0, ShareNums: 0,
CommentNums: 0, CommentNums: 0,


+ 1
- 1
app/hdl/im/hdl_basic.go View File

@@ -27,7 +27,7 @@ func GetBasic(c *gin.Context) {
ProhibitAddGroupMembers: res[enum.ProhibitAddGroupMembers], ProhibitAddGroupMembers: res[enum.ProhibitAddGroupMembers],
ProhibitRemoveGroupMembers: res[enum.ProhibitRemoveGroupMembers], ProhibitRemoveGroupMembers: res[enum.ProhibitRemoveGroupMembers],
ProhibitUpdateGroupName: res[enum.ProhibitUpdateGroupName], ProhibitUpdateGroupName: res[enum.ProhibitUpdateGroupName],
ChatSensitiveWords: res[enum.ProhibitUpdateGroupName],
ChatSensitiveWords: res[enum.ChatSensitiveWords],
} }


e.OutSuc(c, resp, nil) e.OutSuc(c, resp, nil)


+ 23
- 9
app/md/friend_circle/md_dynamic.go View File

@@ -27,10 +27,24 @@ type EggFriendCircleNode struct {
CreatedAt string `json:"created_at"` CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"` UpdatedAt string `json:"updated_at"`
} }
type DynamicRespNode struct {
IndexId string `json:"index_id"` // 动态id
Uid int64 `json:"uid" label:"uid"` // 用户id
Username string `json:"username"` // 用户名称
Kind int32 `json:"kind" label:"类型(1:普通 2:官方)"` // 类型(1:普通 2:官方)
Content string `json:"content" label:"文本内容"` // 文本内容
Image []string `json:"image" label:"图片"` // 图片
Video []string `json:"video" label:"视频"` // 视频
State int32 `json:"state" label:"状态(1:正常 2:隐藏)"` // 状态(1:正常 2:隐藏)
IsTopUp int32 `json:"is_top_up" label:"是否置顶(1:是 2:否)"` // 是否置顶(1:是 2:否)
IsPraise int32 `json:"is_praise" label:"是否被表扬(1:是 2:否)"` // 是否被表扬(1:是 2:否)
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}


type GetDynamicResp struct { type GetDynamicResp struct {
List []EggFriendCircleNode `json:"list"`
Paginate Paginate `json:"paginate"` // 分页信息
List []DynamicRespNode `json:"list"`
Paginate Paginate `json:"paginate"` // 分页信息
} }


type UpdateDynamicReq struct { type UpdateDynamicReq struct {
@@ -45,11 +59,11 @@ type DeleteDynamicReq struct {
} }


type ReleaseDynamicReq struct { type ReleaseDynamicReq struct {
Kind int32 `json:"kind"` // 类型(1:普通 2:官方)
Content string `json:"content"` // 文本内容
Image string `json:"[]image"` // 图片
Video string `json:"video"` // 视频 uri
State int32 `json:"state"` // 状态(1:正常 2:隐藏)
IsTopUp int32 `json:"is_top_up"` // 是否置顶(1:是 2:否)
IsPraise int32 `json:"is_praise"` // 是否被表扬(1:是 2:否)
Kind int32 `json:"kind"` // 类型(1:普通 2:官方)
Content string `json:"content"` // 文本内容
Image []string `json:"image"` // 图片
Video []string `json:"video"` // 视频
State int32 `json:"state"` // 状态(1:正常 2:隐藏)
IsTopUp int32 `json:"is_top_up"` // 是否置顶(1:是 2:否)
IsPraise int32 `json:"is_praise"` // 是否被表扬(1:是 2:否)
} }

+ 1
- 0
app/md/im/md_customer_service.go View File

@@ -5,6 +5,7 @@ type PageCustomerServiceReq struct {
PageSize int `json:"page_size"` PageSize int `json:"page_size"`
State int `json:"state"` //状态 State int `json:"state"` //状态
Memo string `json:"memo" example:"备注"` Memo string `json:"memo" example:"备注"`
Phone string `json:"phone"` // 手机号
} }


type PageCustomerServiceResp struct { type PageCustomerServiceResp struct {


+ 6
- 5
app/md/im/md_emoticon.go View File

@@ -5,6 +5,7 @@ type PageEmoticonReq struct {
PageSize int `json:"page_size"` PageSize int `json:"page_size"`
State int `json:"state"` //状态 State int `json:"state"` //状态
Memo string `json:"memo" example:"备注"` Memo string `json:"memo" example:"备注"`
Name string `json:"name"` // 表情名称
} }


type PageEmoticonResp struct { type PageEmoticonResp struct {
@@ -15,9 +16,9 @@ type PageEmoticonResp struct {
Id int64 `json:"id"` //记录id Id int64 `json:"id"` //记录id
Name string `json:"name" example:"名称"` Name string `json:"name" example:"名称"`
ImgUrl string `json:"img_url" example:"图片地址"` ImgUrl string `json:"img_url" example:"图片地址"`
Sort int `json:"Sort"` // 排序
State int `json:"state"` // 状态0关闭,1开启
Memo string `json:"memo" example:"备注"` // 备注
Sort int `json:"Sort"` // 排序
State int `json:"state"` // 状态0关闭,1开启
Memo string `json:"memo" example:"备注"` // 备注
CreateAt string `json:"create_at" example:"创建时间"` // 创建时间 CreateAt string `json:"create_at" example:"创建时间"` // 创建时间
UpdateAt string `json:"update_at" example:"更新时间"` // 更新时间 UpdateAt string `json:"update_at" example:"更新时间"` // 更新时间
} `json:"list"` } `json:"list"`
@@ -27,7 +28,7 @@ type AddEmoticonReq struct {
Name string `json:"name" example:"名称"` Name string `json:"name" example:"名称"`
ImgUrl string `json:"img_url" example:"图片地址"` ImgUrl string `json:"img_url" example:"图片地址"`
Memo string `json:"memo" example:"备注"` // 备注 Memo string `json:"memo" example:"备注"` // 备注
Sort int `json:"sort"` // 排序
Sort int `json:"sort"` // 排序
} }


type SetEmoticonStateReq struct { type SetEmoticonStateReq struct {
@@ -40,7 +41,7 @@ type UpdateEmoticonReq struct {
Name string `json:"name" example:"名称"` Name string `json:"name" example:"名称"`
ImgUrl string `json:"img_url" example:"图片地址"` ImgUrl string `json:"img_url" example:"图片地址"`
Memo string `json:"memo" example:"备注"` // 备注 Memo string `json:"memo" example:"备注"` // 备注
Sort int `json:"sort"` // 排序
Sort int `json:"sort"` // 排序
} }


type DeleteEmoticonReq struct { type DeleteEmoticonReq struct {


+ 12
- 1
app/md/member_center/md_user_management.go View File

@@ -95,7 +95,7 @@ type UserManagementUpdateUserInfoReq struct {


type TagNode struct { type TagNode struct {
TagID int `json:"tag_id"` // 标签 ID TagID int `json:"tag_id"` // 标签 ID
TagName string `json:"tag_name"` // 标签 名称
TagName string `json:"tag_name"` // 标签名称
} }


type BasicInfoNode struct { type BasicInfoNode struct {
@@ -179,3 +179,14 @@ type UserManagementGetVirtualCoinDetailResp struct {
List []VirtualCoinDetailNode `json:"list"` List []VirtualCoinDetailNode `json:"list"`
Paginate Paginate `json:"paginate"` Paginate Paginate `json:"paginate"`
} }

type UserManagementAddTagReq struct {
Uid int64 `json:"uid"` // 用户 ID
TagId string `json:"tag_id"` // 标签 ID
Memo string `json:"memo"` // 标签备注
}

type UserManagementDelTagReq struct {
Uid int64 `json:"uid"` // 用户 ID
TagId string `json:"tag_id"` // 标签 ID
}

+ 24
- 7
app/svc/im/svc_customer_service.go View File

@@ -4,18 +4,35 @@ import (
"applet/app/db" "applet/app/db"
"applet/app/db/im/model" "applet/app/db/im/model"
md "applet/app/md/im" md "applet/app/md/im"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"errors" "errors"
"time" "time"
) )


func PageCustomerService(req md.PageCustomerServiceReq) (err error, resp md.PageCustomerServiceResp) { func PageCustomerService(req md.PageCustomerServiceReq) (err error, resp md.PageCustomerServiceResp) {
var userId int64
if req.Phone != "" {
userDb := implement.NewUserDb(db.Db)
user, err := userDb.UserGetOneByParams(map[string]interface{}{
"phone": req.Phone,
})
if err != nil {
return err, md.PageCustomerServiceResp{}
}
userId = user.Id
}

sess := db.DbIm.Where("1=1") sess := db.DbIm.Where("1=1")
if req.Memo != "" { if req.Memo != "" {
sess.And("memo LIKE ?", "%"+req.Memo+"%") sess.And("memo LIKE ?", "%"+req.Memo+"%")
} }
if req.State != 0 { if req.State != 0 {
sess.And("memo = ?", req.State)
sess.And("state = ?", req.State)
}
if userId != 0 {
sess.And("uid = ?", userId)
} }

var mm []*model.CustomerService var mm []*model.CustomerService
resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Asc("id").FindAndCount(&mm) resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Asc("id").FindAndCount(&mm)
if err != nil { if err != nil {
@@ -48,8 +65,8 @@ func PageCustomerService(req md.PageCustomerServiceReq) (err error, resp md.Page
State: v.State, State: v.State,
HaasUserNums: v.HasUserNums, HaasUserNums: v.HasUserNums,
Memo: v.Memo, Memo: v.Memo,
CreateTime: v.CreateTime.Format("2006-01-02 15:04:05"),
UpdateTime: v.UpdateTime.Format("2006-01-02 15:04:05"),
CreateTime: v.CreateTime,
UpdateTime: v.UpdateTime,
}) })
} }
return return
@@ -80,8 +97,8 @@ func AddCustomerService(req md.AddCustomerServiceReq) (err error) {
State: 1, State: 1,
HasUserNums: 0, HasUserNums: 0,
Memo: req.Memo, Memo: req.Memo,
CreateTime: time.Time{},
UpdateTime: time.Time{},
CreateTime: time.Now().Format("2006-01-02 15:04:05"),
UpdateTime: time.Now().Format("2006-01-02 15:04:05"),
} }
_, err = db.DbIm.InsertOne(&cfg) _, err = db.DbIm.InsertOne(&cfg)
if err != nil { if err != nil {
@@ -97,7 +114,7 @@ func SetCustomerServiceState(req md.SetCustomerServiceStateReq) (err error) {
if err != nil { if err != nil {
return return
} }
if has {
if !has {
return errors.New("未查询到对应记录!") return errors.New("未查询到对应记录!")
} }
customerService.State = req.State customerService.State = req.State
@@ -114,7 +131,7 @@ func UpdateCustomerServiceMemo(req md.UpdateCustomerServiceMemoReq) (err error)
if err != nil { if err != nil {
return return
} }
if has {
if !has {
return errors.New("未查询到对应记录!") return errors.New("未查询到对应记录!")
} }
customerService.Memo = req.Memo customerService.Memo = req.Memo


+ 6
- 3
app/svc/im/svc_emoticon.go View File

@@ -14,7 +14,10 @@ func PageEmoticon(req md.PageEmoticonReq) (err error, resp md.PageEmoticonResp)
sess.And("memo LIKE ?", "%"+req.Memo+"%") sess.And("memo LIKE ?", "%"+req.Memo+"%")
} }
if req.State != 0 { if req.State != 0 {
sess.And("memo = ?", req.State)
sess.And("state = ?", req.State)
}
if req.Name != "" {
sess.And("name LIKE ?", "%"+req.Name+"%")
} }
var mm []*model.Emoticon var mm []*model.Emoticon
resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Desc("id").FindAndCount(&mm) resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Desc("id").FindAndCount(&mm)
@@ -61,7 +64,7 @@ func SetEmoticonState(req md.SetEmoticonStateReq) (err error) {
if err != nil { if err != nil {
return return
} }
if has {
if !has {
return errors.New("未查询到对应记录!") return errors.New("未查询到对应记录!")
} }
customerService.State = req.State customerService.State = req.State
@@ -78,7 +81,7 @@ func UpdateEmoticon(req md.UpdateEmoticonReq) (err error) {
if err != nil { if err != nil {
return return
} }
if has {
if !has {
return errors.New("未查询到对应记录!") return errors.New("未查询到对应记录!")
} }
customerService.Name = req.Name customerService.Name = req.Name


+ 1
- 0
app/svc/im/svc_group.go View File

@@ -82,6 +82,7 @@ func GroupList(req md.GroupListReq) (err error, resp md.GroupListResp) {
tmp.Nickname = user.Nickname tmp.Nickname = user.Nickname
} }
} }
resp.List = append(resp.List, tmp)
} }
return return
} }


+ 12
- 10
app/svc/member_center/svc_user_management.go View File

@@ -133,16 +133,19 @@ func UserManagementUpdateUserInfo(engine *xorm.Engine, req *md.UserManagementUpd
if err != nil { if err != nil {
return 0, err return 0, err
} }
if records != nil {
recordIds := make([]int, 0)
for _, record := range *records {
recordIds = append(recordIds, record.Id)
}

// 删除所有用户的所有标签记录
oldRecordIds := make([]string, 0)
for _, record := range *records {
oldRecordIds = append(oldRecordIds, utils.IntToStr(record.Id))
}
newRecordIds := strings.Split(req.Tag, ",")
// 需要删除的标签
delTags := utils.DiffArray(oldRecordIds, newRecordIds)
addTags := utils.DiffArray(newRecordIds, oldRecordIds)
if delTags != nil {
// 删除不需要的标签记录
_, err := recordsDb.UserTagRecordsDeleteBySession(session, map[string]interface{}{ _, err := recordsDb.UserTagRecordsDeleteBySession(session, map[string]interface{}{
"key": "id", "key": "id",
"value": recordIds,
"value": delTags,
}) })
if err != nil { if err != nil {
return 0, err return 0, err
@@ -153,8 +156,7 @@ func UserManagementUpdateUserInfo(engine *xorm.Engine, req *md.UserManagementUpd
if req.Tag != "" { if req.Tag != "" {
newRecords := make([]*model.UserTagRecords, 0) newRecords := make([]*model.UserTagRecords, 0)
now := time.Now() now := time.Now()
tags := strings.Split(req.Tag, ",")
for _, tag := range tags {
for _, tag := range addTags {
newRecord := &model.UserTagRecords{ newRecord := &model.UserTagRecords{
TagId: utils.StrToInt(tag), TagId: utils.StrToInt(tag),
Uid: req.UID, Uid: req.UID,


+ 1
- 0
app/task/init.go View File

@@ -96,4 +96,5 @@ func initTasks() {
jobs[taskMd.CornEggEnergyDealUserPublicPlatoonPunish] = taskEggEnergyDealUserPublicPlatoonPunish // 蛋蛋能量-公排处罚 jobs[taskMd.CornEggEnergyDealUserPublicPlatoonPunish] = taskEggEnergyDealUserPublicPlatoonPunish // 蛋蛋能量-公排处罚
jobs[taskMd.CornEggEnergyAutoAdjustPrice] = taskEggEnergyAutoAdjustPrice // 蛋蛋能量-自动调整价格 jobs[taskMd.CornEggEnergyAutoAdjustPrice] = taskEggEnergyAutoAdjustPrice // 蛋蛋能量-自动调整价格
jobs[taskMd.CornEggEnergyAutoCommunityDividends] = taskEggEnergyCommunityDividends // 蛋蛋能量-社区分红 jobs[taskMd.CornEggEnergyAutoCommunityDividends] = taskEggEnergyCommunityDividends // 蛋蛋能量-社区分红

} }

+ 67
- 0
app/task/svc/svc_egg_energy_auto_update_user_access.go View File

@@ -0,0 +1,67 @@
package svc

import (
"applet/app/utils"
"applet/app/utils/logx"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/utils/es"
es2 "code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es"
"fmt"
"time"
"xorm.io/xorm"
)

// EggEnergyAutoUpdateUserAccess 自动更新用户访问次数记录
func EggEnergyAutoUpdateUserAccess(engine *xorm.Engine) {
fmt.Println("svc_egg_energy_auto_update_user_access...")
defer func() {
if err := recover(); err != nil {
fmt.Println(err)
return
}
}()

now := time.Now()
fmt.Println(now.Hour())
if !(now.Hour() >= 2 && now.Hour() < 6) {
//TODO::只在凌晨两点 ~ 凌晨六点运行
return
}

// 获取当周信息
year, week := time.Now().ISOWeek()
yearStr := utils.IntToStr(year)
weekStr := utils.IntToStr(week)
index := es.GetAppointIndexFromAlias(yearStr, weekStr)
page := 1
limit := 100
totalDb := implement.NewEggAccessTotalDb(engine)
for {
list, err := totalDb.EggAccessTotalGetByPage(year, week, page, limit)
if err != nil {
logx.Warn("EggEnergyAutoUpdateUserAccess:::", err)
return
}
ids := make([]string, 0, len(list))
updateInfoMap := make([]interface{}, 0, len(list))
for _, node := range list {
uid := node.Uid
id := fmt.Sprintf("%d%d-%d", year, week, uid)
ids = append(ids, id)
updateInfoMap = append(updateInfoMap, map[string]interface{}{
"browse_interface_nums": node.Total,
})
}
updateBulkDocRet, err := es2.UpdateBulkDoc(index, ids, updateInfoMap)
if err != nil {
logx.Warn("EggEnergyAutoUpdateUserAccess:::", err)
return
}
fmt.Printf("updateBulkDocRet ==> %+v \n\n", updateBulkDocRet)
if len(list) < limit {
break
} else {
page++
}
}
}

+ 83
- 64
docs/docs.go View File

@@ -1,5 +1,4 @@
// Code generated by swaggo/swag. DO NOT EDIT.

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs package docs


import "github.com/swaggo/swag" import "github.com/swaggo/swag"
@@ -1438,9 +1437,7 @@ const docTemplate = `{
"name": "req", "name": "req",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": {
"type": "object"
}
"schema": {}
} }
], ],
"responses": { "responses": {
@@ -7843,7 +7840,7 @@ const docTemplate = `{
"type": "integer" "type": "integer"
}, },
"tag_name": { "tag_name": {
"description": "标签 名称",
"description": "标签名称",
"type": "string" "type": "string"
} }
} }
@@ -9426,6 +9423,63 @@ const docTemplate = `{
} }
} }
}, },
"md.DynamicRespNode": {
"type": "object",
"properties": {
"content": {
"description": "文本内容",
"type": "string"
},
"created_at": {
"type": "string"
},
"image": {
"description": "图片",
"type": "array",
"items": {
"type": "string"
}
},
"index_id": {
"description": "动态id",
"type": "string"
},
"is_praise": {
"description": "是否被表扬(1:是 2:否)",
"type": "integer"
},
"is_top_up": {
"description": "是否置顶(1:是 2:否)",
"type": "integer"
},
"kind": {
"description": "类型(1:普通 2:官方)",
"type": "integer"
},
"state": {
"description": "状态(1:正常 2:隐藏)",
"type": "integer"
},
"uid": {
"description": "用户id",
"type": "integer"
},
"updated_at": {
"type": "string"
},
"username": {
"description": "用户名称",
"type": "string"
},
"video": {
"description": "视频",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"md.EggEnergyAvailableEnergyFlow": { "md.EggEnergyAvailableEnergyFlow": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -9586,57 +9640,6 @@ const docTemplate = `{
} }
} }
}, },
"md.EggFriendCircleNode": {
"type": "object",
"properties": {
"content": {
"description": "文本内容",
"type": "string"
},
"created_at": {
"type": "string"
},
"image": {
"description": "图片",
"type": "string"
},
"index_id": {
"description": "动态id",
"type": "string"
},
"is_praise": {
"description": "是否被表扬(1:是 2:否)",
"type": "integer"
},
"is_top_up": {
"description": "是否置顶(1:是 2:否)",
"type": "integer"
},
"kind": {
"description": "类型(1:普通 2:官方)",
"type": "integer"
},
"state": {
"description": "状态(1:正常 2:隐藏)",
"type": "integer"
},
"uid": {
"description": "用户id",
"type": "integer"
},
"updated_at": {
"type": "string"
},
"username": {
"description": "用户名称",
"type": "string"
},
"video": {
"description": "视频",
"type": "string"
}
}
},
"md.EggPointCoefficientBatchAddReq": { "md.EggPointCoefficientBatchAddReq": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -10146,7 +10149,7 @@ const docTemplate = `{
"list": { "list": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/md.EggFriendCircleNode"
"$ref": "#/definitions/md.DynamicRespNode"
} }
}, },
"paginate": { "paginate": {
@@ -12043,6 +12046,10 @@ const docTemplate = `{
"page_size": { "page_size": {
"type": "integer" "type": "integer"
}, },
"phone": {
"description": "手机号",
"type": "string"
},
"state": { "state": {
"description": "状态", "description": "状态",
"type": "integer" "type": "integer"
@@ -12056,6 +12063,10 @@ const docTemplate = `{
"type": "string", "type": "string",
"example": "备注" "example": "备注"
}, },
"name": {
"description": "表情名称",
"type": "string"
},
"page": { "page": {
"type": "integer" "type": "integer"
}, },
@@ -12199,14 +12210,17 @@ const docTemplate = `{
"md.ReleaseDynamicReq": { "md.ReleaseDynamicReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"[]image": {
"description": "图片",
"type": "string"
},
"content": { "content": {
"description": "文本内容", "description": "文本内容",
"type": "string" "type": "string"
}, },
"image": {
"description": "图片",
"type": "array",
"items": {
"type": "string"
}
},
"is_praise": { "is_praise": {
"description": "是否被表扬(1:是 2:否)", "description": "是否被表扬(1:是 2:否)",
"type": "integer" "type": "integer"
@@ -12224,8 +12238,11 @@ const docTemplate = `{
"type": "integer" "type": "integer"
}, },
"video": { "video": {
"description": "视频 uri",
"type": "string"
"description": "视频",
"type": "array",
"items": {
"type": "string"
}
} }
} }
}, },
@@ -14589,6 +14606,8 @@ var SwaggerInfo = &swag.Spec{
Description: "管理后台接口文档", Description: "管理后台接口文档",
InfoInstanceName: "swagger", InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate, SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
} }


func init() { func init() {


+ 80
- 62
docs/swagger.json View File

@@ -1430,9 +1430,7 @@
"name": "req", "name": "req",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": {
"type": "object"
}
"schema": {}
} }
], ],
"responses": { "responses": {
@@ -7835,7 +7833,7 @@
"type": "integer" "type": "integer"
}, },
"tag_name": { "tag_name": {
"description": "标签 名称",
"description": "标签名称",
"type": "string" "type": "string"
} }
} }
@@ -9418,6 +9416,63 @@
} }
} }
}, },
"md.DynamicRespNode": {
"type": "object",
"properties": {
"content": {
"description": "文本内容",
"type": "string"
},
"created_at": {
"type": "string"
},
"image": {
"description": "图片",
"type": "array",
"items": {
"type": "string"
}
},
"index_id": {
"description": "动态id",
"type": "string"
},
"is_praise": {
"description": "是否被表扬(1:是 2:否)",
"type": "integer"
},
"is_top_up": {
"description": "是否置顶(1:是 2:否)",
"type": "integer"
},
"kind": {
"description": "类型(1:普通 2:官方)",
"type": "integer"
},
"state": {
"description": "状态(1:正常 2:隐藏)",
"type": "integer"
},
"uid": {
"description": "用户id",
"type": "integer"
},
"updated_at": {
"type": "string"
},
"username": {
"description": "用户名称",
"type": "string"
},
"video": {
"description": "视频",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"md.EggEnergyAvailableEnergyFlow": { "md.EggEnergyAvailableEnergyFlow": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -9578,57 +9633,6 @@
} }
} }
}, },
"md.EggFriendCircleNode": {
"type": "object",
"properties": {
"content": {
"description": "文本内容",
"type": "string"
},
"created_at": {
"type": "string"
},
"image": {
"description": "图片",
"type": "string"
},
"index_id": {
"description": "动态id",
"type": "string"
},
"is_praise": {
"description": "是否被表扬(1:是 2:否)",
"type": "integer"
},
"is_top_up": {
"description": "是否置顶(1:是 2:否)",
"type": "integer"
},
"kind": {
"description": "类型(1:普通 2:官方)",
"type": "integer"
},
"state": {
"description": "状态(1:正常 2:隐藏)",
"type": "integer"
},
"uid": {
"description": "用户id",
"type": "integer"
},
"updated_at": {
"type": "string"
},
"username": {
"description": "用户名称",
"type": "string"
},
"video": {
"description": "视频",
"type": "string"
}
}
},
"md.EggPointCoefficientBatchAddReq": { "md.EggPointCoefficientBatchAddReq": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -10138,7 +10142,7 @@
"list": { "list": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/md.EggFriendCircleNode"
"$ref": "#/definitions/md.DynamicRespNode"
} }
}, },
"paginate": { "paginate": {
@@ -12035,6 +12039,10 @@
"page_size": { "page_size": {
"type": "integer" "type": "integer"
}, },
"phone": {
"description": "手机号",
"type": "string"
},
"state": { "state": {
"description": "状态", "description": "状态",
"type": "integer" "type": "integer"
@@ -12048,6 +12056,10 @@
"type": "string", "type": "string",
"example": "备注" "example": "备注"
}, },
"name": {
"description": "表情名称",
"type": "string"
},
"page": { "page": {
"type": "integer" "type": "integer"
}, },
@@ -12191,14 +12203,17 @@
"md.ReleaseDynamicReq": { "md.ReleaseDynamicReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"[]image": {
"description": "图片",
"type": "string"
},
"content": { "content": {
"description": "文本内容", "description": "文本内容",
"type": "string" "type": "string"
}, },
"image": {
"description": "图片",
"type": "array",
"items": {
"type": "string"
}
},
"is_praise": { "is_praise": {
"description": "是否被表扬(1:是 2:否)", "description": "是否被表扬(1:是 2:否)",
"type": "integer" "type": "integer"
@@ -12216,8 +12231,11 @@
"type": "integer" "type": "integer"
}, },
"video": { "video": {
"description": "视频 uri",
"type": "string"
"description": "视频",
"type": "array",
"items": {
"type": "string"
}
} }
} }
}, },


+ 59
- 46
docs/swagger.yaml View File

@@ -171,7 +171,7 @@ definitions:
description: 标签 ID description: 标签 ID
type: integer type: integer
tag_name: tag_name:
description: 标签 名称
description: 标签名称
type: string type: string
type: object type: object
applet_app_md_setCenter_oss_aliyun.GetBasicResp: applet_app_md_setCenter_oss_aliyun.GetBasicResp:
@@ -1266,6 +1266,47 @@ definitions:
paginate: paginate:
$ref: '#/definitions/applet_app_md_institutional_management_egg_energy.Paginate' $ref: '#/definitions/applet_app_md_institutional_management_egg_energy.Paginate'
type: object type: object
md.DynamicRespNode:
properties:
content:
description: 文本内容
type: string
created_at:
type: string
image:
description: 图片
items:
type: string
type: array
index_id:
description: 动态id
type: string
is_praise:
description: 是否被表扬(1:是 2:否)
type: integer
is_top_up:
description: 是否置顶(1:是 2:否)
type: integer
kind:
description: 类型(1:普通 2:官方)
type: integer
state:
description: 状态(1:正常 2:隐藏)
type: integer
uid:
description: 用户id
type: integer
updated_at:
type: string
username:
description: 用户名称
type: string
video:
description: 视频
items:
type: string
type: array
type: object
md.EggEnergyAvailableEnergyFlow: md.EggEnergyAvailableEnergyFlow:
properties: properties:
after_community_dividends: after_community_dividends:
@@ -1382,43 +1423,6 @@ definitions:
uid: uid:
type: integer type: integer
type: object type: object
md.EggFriendCircleNode:
properties:
content:
description: 文本内容
type: string
created_at:
type: string
image:
description: 图片
type: string
index_id:
description: 动态id
type: string
is_praise:
description: 是否被表扬(1:是 2:否)
type: integer
is_top_up:
description: 是否置顶(1:是 2:否)
type: integer
kind:
description: 类型(1:普通 2:官方)
type: integer
state:
description: 状态(1:正常 2:隐藏)
type: integer
uid:
description: 用户id
type: integer
updated_at:
type: string
username:
description: 用户名称
type: string
video:
description: 视频
type: string
type: object
md.EggPointCoefficientBatchAddReq: md.EggPointCoefficientBatchAddReq:
properties: properties:
list: list:
@@ -1771,7 +1775,7 @@ definitions:
properties: properties:
list: list:
items: items:
$ref: '#/definitions/md.EggFriendCircleNode'
$ref: '#/definitions/md.DynamicRespNode'
type: array type: array
paginate: paginate:
allOf: allOf:
@@ -3088,6 +3092,9 @@ definitions:
type: integer type: integer
page_size: page_size:
type: integer type: integer
phone:
description: 手机号
type: string
state: state:
description: 状态 description: 状态
type: integer type: integer
@@ -3097,6 +3104,9 @@ definitions:
memo: memo:
example: 备注 example: 备注
type: string type: string
name:
description: 表情名称
type: string
page: page:
type: integer type: integer
page_size: page_size:
@@ -3200,12 +3210,14 @@ definitions:
type: object type: object
md.ReleaseDynamicReq: md.ReleaseDynamicReq:
properties: properties:
'[]image':
description: 图片
type: string
content: content:
description: 文本内容 description: 文本内容
type: string type: string
image:
description: 图片
items:
type: string
type: array
is_praise: is_praise:
description: 是否被表扬(1:是 2:否) description: 是否被表扬(1:是 2:否)
type: integer type: integer
@@ -3219,8 +3231,10 @@ definitions:
description: 状态(1:正常 2:隐藏) description: 状态(1:正常 2:隐藏)
type: integer type: integer
video: video:
description: 视频 uri
type: string
description: 视频
items:
type: string
type: array
type: object type: object
md.Response: md.Response:
properties: properties:
@@ -5778,8 +5792,7 @@ paths:
in: body in: body
name: req name: req
required: true required: true
schema:
type: object
schema: {}
produces: produces:
- application/json - application/json
responses: responses:


+ 40
- 12
etc/task.yml View File

@@ -1,18 +1,14 @@
# debug release test
# 当前域名
debug: true debug: true
curldebug: true
prd: false prd: false
local: true local: true
# 服务器参数
srv_addr: ':4001'
# 缓存 # 缓存
redis_addr: '120.24.28.6:32572'
redis_addr: '127.0.0.1:6379'
redis_password: ''


app_comm:
url: http://127.0.0.1:5003


admin:
api_aes_key: e{&[^<wpliI$AgKs:>Ft(.~g]1eR-]VO
api_aes_iv: ZV`7<5X]/2brS@sz
# 数据库
db: db:
host: '119.23.182.117:3306' host: '119.23.182.117:3306'
name: 'egg' name: 'egg'
@@ -22,10 +18,22 @@ db:
max_lifetime: 30 max_lifetime: 30
max_open_conns: 100 max_open_conns: 100
max_idle_conns: 100 max_idle_conns: 100
path: 'tmp/task_sql_%v.log'
path: 'tmp/%s.log'

im_db:
host: '119.23.182.117:3306'
name: 'egg-im'
user: 'root'
psw: 'Fnuo123com@'
show_log: true
max_lifetime: 30
max_open_conns: 100
max_idle_conns: 100
path: 'tmp/%s.log'


# 日志 # 日志
log: log:
app_name: 'applet'
level: 'debug' # 普通日志级别 #debug, info, warn, fatal, panic level: 'debug' # 普通日志级别 #debug, info, warn, fatal, panic
is_stdout: true is_stdout: true
time_format: 'standard' # sec, second, milli, nano, standard, iso time_format: 'standard' # sec, second, milli, nano, standard, iso
@@ -34,4 +42,24 @@ log:
file_dir: './tmp/' file_dir: './tmp/'
file_max_size: 256 file_max_size: 256
file_max_age: 1 file_max_age: 1
file_name: 'task.log'
file_name: 'debug.log'

# 连接RabbitMq
mq:
host: '120.77.153.180'
port: '15672'
user: 'guest'
pwd: 'guest'

es:
url: 'http://120.55.48.175:9200'
user: 'elastic'
pwd: 'fnuo123'

im_business_rpc:
url: im-rpc-business.izhim.com
port: 1005

im_logic_rpc:
url: im-rpc-logic.izhim.com
port: 1008

+ 1
- 1
go.mod View File

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


require ( require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241206061858-d583849c70ea
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241207095049-e0ad89412565
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


+ 55
- 0
k8s/container-task.yaml View File

@@ -0,0 +1,55 @@
kind: Deployment
apiVersion: apps/v1
# 元数据
metadata:
name: egg-admin-task
namespace: egg
labels:
app: egg-admin-task
annotations:
kubesphere.io/creator: admin
kubesphere.io/description: egg-admin-task
# deployment主要部分
spec:
replicas: 1
selector:
matchLabels:
# 名称与上面的labels对应
app: egg-admin-task
template:
metadata:
labels:
# 名称与上面的matchLabels对应
app: egg-admin-task
spec:
# 声明挂载卷(将外部已存在的pvc、config等挂载进来)
volumes:
# 用于时区校正
- name: host-time
hostPath:
path: /etc/localtime
type: ''
# 将前面创建的configMap也挂载进来
- name: egg-admin-task-cfg
configMap:
# 这里的名字就是前面创建的configMap的名字
name: egg-admin-task-cfg
defaultMode: 420
containers:
# 主容器
- name: egg-admin-task-container
# 镜像地址(提前打包好并推送的镜像仓库)
image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/egg-admin-task:0.0.1'
# 将前面volume声明的需要用到的pvc、config挂载上来
volumeMounts:
- name: host-time
readOnly: true
mountPath: /etc/localtime
- name: egg-admin-task-cfg # 该名字对应前面volumes声明的名字
readOnly: true
# 挂载到容器的哪个路径
mountPath: /var/egg
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst

Loading…
Cancel
Save