dengbiao 8 godzin temu
rodzic
commit
6c4882158f
21 zmienionych plików z 4666 dodań i 482 usunięć
  1. +235
    -0
      app/hdl/financial_center/hdl_withdraw.go
  2. +4
    -4
      app/hdl/im/hdl_customer_service.go
  3. +5
    -5
      app/hdl/im/hdl_emoticon.go
  4. +91
    -0
      app/hdl/institutional_management/egg_energy/hdl_contribution_value.go
  5. +1
    -1
      app/hdl/marketing_applications/new_user_red_package/hdl_basic.go
  6. +11
    -11
      app/hdl/member_center/hdl_level__management.go
  7. +7
    -7
      app/hdl/member_center/hdl_tag__management.go
  8. +6
    -1
      app/hdl/member_center/hdl_user_management.go
  9. +111
    -0
      app/md/financial_center/md_withdraw.go
  10. +17
    -0
      app/md/institutional_management/egg_energy/md_contribution_value.go
  11. +0
    -0
      app/md/marketing_applications/new_user_red_package/md_basic.go
  12. +0
    -0
      app/md/member_center/md_level_management.go
  13. +0
    -0
      app/md/member_center/md_tag_management.go
  14. +6
    -1
      app/md/member_center/md_user_management.go
  15. +16
    -0
      app/router/router.go
  16. +91
    -0
      app/svc/financial_center/svc_withdraw.go
  17. +1
    -1
      app/svc/member_center/svc_user_management.go
  18. +1504
    -158
      docs/docs.go
  19. +1504
    -158
      docs/swagger.json
  20. +1054
    -133
      docs/swagger.yaml
  21. +2
    -2
      go.mod

+ 235
- 0
app/hdl/financial_center/hdl_withdraw.go Wyświetl plik

@@ -0,0 +1,235 @@
package financial_center

import (
"applet/app/db"
"applet/app/e"
md "applet/app/md/financial_center"
svc "applet/app/svc/financial_center"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md"
"github.com/gin-gonic/gin"
"time"
)

// GetWithdrawSetting
// @Summary 财务中心-提现-基础设置(获取)
// @Tags 提现
// @Description 基础设置(获取)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} md.GetWithdrawSettingResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/financialCenter/withdraw/setting [get]
func GetWithdrawSetting(c *gin.Context) {
settingDb := implement.NewFinWithdrawSettingDb(db.Db)
setting, err := settingDb.FinWithdrawSettingGetOne()
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
// 不存在则初始化
if setting == nil {
now := time.Now()
frequency := md2.WithdrawFrequencySettingStruct{
Duration: 0,
Num: 0,
}
frequencyStr := utils.SerializeStr(frequency)
m := model.FinWithdrawSetting{
FrequencySet: frequencyStr,
WithdrawType: 0,
VipLevelLimit: 0,
IsRealName: 0,
WithdrawNumsLimit: 0,
WithdrawAmountLimit: "",
WithdrawMultipleLimit: "",
IsSupportDecimalPoint: 0,
IsAuto: 0,
WithdrawTimeInterval: "",
WithdrawFeeSet: "",
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: "",
}
_, err2 := settingDb.FinWithdrawSettingInsert(&m)
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
return
}

setting, err = settingDb.FinWithdrawSettingGetOne()
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
}
var frequency md2.WithdrawFrequencySettingStruct
utils.Unserialize([]byte(setting.FrequencySet), &frequency)
resp := md.GetWithdrawSettingResp{
Id: setting.Id,
FrequencySet: frequency,
WithdrawType: setting.WithdrawType,
VipLevelLimit: setting.VipLevelLimit,
IsRealName: setting.IsRealName,
WithdrawNumsLimit: setting.WithdrawNumsLimit,
WithdrawAmountLimit: setting.WithdrawAmountLimit,
WithdrawMultipleLimit: setting.WithdrawMultipleLimit,
IsSupportDecimalPoint: setting.IsSupportDecimalPoint,
IsAuto: setting.IsAuto,
WithdrawTimeInterval: setting.WithdrawTimeInterval,
WithdrawFeeSet: setting.WithdrawFeeSet,
CreateAt: setting.CreateAt,
UpdateAt: setting.UpdateAt,
}

e.OutSuc(c, resp, nil)
}

// UpdateWithdrawSetting
// @Summary 财务中心-提现-基础设置(更新)
// @Tags 提现
// @Description 基础设置(更新)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.UpdateWithdrawSettingReq true "id 必填"
// @Success 200 {int} "修改数据条数"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/financialCenter/withdraw/updateWithdrawSetting [POST]
func UpdateWithdrawSetting(c *gin.Context) {
var req *md.UpdateWithdrawSettingReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}
frequencyStr := utils.SerializeStr(req.FrequencySet)
m := model.FinWithdrawSetting{
Id: req.Id,
FrequencySet: frequencyStr,
WithdrawType: req.WithdrawType,
VipLevelLimit: req.VipLevelLimit,
IsRealName: req.IsRealName,
WithdrawNumsLimit: req.WithdrawNumsLimit,
WithdrawAmountLimit: req.WithdrawAmountLimit,
WithdrawMultipleLimit: req.WithdrawMultipleLimit,
IsSupportDecimalPoint: req.IsSupportDecimalPoint,
IsAuto: req.IsAuto,
WithdrawTimeInterval: req.WithdrawTimeInterval,
WithdrawFeeSet: req.WithdrawFeeSet,
}

forceColumns := []string{"withdraw_type", "is_real_name", "withdraw_nums_limit", "withdraw_amount_limit", "withdraw_multiple_limit", "is_support_decimal_point", "is_auto"}
settingDb := implement.NewFinWithdrawSettingDb(db.Db)
affected, err := settingDb.FinWithdrawSettingUpdate(req.Id, &m, forceColumns...)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
e.OutSuc(c, affected, nil)
}

// GetWithdrawApplyList
// @Summary 财务中心-提现-提现申请列表(获取)
// @Tags 提现
// @Description 提现申请列表(获取)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.GetWithdrawApplyListReq false "筛选条件"
// @Success 200 {object} md.GetWithdrawApplyListResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/financialCenter/withdraw/applyList [POST]
func GetWithdrawApplyList(c *gin.Context) {
var req *md.GetWithdrawApplyListReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}

levelDb := implement.NewUserLevelDb(db.Db)
levels, err1 := levelDb.UserLevelAllByAsc()
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
return
}
levelsList := make([]map[string]interface{}, 0)
levelsMap := make(map[int]string)
for _, level := range levels {
levelsList = append(levelsList, map[string]interface{}{
"id": level.Id,
"name": level.LevelName,
})
levelsMap[level.Id] = level.LevelName
}

tagDb := implement.NewUserTagDb(db.Db)
tags, err2 := tagDb.UserTagAllByAsc()
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
return
}
tagsList := make([]map[string]interface{}, 0)
tagsMap := make(map[int]string)
for _, tag := range tags {
tagsList = append(tagsList, map[string]interface{}{
"id": tag.Id,
"name": tag.TagName,
})
tagsMap[tag.Id] = tag.TagName
}

applies, total, err3 := svc.WithDrawManagementGetApply(db.Db, req)
if err3 != nil {
e.OutErr(c, e.ERR_DB_ORM, err3.Error())
return
}

list := make([]md.GetWithdrawApplyListNode, len(*applies))
for i, apply := range *applies {
list[i] = md.GetWithdrawApplyListNode{
UserID: apply.UserID,
Nickname: apply.Nickname,
ParentID: apply.ParentID,
ParentPhone: apply.ParentPhone,
WithdrawType: apply.WithdrawType,
InviteCode: apply.InviteCode,
Amount: apply.Amount,
ActualReceipt: "",
SysFee: apply.SysFee,
State: apply.State,
ApplyAt: apply.ApplyAt,
PayAt: apply.PayAt,
Memo: apply.Memo,
}
if apply.Amount != "" && apply.SysFee != "" {
actualReceipt := utils.StrToFloat64(apply.Amount) - utils.StrToFloat64(apply.SysFee)
list[i].ActualReceipt = utils.Float64ToStr(actualReceipt)
}
switch apply.WithdrawType {
case 1:
list[i].AliPayName = apply.PayName
list[i].AliPayAccount = apply.PayAccount
case 2:
list[i].WechatPayName = apply.PayName
list[i].WechatPayAccount = apply.PayAccount
}
tag, ok := tagsMap[apply.Tag]
if ok {
list[i].Tag = tag
}
}

resp := md.GetWithdrawApplyListResp{
LevelsList: levelsList,
TagsList: tagsList,
List: list,
Paginate: md.Paginate{
Limit: req.Limit,
Page: req.Page,
Total: total,
},
}
e.OutSuc(c, resp, nil)
}

+ 4
- 4
app/hdl/im/hdl_customer_service.go Wyświetl plik

@@ -14,7 +14,7 @@ import (
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.PageCustomerServiceReq true
// @param req body md.PageCustomerServiceReq true "相关参数"
// @Success 200 {object} md.GetBasicResp "设置列表"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/pageCustomerService [POST]
@@ -39,7 +39,7 @@ func PageCustomerService(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.AddCustomerServiceReq true
// @param req body md.AddCustomerServiceReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/addCustomerService [post]
@@ -65,7 +65,7 @@ func AddCustomerService(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.SetCustomerServiceStateReq true
// @param req body md.SetCustomerServiceStateReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/setCustomerServiceState [post]
@@ -91,7 +91,7 @@ func SetCustomerServiceState(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.UpdateCustomerServiceMemoReq true
// @param req body md.UpdateCustomerServiceMemoReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/updateCustomerServiceMemo [post]


+ 5
- 5
app/hdl/im/hdl_emoticon.go Wyświetl plik

@@ -14,7 +14,7 @@ import (
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.PageEmoticonReq true
// @param req body md.PageEmoticonReq true "相关参数"
// @Success 200 {object} md.GetBasicResp "设置列表"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/pageEmoticon [POST]
@@ -39,7 +39,7 @@ func PageEmoticon(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.AddEmoticonReq true
// @param req body md.AddEmoticonReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/addEmoticon [post]
@@ -65,7 +65,7 @@ func AddEmoticon(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.SetEmoticonStateReq true
// @param req body md.SetEmoticonStateReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/setEmoticonState [post]
@@ -91,7 +91,7 @@ func SetEmoticonState(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.UpdateEmoticonReq true
// @param req body md.UpdateEmoticonReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/updateEmoticon [post]
@@ -117,7 +117,7 @@ func UpdateEmoticon(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.DeleteEmoticonReq true
// @param req body md.DeleteEmoticonReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/deleteEmoticon [post]


+ 91
- 0
app/hdl/institutional_management/egg_energy/hdl_contribution_value.go Wyświetl plik

@@ -0,0 +1,91 @@
package egg_energy

import (
"applet/app/db"
"applet/app/e"
md "applet/app/md/institutional_management/egg_energy"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"github.com/gin-gonic/gin"
)

// GetContributionValueBasicSetting
// @Summary 制度中心-蛋蛋能量-贡献值-基础设置(获取)
// @Tags 贡献值
// @Description 贡献值-基础设置(获取)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} md.GetContributionValueBasicSettingResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/institutionalManagement/eggEnergy/contributionValue/basic [get]
func GetContributionValueBasicSetting(c *gin.Context) {
settingDb := implement.NewContributionValueBasicSettingDb(db.Db)
setting, err := settingDb.ContributionValueBasicSettingGetOne()
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, nil)
return
}
if setting == nil {
m := model.ContributionValueBasicSetting{
PostingDynamicLiked: 0,
PostingCommentLiked: 0,
HandOutRedPackage: 0,
PublishCreation: 0,
}
_, err := settingDb.ContributionValueBasicSettingInsert(&m)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, nil)
return
}
setting, err = settingDb.ContributionValueBasicSettingGetOne()
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, nil)
return
}
}
resp := md.GetContributionValueBasicSettingResp{
Id: setting.Id,
PostingDynamicLiked: setting.PostingDynamicLiked,
PostingCommentLiked: setting.PostingCommentLiked,
HandOutRedPackage: setting.HandOutRedPackage,
PublishCreation: setting.PublishCreation,
}

e.OutSuc(c, resp, nil)
}

// UpdateContributionValueBasicSetting
// @Summary 制度中心-蛋蛋能量-贡献值-基础设置(更新)
// @Tags 贡献值
// @Description 贡献值-基础设置(更新)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.UpdateContributionValueBasicSettingReq true "id 必填"
// @Success 200 {int} "修改数据条数"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/institutionalManagement/eggEnergy/contributionValue/updateBasic [POST]
func UpdateContributionValueBasicSetting(c *gin.Context) {
var req *md.UpdateContributionValueBasicSettingReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}

settingDb := implement.NewContributionValueBasicSettingDb(db.Db)
m := model.ContributionValueBasicSetting{
PostingDynamicLiked: utils.StrToInt(req.PostingDynamicLiked),
PostingCommentLiked: utils.StrToInt(req.PostingCommentLiked),
HandOutRedPackage: utils.StrToInt(req.HandOutRedPackage),
PublishCreation: utils.StrToInt(req.PublishCreation),
}
forceColumns := []string{"publish_creation", "hand_out_red_package", "posting_comment_liked", "posting_dynamic_liked"}
affected, err := settingDb.ContributionValueBasicSettingUpdate(req.Id, &m, forceColumns...)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err)
return
}
e.OutSuc(c, affected, nil)
}

+ 1
- 1
app/hdl/marketing_applications/new_user_red_package/hdl_basic.go Wyświetl plik

@@ -3,7 +3,7 @@ package new_user_red_package
import (
"applet/app/db"
"applet/app/e"
md "applet/app/md/institutional_management/new_user_red_package"
"applet/app/md/marketing_applications/new_user_red_package"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"github.com/gin-gonic/gin"


+ 11
- 11
app/hdl/member_center/hdl_level__management.go Wyświetl plik

@@ -3,7 +3,7 @@ package member_center
import (
"applet/app/db"
"applet/app/e"
md "applet/app/md/institutional_management/member_center"
md2 "applet/app/md/member_center"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
@@ -47,7 +47,7 @@ func GetLevelList(c *gin.Context) {
countMap[utils.StrToInt(res["level"])] = res["total"]
}

list := make([]md.LevelListNode, 0)
list := make([]md2.LevelListNode, 0)
for i, level := range levels {
list[i].LevelWeight = level.LevelWeight
list[i].LevelID = level.Id
@@ -58,9 +58,9 @@ func GetLevelList(c *gin.Context) {
list[i].Memo = level.Memo
}

resp := md.GetLevelListResp{
resp := md2.GetLevelListResp{
List: list,
Paginate: md.Paginate{
Paginate: md2.Paginate{
Limit: utils.StrToInt(limit),
Page: utils.StrToInt(page),
Total: total,
@@ -120,7 +120,7 @@ func GetOneLevel(c *gin.Context) {
return
}

resp := md.GetOneLevelResp{
resp := md2.GetOneLevelResp{
TaskType: taskType,
LevelID: level.Id,
IsUse: level.IsUse,
@@ -147,7 +147,7 @@ func GetOneLevel(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/levelManagement/addLevelTask [post]
func AddLevelTask(c *gin.Context) {
var req *md.AddLevelTaskReq
var req *md2.AddLevelTaskReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return
@@ -195,7 +195,7 @@ func AddLevelTask(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/levelManagement/updateLevelTask [post]
func UpdateLevelTask(c *gin.Context) {
var req *md.UpdateLevelTaskReq
var req *md2.UpdateLevelTaskReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return
@@ -241,7 +241,7 @@ func UpdateLevelTask(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/levelManagement/updateLevel [post]
func UpdateLevel(c *gin.Context) {
var req *md.UpdateLevelReq
var req *md2.UpdateLevelReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return
@@ -285,7 +285,7 @@ func UpdateLevel(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/levelManagement/addLevel [post]
func AddLevel(c *gin.Context) {
var req *md.AddLevelReq
var req *md2.AddLevelReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return
@@ -328,7 +328,7 @@ func AddLevel(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/levelManagement/deleteLevelTask [delete]
func DeleteLevelTask(c *gin.Context) {
var req *md.DeleteTaskReq
var req *md2.DeleteTaskReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return
@@ -355,7 +355,7 @@ func DeleteLevelTask(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/levelManagement/deleteLevel [delete]
func DeleteLevel(c *gin.Context) {
var req *md.DeleteLevelReq
var req *md2.DeleteLevelReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return


+ 7
- 7
app/hdl/member_center/hdl_tag__management.go Wyświetl plik

@@ -3,7 +3,7 @@ package member_center
import (
"applet/app/db"
"applet/app/e"
md "applet/app/md/institutional_management/member_center"
md2 "applet/app/md/member_center"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
@@ -45,7 +45,7 @@ func GetTagList(c *gin.Context) {
return
}

list := make([]md.TagListNode, len(*tags))
list := make([]md2.TagListNode, len(*tags))
for i, tag := range *tags {
list[i].Name = tag.TagName
list[i].Count = countMap[int64(tag.Id)]
@@ -53,9 +53,9 @@ func GetTagList(c *gin.Context) {
list[i].Memo = tag.Memo
}

resp := md.GetTagListResp{
resp := md2.GetTagListResp{
List: list,
Paginate: md.Paginate{
Paginate: md2.Paginate{
Limit: utils.StrToInt(limit),
Page: utils.StrToInt(page),
Total: total,
@@ -76,7 +76,7 @@ func GetTagList(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/tagManagement/addTag [post]
func AddTag(c *gin.Context) {
var req *md.AddTagReq
var req *md2.AddTagReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return
@@ -111,7 +111,7 @@ func AddTag(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/tagManagement/updateTag [post]
func UpdateTag(c *gin.Context) {
var req *md.UpdateTagReq
var req *md2.UpdateTagReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return
@@ -147,7 +147,7 @@ func UpdateTag(c *gin.Context) {
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/memberCenter/tagManagement/deleteTag [delete]
func DeleteTag(c *gin.Context) {
var req *md.DeleteTagReq
var req *md2.DeleteTagReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return


+ 6
- 1
app/hdl/member_center/hdl_user_management.go Wyświetl plik

@@ -3,7 +3,7 @@ package member_center
import (
"applet/app/db"
"applet/app/e"
md "applet/app/md/institutional_management/member_center"
"applet/app/md/member_center"
svc "applet/app/svc/member_center"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
@@ -81,6 +81,7 @@ func UserManagementGetUserList(c *gin.Context) {
for i, user := range *users {
list[i] = md.UserManagementGetUserListNode{
ID: user.Id,
Sex: user.Sex,
Avatar: user.Avatar,
Nickname: user.Nickname,
Phone: user.Phone,
@@ -91,6 +92,10 @@ func UserManagementGetUserList(c *gin.Context) {
ParentPhone: user.Phone,
RegisterTime: user.CreateAt,
Memo: user.Memo,
Wechat: user.UnionId,
RegisterType: user.RegisterType,
State: user.State,
LastLoginAt: user.UpdateAt,
}
tag, ok := tagsMap[user.TagID]
if ok {


+ 111
- 0
app/md/financial_center/md_withdraw.go Wyświetl plik

@@ -0,0 +1,111 @@
package md

import (
"code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md"
)

type Paginate struct {
Limit int `json:"limit"` // 每页大小
Page int `json:"page"` // 页数
Total int64 `json:"total"` // 总数据量
}

type GetWithdrawSettingResp struct {
Id int64 `json:"id"`
FrequencySet md.WithdrawFrequencySettingStruct `json:"frequency_set"` // 频率设置(0:日 1:周 2:月 3:年)
WithdrawType int `json:"withdraw_type"` // 提现方式(1:支付宝 2:微信)
VipLevelLimit int `json:"vip_level_limit"` // 提现等级限制
IsRealName int `json:"is_real_name"` // 是否实名(0:否 1:是)
WithdrawNumsLimit int `json:"withdraw_nums_limit"` // 提现次数限制(对应上方设置周期,0为不限制,失败、驳回不计数 )
WithdrawAmountLimit string `json:"withdraw_amount_limit"` // 提现金额限制(0为不限制,大于等于该金额才可以申请提现 )
WithdrawMultipleLimit string `json:"withdraw_multiple_limit"` // 提现倍数限制(0为不限制,金额限制倍数才可以申请提现 )
IsSupportDecimalPoint int `json:"is_support_decimal_point"` // 是否支持小数点(0:否 1:是)
IsAuto int `json:"is_auto"` // 是否开启自动提现(0:否 1:是)
WithdrawTimeInterval string `json:"withdraw_time_interval"` // 提现时段
WithdrawFeeSet string `json:"withdraw_fee_set"` // 提现手续费设置
CreateAt string `json:"create_at"` // 申请时间
UpdateAt string `json:"update_at"` // 处理时间
}

type UpdateWithdrawSettingReq struct {
Id int64 `json:"id,required"`
FrequencySet md.WithdrawFrequencySettingStruct `json:"frequency_set"` // 频率设置(num 个 duration) (duration (0.天 1.小时 2.周 3.月 4.年))
WithdrawType int `json:"withdraw_type"` // 提现方式(1:支付宝 2:微信)
VipLevelLimit int `json:"vip_level_limit"` // 提现等级限制
IsRealName int `json:"is_real_name"` // 是否实名(0:否 1:是)
WithdrawNumsLimit int `json:"withdraw_nums_limit"` // 提现次数限制(对应上方设置周期,0为不限制,失败、驳回不计数 )
WithdrawAmountLimit string `json:"withdraw_amount_limit"` // 提现金额限制(0为不限制,大于等于该金额才可以申请提现 )
WithdrawMultipleLimit string `json:"withdraw_multiple_limit"` // 提现倍数限制(0为不限制,金额限制倍数才可以申请提现 )
IsSupportDecimalPoint int `json:"is_support_decimal_point"` // 是否支持小数点(0:否 1:是)
IsAuto int `json:"is_auto"` // 是否开启自动提现(0:否 1:是)
WithdrawTimeInterval string `json:"withdraw_time_interval"` // 提现时段
WithdrawFeeSet string `json:"withdraw_fee_set"` // 提现手续费设置
}

type GetWithdrawApplyListReq struct {
Uid string `json:"uid"` // 用户 ID
Nickname string `json:"nickname"` // 用户昵称
Phone string `json:"phone"` // 用户手机号
ParentID string `json:"parent_id"` // 推荐人 ID
IsFirst string `json:"is_first"` // 是否首次提现 (0. 否 1.是 传空查全部)
WithdrawType string `json:"withdraw_type"` // 提现方式(1:支付宝 2:微信)
WithdrawAccount string `json:"withdraw_account"` // 支付宝/微信昵称
WithdrawName string `json:"withdraw_name"` // 支付宝姓名
PaymentType string `json:"payment_type"` // 打款类型 1:手动;2:自动
State string `json:"state"` // 状态 0申请中,1通过,2完成,3失败,4处理中(队列)
ApplyStartAt string `json:"apply_start_at"` // 申请开始时间
ApplyEndAt string `json:"apply_end_at"` // 申请结束时间
ExamineStartAt string `json:"examine_start_at"` // 审核开始时间
ExamineEndAt string `json:"examine_end_at"` // 审核结束时间
AmountBegin string `json:"amount_begin"` // 最小金额
AmountEnd string `json:"amount_end"` // 最大金额
Level string `json:"level"` // 会员等级
Page int `json:"page"` // 页数
Limit int `json:"limit"` //页面大小
}

type WithdrawApplyInfo struct {
UserID int64 `xorm:"usera.id"` // 会员 ID
Nickname string `xorm:"usera.nickname"` // 用户名称
ParentID int64 `xorm:"parent_id"` // 推荐人ID
ParentPhone string `xorm:"userb.phone"` // 推荐人手机号
PayName string `json:"apply.withdraw_name"` // 支付宝/微信昵称
PayAccount string `json:"apply.withdraw_account"` // 支付宝/微信账号
Tag int `json:"tag.id"` // 标签
WithdrawType int `json:"wallet_flow.withdraw_type"` // 提现方式(1:支付宝 2:微信)
InviteCode string `json:"usera.system_invite_code"` // 邀请码
Amount string `json:"apply.amount"` // 提现金额
SysFee string `json:"wallet_flow.sys_fee"` // 手续费
State int `json:"apply.state"` // 状态 0申请中,1通过,2完成,3失败,4处理中(队列)
ApplyAt string `json:"apply.create_at"` // 申请时间
PayAt string `json:"wallet_flow.create_at"` // 到账时间
Memo string `json:"apply.memo"` // 备注
}

type GetWithdrawApplyListResp struct {
LevelsList []map[string]interface{} `json:"levels_list"` // 等级列表
TagsList []map[string]interface{} `json:"tags_list"` // 标签列表
List []GetWithdrawApplyListNode `json:"list"`
Paginate Paginate `json:"paginate"` // 分页信息
}

type GetWithdrawApplyListNode struct {
UserID int64 `json:"user_id"` // 会员 ID
Nickname string `json:"nickname"` // 用户名称
ParentID int64 `xorm:"parent_id"` // 推荐人ID
ParentPhone string `xorm:"parent_phone"` // 推荐人手机号
AliPayName string `json:"ali_pay_name"` // 支付宝昵称
WechatPayName string `json:"wechat_pay_name"` // 微信昵称
AliPayAccount string `json:"ali_pay_account"` // 支付宝账号
WechatPayAccount string `json:"wechat_pay_account"` // 微信账号
Tag string `json:"tag"` // 标签
WithdrawType int `json:"withdraw_type"` // 提现方式(1:支付宝 2:微信)
InviteCode string `json:"invite_code"` // 邀请码
Amount string `json:"amount"` // 提现金额
ActualReceipt string `json:"actual_receipt"` // 实际到账
SysFee string `json:"sys_fee"` // 手续费
State int `json:"state"` // 状态 0申请中,1通过,2完成,3失败,4处理中(队列)
ApplyAt string `json:"apply_at"` // 申请时间
PayAt string `json:"pay_at"` // 到账时间
Memo string `json:"memo"` // 备注
}

+ 17
- 0
app/md/institutional_management/egg_energy/md_contribution_value.go Wyświetl plik

@@ -0,0 +1,17 @@
package md

type GetContributionValueBasicSettingResp struct {
Id int `json:"id"`
PostingDynamicLiked int `json:"posting_dynamic_liked"` // 发布动态被官方点赞获得x点
PostingCommentLiked int `json:"posting_comment_liked"` // 发布评论被官方点赞获得x点
HandOutRedPackage int `json:"hand_out_red_package"` // 发红包获得x点
PublishCreation int `json:"publish_creation"` // 发布创作获得x点
}

type UpdateContributionValueBasicSettingReq struct {
Id string `json:"id,required"`
PostingDynamicLiked string `json:"posting_dynamic_liked"` // 发布动态被官方点赞获得x点
PostingCommentLiked string `json:"posting_comment_liked"` // 发布评论被官方点赞获得x点
HandOutRedPackage string `json:"hand_out_red_package"` // 发红包获得x点
PublishCreation string `json:"publish_creation"` // 发布创作获得x点
}

app/md/institutional_management/new_user_red_package/md_basic.go → app/md/marketing_applications/new_user_red_package/md_basic.go Wyświetl plik


app/md/institutional_management/member_center/md_level_management.go → app/md/member_center/md_level_management.go Wyświetl plik


app/md/institutional_management/member_center/md_tag_management.go → app/md/member_center/md_tag_management.go Wyświetl plik


app/md/institutional_management/member_center/md_user_management.go → app/md/member_center/md_user_management.go Wyświetl plik

@@ -13,7 +13,7 @@ type UserManagementGetUserListReq struct {
InviteCode string `json:"invite_code" example:"会员邀请码"`
ParentInviteCode string `json:"parent_invite_code" example:"上级邀请码"`
ParentPhone string `json:"parent_phone" example:"上级手机号"`
Sex int `json:"sex"` // 性别
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
UnionId string `json:"union_id" example:"微信号"`
Level int `json:"level"` // 会员等级
RegisterType int `json:"register_type"` // 注册类型(1:APP注册、2:H5注册)
@@ -38,6 +38,7 @@ type Paginate struct {
type UserManagementGetUserListNode struct {
ID int64 `json:"id"` // 会员 ID
Tag string `json:"tag_name"` // 会员标签
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
Avatar string `json:"avatar"` // 头像
Nickname string `json:"nickname"` // 昵称
Phone string `json:"phone"` // 手机号
@@ -49,6 +50,10 @@ type UserManagementGetUserListNode struct {
ParentPhone string `json:"parent_phone" example:"推荐人手机号"`
RegisterTime string `json:"register_time"` // 注册时间
Memo string `json:"memo"` // 备注
Wechat string `json:"wechat"` // 微信号
RegisterType int `json:"register_type"` // 注册类型
State int `json:"state"` // 状态
LastLoginAt string `json:"last_login_at"` // 最后登录时间
}

type UserManagementGetUserListResp struct {

+ 16
- 0
app/router/router.go Wyświetl plik

@@ -4,6 +4,7 @@ import (
"applet/app/cfg"
"applet/app/hdl"
"applet/app/hdl/comm"
"applet/app/hdl/financial_center"
"applet/app/hdl/im"
"applet/app/hdl/institutional_management/egg_energy"
"applet/app/hdl/institutional_management/public_platoon"
@@ -63,6 +64,7 @@ func route(r *gin.RouterGroup) {
rMarketingApplications(r.Group("/marketingApplications"))
rMemberCenter(r.Group("/memberCenter"))
rSettCenter(r.Group("/settCenter"))
rFinancialCenter(r.Group("/financialCenter"))
}

func rSettCenter(r *gin.RouterGroup) { //设置中心
@@ -146,6 +148,11 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理
rEggPoint.POST("/userEggFlow", egg_energy.UserEggFlow)
rEggPoint.POST("/manualScore", egg_energy.ManualScore)
}
rContributionValue := rEggEnergy.Group("/contributionValue")
{
rContributionValue.GET("/basic", egg_energy.GetContributionValueBasicSetting)
rContributionValue.POST("/updateBasic", egg_energy.UpdateContributionValueBasicSetting)
}
}
}

@@ -202,6 +209,15 @@ func rIm(r *gin.RouterGroup) {
r.POST("/updateCustomerServiceMemo", im.UpdateCustomerServiceMemo)
}

func rFinancialCenter(r *gin.RouterGroup) {
rWithdraw := r.Group("/withdraw")
{
rWithdraw.GET("/setting", financial_center.GetWithdrawSetting)
rWithdraw.POST("/updateWithdrawSetting", financial_center.UpdateWithdrawSetting)
rWithdraw.GET("/applyList", financial_center.GetWithdrawApplyList)
}
}

func rComm(r *gin.RouterGroup) {
r.POST("/getMenuList", comm.MenuList) // 获取菜单栏列表
r.GET("/getOssUrl", comm.GetOssUrl) // 获取阿里云上传PutObject所需的签名URL


+ 91
- 0
app/svc/financial_center/svc_withdraw.go Wyświetl plik

@@ -0,0 +1,91 @@
package financial_center

import (
md "applet/app/md/financial_center"
"xorm.io/xorm"
)

func WithDrawManagementGetApply(engine *xorm.Engine, req *md.GetWithdrawApplyListReq) (*[]md.WithdrawApplyInfo, int64, error) {
applies := make([]md.WithdrawApplyInfo, 0)
session := engine.Table("fin_withdraw_apply").Alias("apply").
Join("LEFT OUTER", []string{"user", "usera"}, "usera.id = apply.uid").
Join("LEFT OUTER", []string{"user", "userb"}, "userb.id = usera.parent_uid").
Join("LEFT OUTER", []string{"user_tag_records", "tag"}, "tag.uid = apply.id").
Join("LEFT OUTER", []string{"user_wallet_flow", "wallet_flow"}, "wallet_flow.ord_id = apply.id")

if req.Uid != "0" && req.Uid != "" {
session = session.Where("usera.uid = ?", req.Uid)
}

if req.Nickname != "" {
session = session.Where("usera.nickname = ?", req.Nickname)
}

if req.Phone != "" {
session = session.Where("usera.phone = ?", req.Phone)
}

if req.ParentID != "0" && req.ParentID != "" {
session = session.Where("userb.parent_id = ?", req.ParentID)
}

switch req.IsFirst {
case "1":
// 首次提现
session = session.Where("apply.is_first", req.IsFirst)
case "0":
session = session.Where("apply.is_first", req.IsFirst)
}

if req.WithdrawType != "0" {
session = session.Where("apply.withdraw_kind = ?", req.WithdrawType)
}

if req.WithdrawAccount != "" {
session = session.Where("apply.withdraw_account = ?", req.WithdrawAccount)
}

if req.WithdrawName != "" {
session = session.Where("apply.withdraw_name = ?", req.WithdrawName)
}

if req.PaymentType != "" {
session = session.Where("apply.type = ?", req.PaymentType)
}

if req.State != "" {
session = session.Where("apply.state = ?", req.State)
}

if req.ApplyStartAt != "" {
session = session.Where("apply.create_at > ?", req.ApplyStartAt)
}
if req.ApplyEndAt != "" {
session = session.Where("apply.create_at < ?", req.ApplyEndAt)
}

if req.ExamineStartAt != "" {
session = session.Where("apply.update_at > ?", req.ExamineStartAt)
}

if req.ExamineEndAt != "" {
session = session.Where("apply.update_at < ?", req.ExamineEndAt)
}

if req.AmountBegin != "" {
session = session.Where("apply.amount > ?", req.AmountBegin)
}

if req.AmountEnd != "" {
session = session.Where("apply.amount < ?", req.AmountEnd)
}

if req.Level != "" {
session = session.Where("usera.level = ?", req.Level)
}
total, err := session.Limit(req.Limit, (req.Page-1)*req.Limit).Asc("apply.id").FindAndCount(&applies)
if err != nil {
return nil, 0, err
}
return &applies, total, nil
}

+ 1
- 1
app/svc/member_center/svc_user_management.go Wyświetl plik

@@ -1,7 +1,7 @@
package svc

import (
md "applet/app/md/institutional_management/member_center"
"applet/app/md/member_center"
"xorm.io/xorm"
)



+ 1504
- 158
docs/docs.go
Plik diff jest za duży
Wyświetl plik


+ 1504
- 158
docs/swagger.json
Plik diff jest za duży
Wyświetl plik


+ 1054
- 133
docs/swagger.yaml
Plik diff jest za duży
Wyświetl plik


+ 2
- 2
go.mod Wyświetl plik

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

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241121055036-fe2db8190b16
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241121120649-65cd7a1f776c
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241125113426-87a1c00e0545
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241125081706-0915be3f4144
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
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible


Ładowanie…
Anuluj
Zapisz