From 25f28986bfb967b21d1dd110a6633c2a93e61ea5 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 22 Aug 2024 17:51:45 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=AE=A1=E6=A0=B8=20?= =?UTF-8?q?=E5=B9=BF=E5=91=8A=E4=BD=8D=E5=AE=A1=E6=A0=B8=20mob=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_applet_application.go | 51 ++++ .../hdl_applet_application_ad_space_list.go | 51 ++++ app/hdl/hdl_set_center.go | 54 ++++ app/md/md__applet_application.go | 52 ++++ .../md__applet_application_ad_space_list.go | 54 ++++ app/md/md_set_center.go | 8 + app/md/qiniuyun.go | 7 + app/md/sms.go | 6 + app/router/router.go | 12 + app/svc/svc_applet_application.go | 231 ++++++++++++++++++ app/svc/svc_applet_application_ad_space.go | 217 ++++++++++++++++ app/svc/svc_medium_qualification.go | 6 +- app/svc/svc_sys_cfg_get.go | 78 ------ go.mod | 2 +- 14 files changed, 747 insertions(+), 82 deletions(-) create mode 100644 app/hdl/hdl_applet_application.go create mode 100644 app/hdl/hdl_applet_application_ad_space_list.go create mode 100644 app/md/md__applet_application.go create mode 100644 app/md/md__applet_application_ad_space_list.go create mode 100644 app/md/qiniuyun.go create mode 100644 app/md/sms.go create mode 100644 app/svc/svc_applet_application.go create mode 100644 app/svc/svc_applet_application_ad_space.go delete mode 100644 app/svc/svc_sys_cfg_get.go diff --git a/app/hdl/hdl_applet_application.go b/app/hdl/hdl_applet_application.go new file mode 100644 index 0000000..6b4151c --- /dev/null +++ b/app/hdl/hdl_applet_application.go @@ -0,0 +1,51 @@ +package hdl + +import ( + "applet/app/svc" + "github.com/gin-gonic/gin" +) + +// AppletApplicationMediumList +// @Summary 媒体列表 +// @Tags 媒体中心------嘉俊 +// @Description 媒体中心-媒体列表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.AppletApplicationMediumListReq true "请求参数" +// @Success 200 {object} md.AppletApplicationMediumListRes "具体看返回内容---这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/medium/applet/application/medium/list [POST] +func AppletApplicationMediumList(c *gin.Context) { + svc.AppletApplicationMediumList(c) +} + +// AppletApplicationList +// @Summary 应用列表 +// @Tags 媒体中心------嘉俊 +// @Description 小程序应用-列表数据 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.AppletApplicationListReq true "请求参数" +// @Success 200 {object} md.AppletApplicationListRes "具体看返回内容---这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/medium/applet/application/list [POST] +func AppletApplicationList(c *gin.Context) { + svc.AppletApplicationList(c) +} + +// AppletApplicationAudit +// @Summary 审核 +// @Tags 媒体中心------嘉俊 +// @Description 小程序应用-审核 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.AppletApplicationSaveReq true "请求参数" +// @Success 200 {string} "具体看返回内容" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/medium/applet/application/audit [POST] +func AppletApplicationAudit(c *gin.Context) { + svc.AppletApplicationAudit(c) +} diff --git a/app/hdl/hdl_applet_application_ad_space_list.go b/app/hdl/hdl_applet_application_ad_space_list.go new file mode 100644 index 0000000..57c61b6 --- /dev/null +++ b/app/hdl/hdl_applet_application_ad_space_list.go @@ -0,0 +1,51 @@ +package hdl + +import ( + "applet/app/svc" + "github.com/gin-gonic/gin" +) + +// AppletApplicationAdSpaceMediumList +// @Summary 媒体列表 +// @Tags 媒体中心------嘉俊 +// @Description 媒体中心-媒体列表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.AppletApplicationAdSpaceMediumListReq true "请求参数" +// @Success 200 {object} md.AppletApplicationAdSpaceMediumListRes "具体看返回内容---这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/medium/applet/application/ad/space/list [POST] +func AppletApplicationAdSpaceMediumList(c *gin.Context) { + svc.AppletApplicationAdSpaceMediumList(c) +} + +// AppletApplicationAdSpaceList +// @Summary 广告位列表 +// @Tags 媒体中心------嘉俊 +// @Description 小程序应用-广告位列表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.AppletApplicationAdSpaceListReq true "请求参数" +// @Success 200 {object} md.AppletApplicationAdSpaceListRes "具体看返回内容---这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/medium/applet/application/ad/space/save [POST] +func AppletApplicationAdSpaceList(c *gin.Context) { + svc.AppletApplicationAdSpaceList(c) +} + +// AppletApplicationAdSpaceAudit +// @Summary 广告位审核 +// @Tags 媒体中心------嘉俊 +// @Description 小程序应用-广告位审核 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.AppletApplicationAdSpaceSaveReq true "请求参数" +// @Success 200 {string} "具体看返回内容" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/medium/applet/application/ad/space/audit [POST] +func AppletApplicationAdSpaceAudit(c *gin.Context) { + svc.AppletApplicationAdSpaceAudit(c) +} diff --git a/app/hdl/hdl_set_center.go b/app/hdl/hdl_set_center.go index 2978e70..33c61b9 100644 --- a/app/hdl/hdl_set_center.go +++ b/app/hdl/hdl_set_center.go @@ -462,3 +462,57 @@ func ShareIndex(c *gin.Context) { }, nil) return } + +// SetMob +// @Summary mob设置 +// @Tags 设置中心-基础设置 +// @Description 基础设置-mob设置 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.SetMobReq true "请求参数" +// @Success 200 {string} "success" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/setCenter/basic/setOss [POST] +func SetMob(c *gin.Context) { + var req md.SetMobReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + masterId := svc.GetMasterId(c) + engine := db.DBs[masterId] + sysCfgDb := implement2.NewSysCfgDb(engine, masterId) + sysCfgDb.SysCfgUpdate("mob_app_key", req.MobAppKey) + sysCfgDb.SysCfgUpdate("mob_app_secret", req.MobAppSecret) + e.OutSuc(c, "success", nil) + return +} + +// GetMob +// @Summary mob获取 +// @Tags 设置中心-基础设置 +// @Description 基础设置-mob获取 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Success 200 {object} md.SetOssResp +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/setCenter/basic/getOss [GET] +func GetMob(c *gin.Context) { + masterId := svc.GetMasterId(c) + engine := db.DBs[masterId] + sysCfgDb := implement2.NewSysCfgDb(engine, masterId) + res := sysCfgDb.SysCfgFindWithDb("mob_app_key", "mob_app_secret") + + e.OutSuc(c, md.SetMobResp{ + Data: md.SetMobReq{ + MobAppSecret: res["mob_app_secret"], + MobAppKey: res["mob_app_key"], + }, + }, nil) + return +} diff --git a/app/md/md__applet_application.go b/app/md/md__applet_application.go new file mode 100644 index 0000000..b32c864 --- /dev/null +++ b/app/md/md__applet_application.go @@ -0,0 +1,52 @@ +package md + +type AppletApplicationMediumListReq struct { + Limit string `json:"limit"` + Page string `json:"page" ` + Name string `json:"name" example:"媒体名称"` + Account string `json:"account" example:"媒体账号"` +} +type AppletApplicationMediumListRes struct { + List []AppletApplicationMediumListData `json:"list"` + Total int64 `json:"total"` +} +type AppletApplicationMediumListData struct { + Id string `json:"id" example:"id"` + MediumId string `json:"medium_id" example:"媒体id"` + Name string `json:"name" example:"名称"` + Account string `json:"account" example:"账号"` + ContactName string `json:"contact_name" example:"联系人"` + Phone string `json:"phone" example:"联系电话"` + Count string `json:"count" example:"应用数量"` +} +type AppletApplicationListReq struct { + Limit string `json:"limit"` + Page string `json:"page" ` + Name string `json:"name"` + MediumId string `json:"medium_id" example:"媒体id"` + CooperateState string `json:"cooperate_state" example:"合作状态"` + Platform string `json:"platform"` +} +type AppletApplicationListRes struct { + List []AppletApplicationListData `json:"list"` + Total int64 `json:"total"` + State []SelectData `json:"state"` + CooperateState []SelectData `json:"cooperate_state"` + Platform []SelectData `json:"platform"` +} +type AppletApplicationListData struct { + Id string `json:"id" example:"id"` + Name string `json:"name" example:"应用名称"` + Platform string `json:"platform" example:"平台"` + Memo string `json:"memo" example:"备注"` + Logo string `json:"logo" example:"logo"` + AppId string `json:"app_id" example:"小程序appid"` + OriginalId string `json:"original_id" example:"小程序id"` + State string `json:"state" example:"应用状态 state=3 才能再次编辑"` + CooperateState string `json:"cooperate_state" example:"合作状态"` +} +type AppletApplicationSaveReq struct { + Id string `json:"id" example:"id 多个逗号隔开"` + State string `json:"state" example:"审核状态"` + Memo string `json:"memo" example:"备注"` +} diff --git a/app/md/md__applet_application_ad_space_list.go b/app/md/md__applet_application_ad_space_list.go new file mode 100644 index 0000000..fb8ffa7 --- /dev/null +++ b/app/md/md__applet_application_ad_space_list.go @@ -0,0 +1,54 @@ +package md + +type AppletApplicationAdSpaceMediumListReq struct { + Limit string `json:"limit"` + Page string `json:"page" ` + Name string `json:"name" example:"媒体名称"` + Account string `json:"account" example:"媒体账号"` +} +type AppletApplicationAdSpaceMediumListRes struct { + List []AppletApplicationAdSpaceMediumListData `json:"list"` + Total int64 `json:"total"` +} +type AppletApplicationAdSpaceMediumListData struct { + Id string `json:"id" example:"id"` + MediumId string `json:"medium_id" example:"媒体id"` + Name string `json:"name" example:"名称"` + Account string `json:"account" example:"账号"` + ContactName string `json:"contact_name" example:"联系人"` + Phone string `json:"phone" example:"联系电话"` + Count string `json:"count" example:"广告位数量"` +} +type AppletApplicationAdSpaceListReq struct { + MediumId string `json:"medium_id" example:"媒体id"` + Limit string `json:"limit"` + Page string `json:"page" ` + Name string `json:"name"` + CooperateState string `json:"cooperate_state" example:"合作状态"` + Platform string `json:"platform"` +} +type AppletApplicationAdSpaceListRes struct { + List []AppletApplicationAdSpaceListData `json:"list"` + Total int64 `json:"total"` + State []SelectData `json:"state"` + CooperateState []SelectData `json:"cooperate_state"` + Platform []SelectData `json:"platform"` + AdType []SelectData `json:"ad_type"` +} +type AppletApplicationAdSpaceListData struct { + Id string `json:"id" example:"id"` + Name string `json:"name" example:"应用名称"` + Platform string `json:"platform" example:"平台"` + Kind string `json:"kind" example:"广告位类型"` + Memo string `json:"memo" example:"备注"` + Logo string `json:"logo" example:"logo"` + AppId string `json:"app_id" example:"小程序appid"` + AdId string `json:"ad_id" example:"广告位id"` + State string `json:"state" example:"应用状态 state=2 才能再次编辑"` + CooperateState string `json:"cooperate_state" example:"合作状态"` +} +type AppletApplicationAdSpaceSaveReq struct { + Id string `json:"id" example:"id 多个逗号隔开"` + State string `json:"state" example:"审核状态"` + Memo string `json:"memo" example:"备注"` +} diff --git a/app/md/md_set_center.go b/app/md/md_set_center.go index d641ec1..01e2d61 100644 --- a/app/md/md_set_center.go +++ b/app/md/md_set_center.go @@ -47,3 +47,11 @@ type ShareIndexResp struct { AgentDomain string `json:"agent_domain" example:"代理分享地址"` MediumDomain string `json:"medium_domain" example:"媒体分享地址"` } + +type SetMobReq struct { + MobAppKey string `json:"mob_app_key"` + MobAppSecret string `json:"mob_app_secret"` +} +type SetMobResp struct { + Data SetMobReq `json:"data"` //数据内容 +} diff --git a/app/md/qiniuyun.go b/app/md/qiniuyun.go new file mode 100644 index 0000000..565c6ee --- /dev/null +++ b/app/md/qiniuyun.go @@ -0,0 +1,7 @@ +package md + +type ImgReqUpload struct { + Dir string `json:"dir"` + FileName string `json:"file_name"` + FileSize int64 `json:"file_size"` // 文件大小, 单位byte +} diff --git a/app/md/sms.go b/app/md/sms.go new file mode 100644 index 0000000..48c154c --- /dev/null +++ b/app/md/sms.go @@ -0,0 +1,6 @@ +package md + +type SmsReq struct { + Username string `json:"username"` + Type string `json:"type" example:"手机号登陆:fast_login 注册:register"` +} diff --git a/app/router/router.go b/app/router/router.go index 1a14e8e..54c2132 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -66,6 +66,7 @@ func route(r *gin.RouterGroup) { rAgentQualification(r.Group("/agentQualification")) //渠道-资质 rMediumQualification(r.Group("/mediumQualification")) //媒体-资质 rSetCenter(r.Group("/setCenter")) //设置中心 + rMedium(r.Group("/medium")) //媒体中心 } func rRole(r *gin.RouterGroup) { @@ -107,6 +108,8 @@ func rSetCenter(r *gin.RouterGroup) { rBasicSetCenter.GET("/getOss", hdl.GetOss) rBasicSetCenter.POST("/wxOpenSet", hdl.WxOpenSet) rBasicSetCenter.GET("/wxOpenGet", hdl.WxOpenGet) + rBasicSetCenter.POST("/setMob", hdl.SetMob) + rBasicSetCenter.GET("/getMob", hdl.GetMob) } rAppletSetCenter := r.Group("/applet") { @@ -123,3 +126,12 @@ func rSetCenter(r *gin.RouterGroup) { } } +func rMedium(r *gin.RouterGroup) { + r.POST("/applet/application/medium/list", hdl.AppletApplicationMediumList) //应用管理-媒体列表 + r.POST("/applet/application/list", hdl.AppletApplicationList) //小程序应用-列表数据 + r.POST("/applet/application/audit", hdl.AppletApplicationAudit) //小程序应用-审核 + + r.POST("/applet/application/ad/space/medium/list", hdl.AppletApplicationAdSpaceMediumList) //广告管理-媒体列表 + r.POST("/applet/application/ad/space/list", hdl.AppletApplicationAdSpaceList) //小程序应用-广告位列表数据 + r.POST("/applet/application/ad/space/audit", hdl.AppletApplicationAdSpaceAudit) //小程序应用-广告位审核 +} diff --git a/app/svc/svc_applet_application.go b/app/svc/svc_applet_application.go new file mode 100644 index 0000000..87a6423 --- /dev/null +++ b/app/svc/svc_applet_application.go @@ -0,0 +1,231 @@ +package svc + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/lib/wechat" + "applet/app/lib/wechat/enum" + "applet/app/md" + "applet/app/utils" + db "code.fnuoos.com/zhimeng/model.git/src" + "code.fnuoos.com/zhimeng/model.git/src/implement" + "code.fnuoos.com/zhimeng/model.git/src/model" + implement2 "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "github.com/gin-gonic/gin" + "github.com/jinzhu/copier" + "strings" +) + +func AppletApplicationMediumList(c *gin.Context) { + var req md.AppletApplicationMediumListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + engine := MasterDb(c) + NewMediumDb := implement.NewMediumDb(engine) + + list, total, _ := NewMediumDb.FindSuperAdmin(req.Account, req.Name, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + data := make([]md.AppletApplicationMediumListData, 0) + if len(list) > 0 { + for _, v := range list { + var tmp = md.AppletApplicationMediumListData{ + Id: utils.IntToStr(v.Id), + MediumId: utils.IntToStr(v.MediumId), + Name: v.Memo, + Account: v.Username, + ContactName: "", + Phone: "", + Count: "", + } + NewMediumContactInfoDb := implement2.NewMediumContactInfoDb(db.Db) + infoList, _ := NewMediumContactInfoDb.GetMediumContactInfoList(v.MediumId) + if infoList != nil { + tmp.ContactName = infoList.Name + tmp.Phone = infoList.Phone + } + count, _ := engine.Where("medium_id=?", v.MediumId).Count(&model.AppletApplication{}) + tmp.Count = utils.Int64ToStr(count) + data = append(data, tmp) + } + } + res := md.AppletApplicationMediumListRes{ + List: data, + Total: total, + } + e.OutSuc(c, res, nil) + return +} +func AppletApplicationList(c *gin.Context) { + var req md.AppletApplicationListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + engine := MasterDb(c) + NewAppletApplicationDb := implement.NewAppletApplicationDb(engine) + state := make([]string, 0) + if req.CooperateState != "" { + if req.CooperateState == "0" { + state = []string{"0", "1"} + } else { + state = []string{req.CooperateState} + } + } + appletApplicationList, total, _ := NewAppletApplicationDb.FindAppletApplicationList(req.Name, req.Platform, state, utils.StrToInt(req.MediumId), utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + data := make([]md.AppletApplicationListData, 0) + if len(appletApplicationList) > 0 { + for _, v := range appletApplicationList { + var tmp md.AppletApplicationListData + copier.Copy(&tmp, &v) + tmp.Id = utils.IntToStr(v.Id) + tmp.State = utils.IntToStr(v.State) + if v.State == 1 { + v.State = 0 + } + tmp.CooperateState = utils.IntToStr(v.State) + data = append(data, tmp) + } + } + res := md.AppletApplicationListRes{ + List: data, + Total: total, + Platform: []md.SelectData{ + { + Name: "微信小程序", + Value: "wx_applet", + }, + }, + State: []md.SelectData{ + { + Name: "待审核", + Value: "0", + }, + { + Name: "审核中", + Value: "1", + }, + { + Name: "审核通过", + Value: "2", + }, + { + Name: "审核拒绝", + Value: "3", + }, + { + Name: "封禁中", + Value: "4", + }, + }, + CooperateState: []md.SelectData{ + { + Name: "未运行", + Value: "0", + }, + { + Name: "运行中", + Value: "2", + }, + { + Name: "审核拒绝", + Value: "3", + }, + { + Name: "封禁中", + Value: "4", + }, + }, + } + e.OutSuc(c, res, nil) + return +} +func AppletApplicationAudit(c *gin.Context) { + var req md.AppletApplicationSaveReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + NewAppletApplicationDb := implement.NewAppletApplicationDb(MasterDb(c)) + list, _ := NewAppletApplicationDb.FindAppletApplicationListByIds(strings.Split(req.Id, ",")) + if list != nil { + masterId := GetMasterId(c) + wxOpenThirdPartyAppListDb := implement2.NewWxOpenThirdPartyAppListDb(db.Db) + wxOpenThirdPartyAppList, err := wxOpenThirdPartyAppListDb.GetWxOpenThirdPartyAppList(utils.StrToInt(masterId)) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + if wxOpenThirdPartyAppList == nil { + e.OutErr(c, e.ERR_NOT_FAN, "未查询到对应三方应用记录") + return + } + wxApiService, err := wechat.NewWxApiService(masterId, wxOpenThirdPartyAppList.Appid, wxOpenThirdPartyAppList.AppSecret) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + userWxAppletListDb := implement2.NewUserWxAppletListDb(db.Db) + userWxAppletList, _ := userWxAppletListDb.GetUserWxAppletList(c.GetString("mid")) + appId := "" + if userWxAppletList != nil { + appId = userWxAppletList.Appid + } + for _, v := range *list { + v.State = utils.StrToInt(req.State) + v.Memo = req.Memo + err := changeWx(c, wxApiService, appId, v.State, v.MediumId) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + MasterDb(c).Where("id=?", v.Id).Cols("state,memo").Update(&v) + } + } + e.OutSuc(c, "success", nil) + return +} +func changeWx(c *gin.Context, wxApiService wechat.WxApiService, appId string, state, mediumId int) error { + if state != 2 && state != 4 { + return nil + } + NewAppletApplicationAdSpaceListDb := implement.NewAppletApplicationAdSpaceListDb(MasterDb(c)) + list, _ := NewAppletApplicationAdSpaceListDb.FindAppletApplicationAdSpaceListByMediumId(mediumId) + if list != nil { + for _, v := range *list { //全部恢复 全部封禁 + if v.State != 2 && v.State != 4 { + continue + } + if v.AppId != "" { + onOff := "" + if state == 4 { //禁用 + onOff = enum.AdunitStatusForOff + v.UseState = 2 + v.State = 3 + } + if state == 2 { //恢复 + onOff = enum.AdunitStatusForOn + v.UseState = 1 + v.State = 1 + } + if onOff != "" && v.AdId != "" && appId != "" { + err := wxApiService.AgencyUpdateAdunit(appId, v.AdId, v.Name, enum.AdunitType(v.Kind), enum.AdunitStatus(onOff)) + if err != nil { + return err + } + } + MasterDb(c).Where("id=?", v.Id).Cols("state,use_state").Update(&v) + } + } + } + return nil +} diff --git a/app/svc/svc_applet_application_ad_space.go b/app/svc/svc_applet_application_ad_space.go new file mode 100644 index 0000000..85d453a --- /dev/null +++ b/app/svc/svc_applet_application_ad_space.go @@ -0,0 +1,217 @@ +package svc + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/lib/wechat" + "applet/app/lib/wechat/enum" + "applet/app/md" + "applet/app/utils" + db "code.fnuoos.com/zhimeng/model.git/src" + "code.fnuoos.com/zhimeng/model.git/src/implement" + "code.fnuoos.com/zhimeng/model.git/src/model" + implement2 "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "github.com/gin-gonic/gin" + "strings" +) + +func AppletApplicationAdSpaceMediumList(c *gin.Context) { + var req md.AppletApplicationAdSpaceMediumListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + engine := MasterDb(c) + NewMediumDb := implement.NewMediumDb(engine) + + list, total, _ := NewMediumDb.FindSuperAdmin(req.Account, req.Name, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + data := make([]md.AppletApplicationAdSpaceMediumListData, 0) + if len(list) > 0 { + for _, v := range list { + var tmp = md.AppletApplicationAdSpaceMediumListData{ + Id: utils.IntToStr(v.Id), + MediumId: utils.IntToStr(v.MediumId), + Name: v.Memo, + Account: v.Username, + ContactName: "", + Phone: "", + Count: "", + } + NewMediumContactInfoDb := implement2.NewMediumContactInfoDb(engine) + infoList, _ := NewMediumContactInfoDb.GetMediumContactInfoList(v.MediumId) + if infoList != nil { + tmp.ContactName = infoList.Name + tmp.Phone = infoList.Phone + } + count, _ := engine.Where("medium_id=?", v.MediumId).Count(&model.AppletApplicationAdSpaceList{}) + tmp.Count = utils.Int64ToStr(count) + data = append(data, tmp) + } + } + res := md.AppletApplicationAdSpaceMediumListRes{ + List: data, + Total: total, + } + e.OutSuc(c, res, nil) + return +} + +func AppletApplicationAdSpaceList(c *gin.Context) { + var req md.AppletApplicationAdSpaceListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + engine := MasterDb(c) + NewAppletApplicationDb := implement.NewAppletApplicationAdSpaceListDb(engine) + appletApplicationList, total, _ := NewAppletApplicationDb.FindAppletApplicationAdSpaceList(req.Name, req.Platform, req.CooperateState, utils.StrToInt(req.MediumId), utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + data := make([]md.AppletApplicationAdSpaceListData, 0) + if len(appletApplicationList) > 0 { + for _, v := range appletApplicationList { + var tmp = md.AppletApplicationAdSpaceListData{ + Id: utils.IntToStr(v.AppletApplicationAdSpaceList.Id), + Name: v.AppletApplicationAdSpaceList.Name, + Platform: v.Platform, + Kind: v.Kind, + Memo: v.AppletApplicationAdSpaceList.Memo, + Logo: v.Logo, + AppId: v.AppletApplicationAdSpaceList.AppId, + AdId: v.AppletApplicationAdSpaceList.AdId, + State: utils.IntToStr(v.AppletApplicationAdSpaceList.State), + CooperateState: utils.IntToStr(v.AppletApplicationAdSpaceList.State), + } + data = append(data, tmp) + } + } + res := md.AppletApplicationAdSpaceListRes{ + List: data, + Total: total, + AdType: []md.SelectData{ + {Name: "banner", Value: enum.AdunitTypeForBanner}, + {Name: "激励视频", Value: enum.AdunitTypeForRewardVideo}, + {Name: "插屏广告", Value: enum.AdunitTypeForInterstitial}, + {Name: "视频广告", Value: enum.AdunitTypeForVideoFeeds}, + //{Name: "视频贴片广告", Value: "5"}, + }, + Platform: []md.SelectData{ + { + Name: "微信小程序", + Value: "wx_applet", + }, + }, + State: []md.SelectData{ + { + Name: "待审核", + Value: "0", + }, + { + Name: "审核通过", + Value: "1", + }, + { + Name: "审核拒绝", + Value: "2", + }, + { + Name: "封禁中", + Value: "3", + }, + }, + CooperateState: []md.SelectData{ + { + Name: "未运行", + Value: "0", + }, + { + Name: "运行中", + Value: "1", + }, + { + Name: "审核拒绝", + Value: "2", + }, + { + Name: "封禁中", + Value: "3", + }, + }, + } + e.OutSuc(c, res, nil) + return +} +func AppletApplicationAdSpaceAudit(c *gin.Context) { + var req md.AppletApplicationAdSpaceSaveReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + masterId := GetMasterId(c) + wxOpenThirdPartyAppListDb := implement2.NewWxOpenThirdPartyAppListDb(db.Db) + wxOpenThirdPartyAppList, err := wxOpenThirdPartyAppListDb.GetWxOpenThirdPartyAppList(utils.StrToInt(masterId)) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + if wxOpenThirdPartyAppList == nil { + e.OutErr(c, e.ERR_NOT_FAN, "未查询到对应三方应用记录") + return + } + wxApiService, err := wechat.NewWxApiService(masterId, wxOpenThirdPartyAppList.Appid, wxOpenThirdPartyAppList.AppSecret) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + userWxAppletListDb := implement2.NewUserWxAppletListDb(db.Db) + userWxAppletList, _ := userWxAppletListDb.GetUserWxAppletList(c.GetString("mid")) + appId := "" + if userWxAppletList != nil { + appId = userWxAppletList.Appid + } + NewAppletApplicationAdSpaceListDb := implement.NewAppletApplicationAdSpaceListDb(MasterDb(c)) + list, _ := NewAppletApplicationAdSpaceListDb.FindAppletApplicationAdSpaceListByIds(strings.Split(req.Id, ",")) + if list != nil { + + for _, v := range *list { + v.State = utils.StrToInt(req.State) + v.Memo = req.Memo + if v.AdId == "" && v.State == 1 && appId != "" { + err, v.AdId = wxApiService.AgencyCreateAdunit(appId, v.Name, enum.AdunitType(v.Kind)) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + v.UseState = 1 + } + if v.AppId != "" { + onOff := "" + if v.State == 3 && v.UseState != 2 { //禁用 + onOff = enum.AdunitStatusForOff + v.UseState = 2 + } + if v.State == 1 && v.UseState == 2 { //恢复 + onOff = enum.AdunitStatusForOn + v.UseState = 1 + } + if onOff != "" && v.AdId != "" && appId != "" { + err = wxApiService.AgencyUpdateAdunit(appId, v.AdId, v.Name, enum.AdunitType(v.Kind), enum.AdunitStatus(onOff)) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + } + } + MasterDb(c).Where("id=?", v.Id).Cols("state,memo,ad_id,use_state").Update(&v) + } + } + e.OutSuc(c, "success", nil) + return +} diff --git a/app/svc/svc_medium_qualification.go b/app/svc/svc_medium_qualification.go index 14d4c45..3f9e71d 100644 --- a/app/svc/svc_medium_qualification.go +++ b/app/svc/svc_medium_qualification.go @@ -15,7 +15,7 @@ func MediumQualificationEnterprise(c *gin.Context, req md.MediumQualificationEnt engine := db.Db MediumListDb := implement.NewMediumListDb(engine) - MediumList, total, _ := MediumListDb.FindMediumList(req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + MediumList, total, _ := MediumListDb.FindMediumList(c.GetString("mid"), req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) data := make([]md.MediumQualificationEnterpriseData, 0) if len(MediumList) > 0 { for _, v := range MediumList { @@ -86,7 +86,7 @@ func MediumQualificationEnterpriseAudit(c *gin.Context, req md.MediumQualificati func MediumQualificationBank(c *gin.Context, req md.MediumQualificationEnterpriseReq) md.MediumQualificationBankRes { engine := db.Db MediumListDb := implement.NewMediumBankInfoDb(engine) - MediumList, total, _ := MediumListDb.FindMediumBankInfoList(req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + MediumList, total, _ := MediumListDb.FindMediumBankInfoList(c.GetString("mid"), req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) list := make([]md.MediumQualificationBankData, 0) if MediumList != nil { @@ -163,7 +163,7 @@ func MediumQualificationContactInfo(c *gin.Context, req md.MediumQualificationEn engine := db.Db MediumListDb := implement.NewMediumContactInfoDb(engine) - MediumList, total, _ := MediumListDb.FindMediumContactInfoList(req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + MediumList, total, _ := MediumListDb.FindMediumContactInfoList(c.GetString("mid"), req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) list := make([]md.MediumQualificationContactData, 0) if MediumList != nil { diff --git a/app/svc/svc_sys_cfg_get.go b/app/svc/svc_sys_cfg_get.go deleted file mode 100644 index 060a84b..0000000 --- a/app/svc/svc_sys_cfg_get.go +++ /dev/null @@ -1,78 +0,0 @@ -package svc - -import ( - "applet/app/db/implement" - db "code.fnuoos.com/zhimeng/model.git/src" - "github.com/gin-gonic/gin" - "xorm.io/xorm" - - "applet/app/md" - "applet/app/utils/cache" -) - -// 单挑记录获取 -func SysCfgGet(c *gin.Context, key string) string { - masterId := GetMasterId(c) - eg := db.DBs[masterId] - sysCfgDb := implement.NewSysCfgDb(eg, masterId) - return sysCfgDb.SysCfgGetWithDb(key) -} - -// 多条记录获取 -func SysCfgFind(c *gin.Context, keys ...string) map[string]string { - var masterId string - if c == nil { - masterId = "" - } else { - masterId = GetMasterId(c) - } - tmp := SysCfgFindComm(masterId, keys...) - return tmp -} -func SysCfgFindComm(masterId string, keys ...string) map[string]string { - var eg *xorm.Engine - if masterId == "" { - eg = db.Db - } else { - eg = db.DBs[masterId] - } - res := map[string]string{} - //TODO::判断keys长度(大于10个直接查数据库) - sysCfgDb := implement.NewSysCfgDb(eg, masterId) - if len(keys) > 10 { - cfgList, _ := sysCfgDb.SysCfgGetAll() - if cfgList == nil { - return nil - } - for _, v := range *cfgList { - res[v.K] = v.V - } - } else { - for _, key := range keys { - res[key] = sysCfgDb.SysCfgGetWithDb(key) - } - } - return res -} - -// 清理系统配置信息 -func SysCfgCleanCache() { - cache.Del(md.KEY_SYS_CFG_CACHE) -} - -// 写入系统设置 -func SysCfgSet(c *gin.Context, key, val, memo string) bool { - masterId := GetMasterId(c) - eg := db.DBs[masterId] - sysCfgDb := implement.NewSysCfgDb(eg, masterId) - - cfg, err := sysCfgDb.SysCfgGetOne(key) - if err != nil || cfg == nil { - return sysCfgDb.SysCfgInsert(key, val, memo) - } - if memo != "" && cfg.Memo != memo { - cfg.Memo = memo - } - SysCfgCleanCache() - return sysCfgDb.SysCfgUpdate(key, val) -} diff --git a/go.mod b/go.mod index d291ab6..b4e81cf 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 //replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models require ( - code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240822030431-bf682f937fb0 + code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240822095043-f18aa08f09b1 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/boombuler/barcode v1.0.1 github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 From ed2f720d017b1fb8be979441a62fcef2ac77872b Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 22 Aug 2024 17:52:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs.go | 695 +++++++++++++++++++++++++++++++++++++++++++++- docs/swagger.json | 695 +++++++++++++++++++++++++++++++++++++++++++++- docs/swagger.yaml | 462 +++++++++++++++++++++++++++++- 3 files changed, 1817 insertions(+), 35 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index a18802a..99146af 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -347,6 +347,288 @@ const docTemplate = `{ } } }, + "/api/medium/applet/application/ad/space/audit": { + "post": { + "description": "小程序应用-广告位审核", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "广告位审核", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceSaveReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/ad/space/list": { + "post": { + "description": "媒体中心-媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceMediumListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容---这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceMediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/ad/space/save": { + "post": { + "description": "小程序应用-广告位列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "广告位列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容---这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/audit": { + "post": { + "description": "小程序应用-审核", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "审核", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationSaveReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/list": { + "post": { + "description": "小程序应用-列表数据", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "应用列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容---这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AppletApplicationListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/medium/list": { + "post": { + "description": "媒体中心-媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationMediumListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容---这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AppletApplicationMediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/mediumQualification/bank": { "post": { "responses": { @@ -1475,7 +1757,7 @@ const docTemplate = `{ }, "/api/setCenter/basic/getOss": { "get": { - "description": "基础设置-oss获取", + "description": "基础设置-mob获取", "consumes": [ "application/json" ], @@ -1485,7 +1767,7 @@ const docTemplate = `{ "tags": [ "设置中心-基础设置" ], - "summary": "oss获取", + "summary": "mob获取", "parameters": [ { "type": "string", @@ -1513,7 +1795,7 @@ const docTemplate = `{ }, "/api/setCenter/basic/setOss": { "post": { - "description": "基础设置-oss设置", + "description": "基础设置-mob设置", "consumes": [ "application/json" ], @@ -1523,7 +1805,7 @@ const docTemplate = `{ "tags": [ "设置中心-基础设置" ], - "summary": "oss设置", + "summary": "mob设置", "parameters": [ { "type": "string", @@ -1538,7 +1820,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.SetOssReq" + "$ref": "#/definitions/md.SetMobReq" } } ], @@ -2178,20 +2460,392 @@ const docTemplate = `{ } } }, - "md.AppletUpdateReq": { + "md.AppletApplicationAdSpaceListData": { "type": "object", - "required": [ - "id", - "logo", - "name" - ], "properties": { - "id": { - "type": "integer" + "ad_id": { + "type": "string", + "example": "广告位id" }, - "logo": { + "app_id": { "type": "string", - "example": "小程序logo" + "example": "小程序appid" + }, + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "id": { + "type": "string", + "example": "id" + }, + "kind": { + "type": "string", + "example": "广告位类型" + }, + "logo": { + "type": "string", + "example": "logo" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "name": { + "type": "string", + "example": "应用名称" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "state": { + "type": "string", + "example": "应用状态 state=2 才能再次编辑" + } + } + }, + "md.AppletApplicationAdSpaceListReq": { + "type": "object", + "properties": { + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "limit": { + "type": "string" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "platform": { + "type": "string" + } + } + }, + "md.AppletApplicationAdSpaceListRes": { + "type": "object", + "properties": { + "ad_type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "cooperate_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceListData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationAdSpaceMediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "count": { + "type": "string", + "example": "广告位数量" + }, + "id": { + "type": "string", + "example": "id" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "phone": { + "type": "string", + "example": "联系电话" + } + } + }, + "md.AppletApplicationAdSpaceMediumListReq": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "page": { + "type": "string" + } + } + }, + "md.AppletApplicationAdSpaceMediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceMediumListData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationAdSpaceSaveReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "id 多个逗号隔开" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "state": { + "type": "string", + "example": "审核状态" + } + } + }, + "md.AppletApplicationListData": { + "type": "object", + "properties": { + "app_id": { + "type": "string", + "example": "小程序appid" + }, + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "id": { + "type": "string", + "example": "id" + }, + "logo": { + "type": "string", + "example": "logo" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "name": { + "type": "string", + "example": "应用名称" + }, + "original_id": { + "type": "string", + "example": "小程序id" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "state": { + "type": "string", + "example": "应用状态 state=3 才能再次编辑" + } + } + }, + "md.AppletApplicationListReq": { + "type": "object", + "properties": { + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "limit": { + "type": "string" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "platform": { + "type": "string" + } + } + }, + "md.AppletApplicationListRes": { + "type": "object", + "properties": { + "cooperate_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationListData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationMediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "count": { + "type": "string", + "example": "应用数量" + }, + "id": { + "type": "string", + "example": "id" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "phone": { + "type": "string", + "example": "联系电话" + } + } + }, + "md.AppletApplicationMediumListReq": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "page": { + "type": "string" + } + } + }, + "md.AppletApplicationMediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationMediumListData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationSaveReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "id 多个逗号隔开" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "state": { + "type": "string", + "example": "审核状态" + } + } + }, + "md.AppletUpdateReq": { + "type": "object", + "required": [ + "id", + "logo", + "name" + ], + "properties": { + "id": { + "type": "integer" + }, + "logo": { + "type": "string", + "example": "小程序logo" }, "name": { "type": "string", @@ -2565,6 +3219,17 @@ const docTemplate = `{ } } }, + "md.SetMobReq": { + "type": "object", + "properties": { + "mob_app_key": { + "type": "string" + }, + "mob_app_secret": { + "type": "string" + } + } + }, "md.SetOssReq": { "type": "object", "required": [ diff --git a/docs/swagger.json b/docs/swagger.json index ea3cae5..6e87057 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -339,6 +339,288 @@ } } }, + "/api/medium/applet/application/ad/space/audit": { + "post": { + "description": "小程序应用-广告位审核", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "广告位审核", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceSaveReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/ad/space/list": { + "post": { + "description": "媒体中心-媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceMediumListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容---这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceMediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/ad/space/save": { + "post": { + "description": "小程序应用-广告位列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "广告位列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容---这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/audit": { + "post": { + "description": "小程序应用-审核", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "审核", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationSaveReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/list": { + "post": { + "description": "小程序应用-列表数据", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "应用列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容---这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AppletApplicationListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/applet/application/medium/list": { + "post": { + "description": "媒体中心-媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AppletApplicationMediumListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容---这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AppletApplicationMediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/mediumQualification/bank": { "post": { "responses": { @@ -1467,7 +1749,7 @@ }, "/api/setCenter/basic/getOss": { "get": { - "description": "基础设置-oss获取", + "description": "基础设置-mob获取", "consumes": [ "application/json" ], @@ -1477,7 +1759,7 @@ "tags": [ "设置中心-基础设置" ], - "summary": "oss获取", + "summary": "mob获取", "parameters": [ { "type": "string", @@ -1505,7 +1787,7 @@ }, "/api/setCenter/basic/setOss": { "post": { - "description": "基础设置-oss设置", + "description": "基础设置-mob设置", "consumes": [ "application/json" ], @@ -1515,7 +1797,7 @@ "tags": [ "设置中心-基础设置" ], - "summary": "oss设置", + "summary": "mob设置", "parameters": [ { "type": "string", @@ -1530,7 +1812,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.SetOssReq" + "$ref": "#/definitions/md.SetMobReq" } } ], @@ -2170,20 +2452,392 @@ } } }, - "md.AppletUpdateReq": { + "md.AppletApplicationAdSpaceListData": { "type": "object", - "required": [ - "id", - "logo", - "name" - ], "properties": { - "id": { - "type": "integer" + "ad_id": { + "type": "string", + "example": "广告位id" }, - "logo": { + "app_id": { "type": "string", - "example": "小程序logo" + "example": "小程序appid" + }, + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "id": { + "type": "string", + "example": "id" + }, + "kind": { + "type": "string", + "example": "广告位类型" + }, + "logo": { + "type": "string", + "example": "logo" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "name": { + "type": "string", + "example": "应用名称" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "state": { + "type": "string", + "example": "应用状态 state=2 才能再次编辑" + } + } + }, + "md.AppletApplicationAdSpaceListReq": { + "type": "object", + "properties": { + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "limit": { + "type": "string" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "platform": { + "type": "string" + } + } + }, + "md.AppletApplicationAdSpaceListRes": { + "type": "object", + "properties": { + "ad_type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "cooperate_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceListData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationAdSpaceMediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "count": { + "type": "string", + "example": "广告位数量" + }, + "id": { + "type": "string", + "example": "id" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "phone": { + "type": "string", + "example": "联系电话" + } + } + }, + "md.AppletApplicationAdSpaceMediumListReq": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "page": { + "type": "string" + } + } + }, + "md.AppletApplicationAdSpaceMediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceMediumListData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationAdSpaceSaveReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "id 多个逗号隔开" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "state": { + "type": "string", + "example": "审核状态" + } + } + }, + "md.AppletApplicationListData": { + "type": "object", + "properties": { + "app_id": { + "type": "string", + "example": "小程序appid" + }, + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "id": { + "type": "string", + "example": "id" + }, + "logo": { + "type": "string", + "example": "logo" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "name": { + "type": "string", + "example": "应用名称" + }, + "original_id": { + "type": "string", + "example": "小程序id" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "state": { + "type": "string", + "example": "应用状态 state=3 才能再次编辑" + } + } + }, + "md.AppletApplicationListReq": { + "type": "object", + "properties": { + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "limit": { + "type": "string" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "platform": { + "type": "string" + } + } + }, + "md.AppletApplicationListRes": { + "type": "object", + "properties": { + "cooperate_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationListData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationMediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "count": { + "type": "string", + "example": "应用数量" + }, + "id": { + "type": "string", + "example": "id" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "phone": { + "type": "string", + "example": "联系电话" + } + } + }, + "md.AppletApplicationMediumListReq": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "page": { + "type": "string" + } + } + }, + "md.AppletApplicationMediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationMediumListData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationSaveReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "id 多个逗号隔开" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "state": { + "type": "string", + "example": "审核状态" + } + } + }, + "md.AppletUpdateReq": { + "type": "object", + "required": [ + "id", + "logo", + "name" + ], + "properties": { + "id": { + "type": "integer" + }, + "logo": { + "type": "string", + "example": "小程序logo" }, "name": { "type": "string", @@ -2557,6 +3211,17 @@ } } }, + "md.SetMobReq": { + "type": "object", + "properties": { + "mob_app_key": { + "type": "string" + }, + "mob_app_secret": { + "type": "string" + } + } + }, "md.SetOssReq": { "type": "object", "required": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 92aceeb..e4ff0d2 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -287,6 +287,265 @@ definitions: - name - original_id type: object + md.AppletApplicationAdSpaceListData: + properties: + ad_id: + example: 广告位id + type: string + app_id: + example: 小程序appid + type: string + cooperate_state: + example: 合作状态 + type: string + id: + example: id + type: string + kind: + example: 广告位类型 + type: string + logo: + example: logo + type: string + memo: + example: 备注 + type: string + name: + example: 应用名称 + type: string + platform: + example: 平台 + type: string + state: + example: 应用状态 state=2 才能再次编辑 + type: string + type: object + md.AppletApplicationAdSpaceListReq: + properties: + cooperate_state: + example: 合作状态 + type: string + limit: + type: string + medium_id: + example: 媒体id + type: string + name: + type: string + page: + type: string + platform: + type: string + type: object + md.AppletApplicationAdSpaceListRes: + properties: + ad_type: + items: + $ref: '#/definitions/md.SelectData' + type: array + cooperate_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + list: + items: + $ref: '#/definitions/md.AppletApplicationAdSpaceListData' + type: array + platform: + items: + $ref: '#/definitions/md.SelectData' + type: array + state: + items: + $ref: '#/definitions/md.SelectData' + type: array + total: + type: integer + type: object + md.AppletApplicationAdSpaceMediumListData: + properties: + account: + example: 账号 + type: string + contact_name: + example: 联系人 + type: string + count: + example: 广告位数量 + type: string + id: + example: id + type: string + medium_id: + example: 媒体id + type: string + name: + example: 名称 + type: string + phone: + example: 联系电话 + type: string + type: object + md.AppletApplicationAdSpaceMediumListReq: + properties: + account: + example: 媒体账号 + type: string + limit: + type: string + name: + example: 媒体名称 + type: string + page: + type: string + type: object + md.AppletApplicationAdSpaceMediumListRes: + properties: + list: + items: + $ref: '#/definitions/md.AppletApplicationAdSpaceMediumListData' + type: array + total: + type: integer + type: object + md.AppletApplicationAdSpaceSaveReq: + properties: + id: + example: id 多个逗号隔开 + type: string + memo: + example: 备注 + type: string + state: + example: 审核状态 + type: string + type: object + md.AppletApplicationListData: + properties: + app_id: + example: 小程序appid + type: string + cooperate_state: + example: 合作状态 + type: string + id: + example: id + type: string + logo: + example: logo + type: string + memo: + example: 备注 + type: string + name: + example: 应用名称 + type: string + original_id: + example: 小程序id + type: string + platform: + example: 平台 + type: string + state: + example: 应用状态 state=3 才能再次编辑 + type: string + type: object + md.AppletApplicationListReq: + properties: + cooperate_state: + example: 合作状态 + type: string + limit: + type: string + medium_id: + example: 媒体id + type: string + name: + type: string + page: + type: string + platform: + type: string + type: object + md.AppletApplicationListRes: + properties: + cooperate_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + list: + items: + $ref: '#/definitions/md.AppletApplicationListData' + type: array + platform: + items: + $ref: '#/definitions/md.SelectData' + type: array + state: + items: + $ref: '#/definitions/md.SelectData' + type: array + total: + type: integer + type: object + md.AppletApplicationMediumListData: + properties: + account: + example: 账号 + type: string + contact_name: + example: 联系人 + type: string + count: + example: 应用数量 + type: string + id: + example: id + type: string + medium_id: + example: 媒体id + type: string + name: + example: 名称 + type: string + phone: + example: 联系电话 + type: string + type: object + md.AppletApplicationMediumListReq: + properties: + account: + example: 媒体账号 + type: string + limit: + type: string + name: + example: 媒体名称 + type: string + page: + type: string + type: object + md.AppletApplicationMediumListRes: + properties: + list: + items: + $ref: '#/definitions/md.AppletApplicationMediumListData' + type: array + total: + type: integer + type: object + md.AppletApplicationSaveReq: + properties: + id: + example: id 多个逗号隔开 + type: string + memo: + example: 备注 + type: string + state: + example: 审核状态 + type: string + type: object md.AppletUpdateReq: properties: id: @@ -558,6 +817,13 @@ definitions: example: 值 type: string type: object + md.SetMobReq: + properties: + mob_app_key: + type: string + mob_app_secret: + type: string + type: object md.SetOssReq: properties: file_access_key: @@ -929,6 +1195,192 @@ paths: summary: 登陆 tags: - 登录 + /api/medium/applet/application/ad/space/audit: + post: + consumes: + - application/json + description: 小程序应用-广告位审核 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AppletApplicationAdSpaceSaveReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 广告位审核 + tags: + - 媒体中心------嘉俊 + /api/medium/applet/application/ad/space/list: + post: + consumes: + - application/json + description: 媒体中心-媒体列表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AppletApplicationAdSpaceMediumListReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容---这是data里面的数据 + schema: + $ref: '#/definitions/md.AppletApplicationAdSpaceMediumListRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 媒体列表 + tags: + - 媒体中心------嘉俊 + /api/medium/applet/application/ad/space/save: + post: + consumes: + - application/json + description: 小程序应用-广告位列表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AppletApplicationAdSpaceListReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容---这是data里面的数据 + schema: + $ref: '#/definitions/md.AppletApplicationAdSpaceListRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 广告位列表 + tags: + - 媒体中心------嘉俊 + /api/medium/applet/application/audit: + post: + consumes: + - application/json + description: 小程序应用-审核 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AppletApplicationSaveReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 审核 + tags: + - 媒体中心------嘉俊 + /api/medium/applet/application/list: + post: + consumes: + - application/json + description: 小程序应用-列表数据 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AppletApplicationListReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容---这是data里面的数据 + schema: + $ref: '#/definitions/md.AppletApplicationListRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 应用列表 + tags: + - 媒体中心------嘉俊 + /api/medium/applet/application/medium/list: + post: + consumes: + - application/json + description: 媒体中心-媒体列表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AppletApplicationMediumListReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容---这是data里面的数据 + schema: + $ref: '#/definitions/md.AppletApplicationMediumListRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 媒体列表 + tags: + - 媒体中心------嘉俊 /api/mediumQualification/bank: post: responses: @@ -1674,7 +2126,7 @@ paths: get: consumes: - application/json - description: 基础设置-oss获取 + description: 基础设置-mob获取 parameters: - description: 验证参数Bearer和token空格拼接 in: header @@ -1692,14 +2144,14 @@ paths: description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: oss获取 + summary: mob获取 tags: - 设置中心-基础设置 /api/setCenter/basic/setOss: post: consumes: - application/json - description: 基础设置-oss设置 + description: 基础设置-mob设置 parameters: - description: 验证参数Bearer和token空格拼接 in: header @@ -1711,7 +2163,7 @@ paths: name: args required: true schema: - $ref: '#/definitions/md.SetOssReq' + $ref: '#/definitions/md.SetMobReq' produces: - application/json responses: @@ -1723,7 +2175,7 @@ paths: description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: oss设置 + summary: mob设置 tags: - 设置中心-基础设置 /api/setCenter/basic/wxOpenGet: From 7dac4131cfdf5ec9a2133087d46677f2a971e0b5 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 23 Aug 2024 11:43:20 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AA=92=E4=BD=93=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/enum/enum_qualification.go | 4 +- app/hdl/hdl_agent_qualification.go | 2 +- app/hdl/hdl_applet_application.go | 6 +- .../hdl_applet_application_ad_space_list.go | 6 +- app/hdl/hdl_medium_agent.go | 123 ++++++++++++++ app/hdl/hdl_medium_qualification.go | 2 +- app/md/md_agent_qualification.go | 3 + app/md/md_medium.go | 32 ++++ app/md/md_medium_qualification.go | 3 + app/router/router.go | 10 +- app/svc/svc_agent_qualification.go | 26 ++- app/svc/svc_medium_agent.go | 156 ++++++++++++++++++ app/svc/svc_medium_qualification.go | 21 ++- go.mod | 2 +- 14 files changed, 377 insertions(+), 19 deletions(-) create mode 100644 app/hdl/hdl_medium_agent.go create mode 100644 app/md/md_medium.go create mode 100644 app/svc/svc_medium_agent.go diff --git a/app/enum/enum_qualification.go b/app/enum/enum_qualification.go index 2676250..b78af5a 100644 --- a/app/enum/enum_qualification.go +++ b/app/enum/enum_qualification.go @@ -13,11 +13,11 @@ func (gt QualificationState) String() string { case QualificationStateForNormal: return "审核成功" case QualificationStateForFail: - return "审核失败" + return "审核拒绝" case QualificationStateForWait: return "待审核" default: - return "待审核" + return "待提交" } } diff --git a/app/hdl/hdl_agent_qualification.go b/app/hdl/hdl_agent_qualification.go index 37d5ad3..c3e8081 100644 --- a/app/hdl/hdl_agent_qualification.go +++ b/app/hdl/hdl_agent_qualification.go @@ -28,7 +28,7 @@ func AgentQualificationEnterprise(c *gin.Context) { e.OutErr(c, err1.Code, err1.Error()) return } - res := svc.AgentQualificationEnterprise(c, req) + res := svc.AgentQualificationEnterprise(c, 1, req) e.OutSuc(c, res, nil) return } diff --git a/app/hdl/hdl_applet_application.go b/app/hdl/hdl_applet_application.go index 6b4151c..86ce222 100644 --- a/app/hdl/hdl_applet_application.go +++ b/app/hdl/hdl_applet_application.go @@ -15,7 +15,7 @@ import ( // @Param args body md.AppletApplicationMediumListReq true "请求参数" // @Success 200 {object} md.AppletApplicationMediumListRes "具体看返回内容---这是data里面的数据" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/medium/applet/application/medium/list [POST] +// @Router /api/mediumCenter/applet/application/medium/list [POST] func AppletApplicationMediumList(c *gin.Context) { svc.AppletApplicationMediumList(c) } @@ -30,7 +30,7 @@ func AppletApplicationMediumList(c *gin.Context) { // @Param args body md.AppletApplicationListReq true "请求参数" // @Success 200 {object} md.AppletApplicationListRes "具体看返回内容---这是data里面的数据" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/medium/applet/application/list [POST] +// @Router /api/mediumCenter/applet/application/list [POST] func AppletApplicationList(c *gin.Context) { svc.AppletApplicationList(c) } @@ -45,7 +45,7 @@ func AppletApplicationList(c *gin.Context) { // @Param args body md.AppletApplicationSaveReq true "请求参数" // @Success 200 {string} "具体看返回内容" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/medium/applet/application/audit [POST] +// @Router /api/mediumCenter/applet/application/audit [POST] func AppletApplicationAudit(c *gin.Context) { svc.AppletApplicationAudit(c) } diff --git a/app/hdl/hdl_applet_application_ad_space_list.go b/app/hdl/hdl_applet_application_ad_space_list.go index 57c61b6..29bc060 100644 --- a/app/hdl/hdl_applet_application_ad_space_list.go +++ b/app/hdl/hdl_applet_application_ad_space_list.go @@ -15,7 +15,7 @@ import ( // @Param args body md.AppletApplicationAdSpaceMediumListReq true "请求参数" // @Success 200 {object} md.AppletApplicationAdSpaceMediumListRes "具体看返回内容---这是data里面的数据" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/medium/applet/application/ad/space/list [POST] +// @Router /api/mediumCenter/applet/application/ad/space/list [POST] func AppletApplicationAdSpaceMediumList(c *gin.Context) { svc.AppletApplicationAdSpaceMediumList(c) } @@ -30,7 +30,7 @@ func AppletApplicationAdSpaceMediumList(c *gin.Context) { // @Param args body md.AppletApplicationAdSpaceListReq true "请求参数" // @Success 200 {object} md.AppletApplicationAdSpaceListRes "具体看返回内容---这是data里面的数据" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/medium/applet/application/ad/space/save [POST] +// @Router /api/mediumCenter/applet/application/ad/space/save [POST] func AppletApplicationAdSpaceList(c *gin.Context) { svc.AppletApplicationAdSpaceList(c) } @@ -45,7 +45,7 @@ func AppletApplicationAdSpaceList(c *gin.Context) { // @Param args body md.AppletApplicationAdSpaceSaveReq true "请求参数" // @Success 200 {string} "具体看返回内容" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/medium/applet/application/ad/space/audit [POST] +// @Router /api/mediumCenter/applet/application/ad/space/audit [POST] func AppletApplicationAdSpaceAudit(c *gin.Context) { svc.AppletApplicationAdSpaceAudit(c) } diff --git a/app/hdl/hdl_medium_agent.go b/app/hdl/hdl_medium_agent.go new file mode 100644 index 0000000..1cd01bd --- /dev/null +++ b/app/hdl/hdl_medium_agent.go @@ -0,0 +1,123 @@ +package hdl + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/md" + "applet/app/svc" + "github.com/gin-gonic/gin" +) + +// AgentList +// @Summary 代理列表 +// @Tags 媒体中心------嘉俊 +// @Description 媒体中心-代理列表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.AgentQualificationEnterpriseReq true "请求参数" +// @Success 200 {object} md.AgentQualificationEnterpriseRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/mediumCenter/agent/list [POST] +func AgentList(c *gin.Context) { + var req md.AgentQualificationEnterpriseReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + res := svc.AgentQualificationEnterprise(c, 0, req) + e.OutSuc(c, res, nil) + return +} + +// AgentBindMediumList +// @Summary 代理绑定媒体列表 +// @Tags 媒体中心------嘉俊 +// @Description 媒体中心-代理绑定媒体列表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.MediumListReq true "请求参数" +// @Success 200 {object} md.MediumListRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/mediumCenter/agent/bind/medium/list [POST] +func AgentBindMediumList(c *gin.Context) { + svc.AgentBindMediumList(c) + return +} + +// MediumList +// @Summary 媒体列表 +// @Tags 媒体中心------嘉俊 +// @Description 媒体中心-媒体列表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.MediumQualificationEnterpriseReq true "请求参数" +// @Success 200 {object} md.MediumQualificationEnterpriseRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/mediumCenter/medium/list [POST] +func MediumList(c *gin.Context) { + var req md.MediumQualificationEnterpriseReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + res := svc.MediumQualificationEnterprise(c, 0, req) + e.OutSuc(c, res, nil) + return +} + +// MediumBindAgentList +// @Summary 媒体绑定代理列表 +// @Tags 媒体中心------嘉俊 +// @Description 媒体中心-媒体绑定代理列表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.MediumListReq true "请求参数" +// @Success 200 {object} md.MediumListRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/mediumCenter/medium/bind/agent/list [POST] +func MediumBindAgentList(c *gin.Context) { + svc.MediumBindAgentList(c) + return +} + +// MediumBindAgentSave +// @Summary 媒体绑定代理操作 +// @Tags 媒体中心------嘉俊 +// @Description 媒体中心-媒体绑定代理操作 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.MediumListSaveReq true "请求参数" +// @Success 200 {string} "具体看返回内容 " +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/mediumCenter/medium/bind/agent/save [POST] +func MediumBindAgentSave(c *gin.Context) { + svc.MediumBindAgentSave(c) + return +} + +// MediumBindAgentDel +// @Summary 媒体绑定代理删除 +// @Tags 媒体中心------嘉俊 +// @Description 媒体中心-媒体绑定代理删除 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.MediumListDelReq true "请求参数" +// @Success 200 {string} "具体看返回内容 " +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/mediumCenter/medium/bind/agent/del [POST] +func MediumBindAgentDel(c *gin.Context) { + svc.MediumBindAgentDel(c) + return +} diff --git a/app/hdl/hdl_medium_qualification.go b/app/hdl/hdl_medium_qualification.go index cd83441..d95b6b6 100644 --- a/app/hdl/hdl_medium_qualification.go +++ b/app/hdl/hdl_medium_qualification.go @@ -28,7 +28,7 @@ func MediumQualificationEnterprise(c *gin.Context) { e.OutErr(c, err1.Code, err1.Error()) return } - res := svc.MediumQualificationEnterprise(c, req) + res := svc.MediumQualificationEnterprise(c, 1, req) e.OutSuc(c, res, nil) return } diff --git a/app/md/md_agent_qualification.go b/app/md/md_agent_qualification.go index 785c2b8..0cb840f 100644 --- a/app/md/md_agent_qualification.go +++ b/app/md/md_agent_qualification.go @@ -42,6 +42,7 @@ type AgentQualificationEnterpriseData struct { BusinessLicenseAddress string `json:"business_license_address" example:"营业执照地址"` CertificateValidity string `json:"certificate_validity" example:"证件有效期"` Memo string `json:"memo" example:"备注 审核时填写的"` + Account string `json:"account" example:"账号"` } type AgentQualificationBankRes struct { State []SelectData `json:"state" ` @@ -63,6 +64,7 @@ type AgentQualificationBankData struct { Memo string `json:"memo" example:"备注 审核时填写的"` State string `json:"state" example:"状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)"` UnifiedSocialCreditCode string `json:"unified_social_credit_code" example:"统一社会信用代码"` + Account string `json:"account" example:"账号"` } type AgentQualificationContactRes struct { @@ -81,4 +83,5 @@ type AgentQualificationContactData struct { Name string `json:"name" example:"联系人"` Phone string `json:"phone" example:"联系电话"` State string `json:"state" example:"状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)"` + Account string `json:"account" example:"账号"` } diff --git a/app/md/md_medium.go b/app/md/md_medium.go new file mode 100644 index 0000000..8a76bff --- /dev/null +++ b/app/md/md_medium.go @@ -0,0 +1,32 @@ +package md + +type MediumListReq struct { + Id string `json:"id"` + Limit string `json:"limit"` + Page string `json:"page" ` + Name string `json:"name"` + State string `json:"state"` +} +type MediumListRes struct { + State []SelectData `json:"state" ` + List []MediumListData `json:"list"` + Total int64 `json:"total"` +} +type MediumListData struct { + MediumId string `json:"medium_id" example:"媒体id"` + CompanyName string `json:"company_name" example:"公司名称"` + Id string `json:"id" example:"id"` + Memo string `json:"memo" example:"备注 审核时填写的"` + State string `json:"state" example:"状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)"` + UnifiedSocialCreditCode string `json:"unified_social_credit_code" example:"统一社会信用代码"` + LegalRepresentative string `json:"legal_representative" example:"法定代表人"` + Account string `json:"account" example:"媒体账号"` + BusinessLicenseAddress string `json:"business_license_address" example:"营业执照地址"` +} +type MediumListSaveReq struct { + Username string `json:"username"` + MediumId string `json:"medium_id"` +} +type MediumListDelReq struct { + Id string `json:"id" example:"列表id"` +} diff --git a/app/md/md_medium_qualification.go b/app/md/md_medium_qualification.go index bc3163e..f4c4c9d 100644 --- a/app/md/md_medium_qualification.go +++ b/app/md/md_medium_qualification.go @@ -42,6 +42,7 @@ type MediumQualificationEnterpriseData struct { BusinessLicenseAddress string `json:"business_license_address" example:"营业执照地址"` CertificateValidity string `json:"certificate_validity" example:"证件有效期"` Memo string `json:"memo" example:"备注 审核时填写的"` + Account string `json:"account" example:"账号"` } type MediumQualificationBankRes struct { State []SelectData `json:"state" ` @@ -63,6 +64,7 @@ type MediumQualificationBankData struct { Memo string `json:"memo" example:"备注 审核时填写的"` State string `json:"state" example:"状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)"` UnifiedSocialCreditCode string `json:"unified_social_credit_code" example:"统一社会信用代码"` + Account string `json:"account" example:"账号"` } type MediumQualificationContactRes struct { @@ -81,4 +83,5 @@ type MediumQualificationContactData struct { Name string `json:"name" example:"联系人"` Phone string `json:"phone" example:"联系电话"` State string `json:"state" example:"状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)"` + Account string `json:"account" example:"账号"` } diff --git a/app/router/router.go b/app/router/router.go index 54c2132..b99d385 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -66,7 +66,7 @@ func route(r *gin.RouterGroup) { rAgentQualification(r.Group("/agentQualification")) //渠道-资质 rMediumQualification(r.Group("/mediumQualification")) //媒体-资质 rSetCenter(r.Group("/setCenter")) //设置中心 - rMedium(r.Group("/medium")) //媒体中心 + rMedium(r.Group("/mediumCenter")) //媒体中心 } func rRole(r *gin.RouterGroup) { @@ -134,4 +134,12 @@ func rMedium(r *gin.RouterGroup) { r.POST("/applet/application/ad/space/medium/list", hdl.AppletApplicationAdSpaceMediumList) //广告管理-媒体列表 r.POST("/applet/application/ad/space/list", hdl.AppletApplicationAdSpaceList) //小程序应用-广告位列表数据 r.POST("/applet/application/ad/space/audit", hdl.AppletApplicationAdSpaceAudit) //小程序应用-广告位审核 + + r.POST("/medium/list", hdl.MediumList) //媒体列表 + r.POST("/medium/bind/agent/list", hdl.MediumBindAgentList) //媒体绑定代理列表 + r.POST("/medium/bind/agent/save", hdl.MediumBindAgentSave) //媒体绑定代理操作 + r.POST("/medium/bind/agent/del", hdl.MediumBindAgentDel) //媒体绑定代理删除 + + r.POST("/agent/list", hdl.AgentList) //代理列表 + r.POST("/agent/bind/medium/list", hdl.AgentBindMediumList) //代理绑定媒体列表 } diff --git a/app/svc/svc_agent_qualification.go b/app/svc/svc_agent_qualification.go index 1145401..cc2d66a 100644 --- a/app/svc/svc_agent_qualification.go +++ b/app/svc/svc_agent_qualification.go @@ -6,18 +6,20 @@ import ( "applet/app/md" "applet/app/utils" db "code.fnuoos.com/zhimeng/model.git/src" + implement2 "code.fnuoos.com/zhimeng/model.git/src/implement" "code.fnuoos.com/zhimeng/model.git/src/super/implement" "github.com/gin-gonic/gin" "github.com/jinzhu/copier" ) -func AgentQualificationEnterprise(c *gin.Context, req md.AgentQualificationEnterpriseReq) md.AgentQualificationEnterpriseRes { +func AgentQualificationEnterprise(c *gin.Context, minState int, req md.AgentQualificationEnterpriseReq) md.AgentQualificationEnterpriseRes { engine := db.Db agentListDb := implement.NewAgentListDb(engine) - agentList, total, _ := agentListDb.FindAgentList(req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + agentList, total, _ := agentListDb.FindAgentList(c.GetString("mid"), req.Name, req.State, minState, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) data := make([]md.AgentQualificationEnterpriseData, 0) if len(agentList) > 0 { + NewAgentDb := implement2.NewAgentDb(MasterDb(c)) for _, v := range agentList { var tmp md.AgentQualificationEnterpriseData copier.Copy(&tmp, &v) @@ -33,6 +35,10 @@ func AgentQualificationEnterprise(c *gin.Context, req md.AgentQualificationEnter tmp.RegisteredAddressCityId = utils.IntToStr(v.RegisteredAddressCityId) tmp.RegisteredAddressCountyId = utils.IntToStr(v.RegisteredAddressCountyId) tmp.State = utils.IntToStr(v.State) + agent := NewAgentDb.GetSuperAdmin(v.AgentId) + if agent != nil { + tmp.Account = agent.Username + } data = append(data, tmp) } } @@ -86,10 +92,10 @@ func AgentQualificationEnterpriseAudit(c *gin.Context, req md.AgentQualification func AgentQualificationBank(c *gin.Context, req md.AgentQualificationEnterpriseReq) md.AgentQualificationBankRes { engine := db.Db agentListDb := implement.NewAgentBankInfoDb(engine) - agentList, total, _ := agentListDb.FindAgentBankInfoList(req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) - + agentList, total, _ := agentListDb.FindAgentBankInfoList(c.GetString("mid"), req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) list := make([]md.AgentQualificationBankData, 0) if agentList != nil { + NewAgentDb := implement2.NewAgentDb(MasterDb(c)) for _, v := range agentList { tmp := md.AgentQualificationBankData{ Id: utils.IntToStr(v.AgentBankInfo.Id), @@ -105,6 +111,10 @@ func AgentQualificationBank(c *gin.Context, req md.AgentQualificationEnterpriseR BankNo: v.BankNo, Licence: v.Licence, } + agent := NewAgentDb.GetSuperAdmin(v.AgentBankInfo.AgentId) + if agent != nil { + tmp.Account = agent.Username + } list = append(list, tmp) } } @@ -162,10 +172,11 @@ func AgentQualificationBankAudit(c *gin.Context, req md.AgentQualificationEnterp func AgentQualificationContactInfo(c *gin.Context, req md.AgentQualificationEnterpriseReq) md.AgentQualificationContactRes { engine := db.Db agentListDb := implement.NewAgentContactInfoDb(engine) - agentList, total, _ := agentListDb.FindAgentContactInfoList(req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + agentList, total, _ := agentListDb.FindAgentContactInfoList(c.GetString("mid"), req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) list := make([]md.AgentQualificationContactData, 0) if agentList != nil { + NewAgentDb := implement2.NewAgentDb(MasterDb(c)) for _, v := range agentList { tmp := md.AgentQualificationContactData{ Id: utils.IntToStr(v.AgentContactInfo.Id), @@ -179,6 +190,11 @@ func AgentQualificationContactInfo(c *gin.Context, req md.AgentQualificationEnte Phone: v.AgentContactInfo.Phone, Address: v.AgentContactInfo.Address, } + + agent := NewAgentDb.GetSuperAdmin(v.AgentContactInfo.AgentId) + if agent != nil { + tmp.Account = agent.Username + } list = append(list, tmp) } } diff --git a/app/svc/svc_medium_agent.go b/app/svc/svc_medium_agent.go new file mode 100644 index 0000000..e85d0de --- /dev/null +++ b/app/svc/svc_medium_agent.go @@ -0,0 +1,156 @@ +package svc + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/md" + "applet/app/utils" + db "code.fnuoos.com/zhimeng/model.git/src" + implement2 "code.fnuoos.com/zhimeng/model.git/src/implement" + "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "code.fnuoos.com/zhimeng/model.git/src/super/model" + "github.com/gin-gonic/gin" + "strings" + "time" +) + +func AgentBindMediumList(c *gin.Context) { //代理 查旗下 媒体 + var req md.MediumListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + engine := db.Db + agentWithMediumDb := implement.NewAgentWithMediumDb(engine) + data, total, _ := agentWithMediumDb.FindAgentWithMediumList(req.Name, req.State, utils.StrToInt(req.Id), 0, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + + list := make([]md.MediumListData, 0) + NewMediumDb := implement2.NewMediumDb(MasterDb(c)) + + if data != nil { + for _, v := range data { + tmp := md.MediumListData{ + Id: utils.IntToStr(v.AgentWithMedium.Id), + MediumId: utils.IntToStr(v.AgentWithMedium.MediumId), + CompanyName: v.MediumList.CompanyName, + UnifiedSocialCreditCode: v.MediumList.UnifiedSocialCreditCode, + State: utils.IntToStr(v.MediumList.State), + Memo: v.MediumList.Memo, + LegalRepresentative: v.MediumList.LegalRepresentative, + BusinessLicenseAddress: v.MediumList.BusinessLicenseAddress, + } + medium := NewMediumDb.GetSuperAdmin(v.AgentWithMedium.MediumId) + if medium != nil { + tmp.Account = medium.Username + } + list = append(list, tmp) + } + } + res := md.MediumListRes{ + List: list, + Total: total, + State: []md.SelectData{ + {Name: "待提交", Value: "0"}, + {Name: "待审核", Value: "1"}, + {Name: "审核通过", Value: "2"}, + {Name: "审核拒绝", Value: "3"}, + }, + } + e.OutSuc(c, res, nil) + return +} +func MediumBindAgentList(c *gin.Context) { + var req md.MediumListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + engine := db.Db + agentWithMediumDb := implement.NewAgentWithMediumDb(engine) + data, total, _ := agentWithMediumDb.FindAgentWithMediumList(req.Name, req.State, 0, utils.StrToInt(req.Id), utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + + list := make([]md.MediumListData, 0) + NewAgentDb := implement2.NewAgentDb(MasterDb(c)) + + if data != nil { + for _, v := range data { + tmp := md.MediumListData{ + Id: utils.IntToStr(v.AgentWithMedium.Id), + MediumId: utils.IntToStr(v.AgentWithMedium.AgentId), + CompanyName: v.AgentList.CompanyName, + UnifiedSocialCreditCode: v.AgentList.UnifiedSocialCreditCode, + State: utils.IntToStr(v.AgentList.State), + Memo: v.AgentList.Memo, + LegalRepresentative: v.AgentList.LegalRepresentative, + BusinessLicenseAddress: v.AgentList.BusinessLicenseAddress, + } + agent := NewAgentDb.GetSuperAdmin(v.AgentWithMedium.AgentId) + if agent != nil { + tmp.Account = agent.Username + } + list = append(list, tmp) + } + } + res := md.MediumListRes{ + List: list, + Total: total, + State: []md.SelectData{ + {Name: "待提交", Value: "0"}, + {Name: "待审核", Value: "1"}, + {Name: "审核通过", Value: "2"}, + {Name: "审核拒绝", Value: "3"}, + }, + } + e.OutSuc(c, res, nil) + return +} +func MediumBindAgentSave(c *gin.Context) { + var req md.MediumListSaveReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + agentDb := implement2.NewAgentDb(MasterDb(c)) + username, _ := agentDb.GetSuperAgentByUsername(req.Username) + if username == nil { + e.OutErr(c, 400, e.NewErr(400, "渠道代理不存在")) + return + } + mediumDb := implement.NewAgentWithMediumDb(db.Db) + data := mediumDb.GetAgentWithMediumByMediumIdAndAgentId(utils.StrToInt(req.MediumId), username.AgentId) + if data != nil { + e.OutErr(c, 400, e.NewErr(400, "已绑定过该渠道代理")) + return + } + var tmp = model.AgentWithMedium{ + AgentId: username.AgentId, + MediumId: utils.StrToInt(req.MediumId), + CreateAt: time.Now(), + UpdateAt: time.Now(), + } + db.Db.InsertOne(&tmp) + e.OutSuc(c, "success", nil) + return +} +func MediumBindAgentDel(c *gin.Context) { + var req md.MediumListDelReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + db.Db.In("id", strings.Split(req.Id, ",")).Delete(&model.AgentWithMedium{}) + e.OutSuc(c, "success", nil) + return +} diff --git a/app/svc/svc_medium_qualification.go b/app/svc/svc_medium_qualification.go index 3f9e71d..7772d80 100644 --- a/app/svc/svc_medium_qualification.go +++ b/app/svc/svc_medium_qualification.go @@ -6,18 +6,20 @@ import ( "applet/app/md" "applet/app/utils" db "code.fnuoos.com/zhimeng/model.git/src" + implement2 "code.fnuoos.com/zhimeng/model.git/src/implement" "code.fnuoos.com/zhimeng/model.git/src/super/implement" "github.com/gin-gonic/gin" "github.com/jinzhu/copier" ) -func MediumQualificationEnterprise(c *gin.Context, req md.MediumQualificationEnterpriseReq) md.MediumQualificationEnterpriseRes { +func MediumQualificationEnterprise(c *gin.Context, minState int, req md.MediumQualificationEnterpriseReq) md.MediumQualificationEnterpriseRes { engine := db.Db MediumListDb := implement.NewMediumListDb(engine) - MediumList, total, _ := MediumListDb.FindMediumList(c.GetString("mid"), req.Name, req.State, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + MediumList, total, _ := MediumListDb.FindMediumList(c.GetString("mid"), req.Name, req.State, minState, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) data := make([]md.MediumQualificationEnterpriseData, 0) if len(MediumList) > 0 { + NewMediumDb := implement2.NewMediumDb(MasterDb(c)) for _, v := range MediumList { var tmp md.MediumQualificationEnterpriseData copier.Copy(&tmp, &v) @@ -33,6 +35,10 @@ func MediumQualificationEnterprise(c *gin.Context, req md.MediumQualificationEnt tmp.RegisteredAddressCityId = utils.IntToStr(v.RegisteredAddressCityId) tmp.RegisteredAddressCountyId = utils.IntToStr(v.RegisteredAddressCountyId) tmp.State = utils.IntToStr(v.State) + medium := NewMediumDb.GetSuperAdmin(v.MediumId) + if medium != nil { + tmp.Account = medium.Username + } data = append(data, tmp) } } @@ -90,6 +96,7 @@ func MediumQualificationBank(c *gin.Context, req md.MediumQualificationEnterpris list := make([]md.MediumQualificationBankData, 0) if MediumList != nil { + NewMediumDb := implement2.NewMediumDb(MasterDb(c)) for _, v := range MediumList { tmp := md.MediumQualificationBankData{ Id: utils.IntToStr(v.MediumBankInfo.Id), @@ -105,6 +112,11 @@ func MediumQualificationBank(c *gin.Context, req md.MediumQualificationEnterpris BankNo: v.BankNo, Licence: v.Licence, } + + medium := NewMediumDb.GetSuperAdmin(v.MediumBankInfo.MediumId) + if medium != nil { + tmp.Account = medium.Username + } list = append(list, tmp) } } @@ -167,6 +179,7 @@ func MediumQualificationContactInfo(c *gin.Context, req md.MediumQualificationEn list := make([]md.MediumQualificationContactData, 0) if MediumList != nil { + NewMediumDb := implement2.NewMediumDb(MasterDb(c)) for _, v := range MediumList { tmp := md.MediumQualificationContactData{ Id: utils.IntToStr(v.MediumContactInfo.Id), @@ -180,6 +193,10 @@ func MediumQualificationContactInfo(c *gin.Context, req md.MediumQualificationEn Phone: v.MediumContactInfo.Phone, Address: v.MediumContactInfo.Address, } + medium := NewMediumDb.GetSuperAdmin(v.MediumContactInfo.MediumId) + if medium != nil { + tmp.Account = medium.Username + } list = append(list, tmp) } } diff --git a/go.mod b/go.mod index b4e81cf..2706ae1 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 //replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models require ( - code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240822095043-f18aa08f09b1 + code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240823034048-34202e969e8d github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/boombuler/barcode v1.0.1 github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 From dce7c99e1308be08578a12ed0ed2d565de5da251 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 23 Aug 2024 11:48:29 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_set_center.go | 4 +- docs/docs.go | 504 +++++++++++++++++++++++++++++++++++++- docs/swagger.json | 504 +++++++++++++++++++++++++++++++++++++- docs/swagger.yaml | 342 +++++++++++++++++++++++++- 4 files changed, 1328 insertions(+), 26 deletions(-) diff --git a/app/hdl/hdl_set_center.go b/app/hdl/hdl_set_center.go index 33c61b9..1726636 100644 --- a/app/hdl/hdl_set_center.go +++ b/app/hdl/hdl_set_center.go @@ -473,7 +473,7 @@ func ShareIndex(c *gin.Context) { // @Param args body md.SetMobReq true "请求参数" // @Success 200 {string} "success" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/setCenter/basic/setOss [POST] +// @Router /api/setCenter/basic/setMob [POST] func SetMob(c *gin.Context) { var req md.SetMobReq err := c.ShouldBindJSON(&req) @@ -501,7 +501,7 @@ func SetMob(c *gin.Context) { // @Produce json // @Success 200 {object} md.SetOssResp // @Failure 400 {object} md.Response "具体错误" -// @Router /api/setCenter/basic/getOss [GET] +// @Router /api/setCenter/basic/getMob [GET] func GetMob(c *gin.Context) { masterId := svc.GetMasterId(c) engine := db.DBs[masterId] diff --git a/docs/docs.go b/docs/docs.go index 99146af..691a490 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -347,7 +347,101 @@ const docTemplate = `{ } } }, - "/api/medium/applet/application/ad/space/audit": { + "/api/mediumCenter/agent/bind/medium/list": { + "post": { + "description": "媒体中心-代理绑定媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "代理绑定媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/agent/list": { + "post": { + "description": "媒体中心-代理列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "代理列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AgentQualificationEnterpriseReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AgentQualificationEnterpriseRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/applet/application/ad/space/audit": { "post": { "description": "小程序应用-广告位审核", "consumes": [ @@ -394,7 +488,7 @@ const docTemplate = `{ } } }, - "/api/medium/applet/application/ad/space/list": { + "/api/mediumCenter/applet/application/ad/space/list": { "post": { "description": "媒体中心-媒体列表", "consumes": [ @@ -441,7 +535,7 @@ const docTemplate = `{ } } }, - "/api/medium/applet/application/ad/space/save": { + "/api/mediumCenter/applet/application/ad/space/save": { "post": { "description": "小程序应用-广告位列表", "consumes": [ @@ -488,7 +582,7 @@ const docTemplate = `{ } } }, - "/api/medium/applet/application/audit": { + "/api/mediumCenter/applet/application/audit": { "post": { "description": "小程序应用-审核", "consumes": [ @@ -535,7 +629,7 @@ const docTemplate = `{ } } }, - "/api/medium/applet/application/list": { + "/api/mediumCenter/applet/application/list": { "post": { "description": "小程序应用-列表数据", "consumes": [ @@ -582,7 +676,7 @@ const docTemplate = `{ } } }, - "/api/medium/applet/application/medium/list": { + "/api/mediumCenter/applet/application/medium/list": { "post": { "description": "媒体中心-媒体列表", "consumes": [ @@ -629,6 +723,194 @@ const docTemplate = `{ } } }, + "/api/mediumCenter/medium/bind/agent/del": { + "post": { + "description": "媒体中心-媒体绑定代理删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体绑定代理删除", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumListDelReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/medium/bind/agent/list": { + "post": { + "description": "媒体中心-媒体绑定代理列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体绑定代理列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/medium/bind/agent/save": { + "post": { + "description": "媒体中心-媒体绑定代理操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体绑定代理操作", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumListSaveReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/medium/list": { + "post": { + "description": "媒体中心-媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumQualificationEnterpriseReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumQualificationEnterpriseRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/mediumQualification/bank": { "post": { "responses": { @@ -1755,7 +2037,7 @@ const docTemplate = `{ } } }, - "/api/setCenter/basic/getOss": { + "/api/setCenter/basic/getMob": { "get": { "description": "基础设置-mob获取", "consumes": [ @@ -1793,7 +2075,45 @@ const docTemplate = `{ } } }, - "/api/setCenter/basic/setOss": { + "/api/setCenter/basic/getOss": { + "get": { + "description": "基础设置-oss获取", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "设置中心-基础设置" + ], + "summary": "oss获取", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/md.SetOssResp" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/setCenter/basic/setMob": { "post": { "description": "基础设置-mob设置", "consumes": [ @@ -1840,6 +2160,53 @@ const docTemplate = `{ } } }, + "/api/setCenter/basic/setOss": { + "post": { + "description": "基础设置-oss设置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "设置中心-基础设置" + ], + "summary": "oss设置", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SetOssReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/setCenter/basic/wxOpenGet": { "get": { "description": "基础设置-微信三方应用获取", @@ -2136,6 +2503,10 @@ const docTemplate = `{ "md.AgentQualificationBankData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "agent_id": { "type": "string", "example": "代理id" @@ -2221,6 +2592,10 @@ const docTemplate = `{ "md.AgentQualificationContactData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "address": { "type": "string", "example": "联系地址" @@ -2300,6 +2675,10 @@ const docTemplate = `{ "md.AgentQualificationEnterpriseData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "agent_id": { "type": "string", "example": "代理id" @@ -2899,9 +3278,114 @@ const docTemplate = `{ } } }, + "md.MediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "business_license_address": { + "type": "string", + "example": "营业执照地址" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "id": { + "type": "string", + "example": "id" + }, + "legal_representative": { + "type": "string", + "example": "法定代表人" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + } + } + }, + "md.MediumListDelReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.MediumListReq": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.MediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.MediumListData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.MediumListSaveReq": { + "type": "object", + "properties": { + "medium_id": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, "md.MediumQualificationContactData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "address": { "type": "string", "example": "联系地址" @@ -2981,6 +3465,10 @@ const docTemplate = `{ "md.MediumQualificationEnterpriseData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "business_license_address": { "type": "string", "example": "营业执照地址" diff --git a/docs/swagger.json b/docs/swagger.json index 6e87057..ee13f32 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -339,7 +339,101 @@ } } }, - "/api/medium/applet/application/ad/space/audit": { + "/api/mediumCenter/agent/bind/medium/list": { + "post": { + "description": "媒体中心-代理绑定媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "代理绑定媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/agent/list": { + "post": { + "description": "媒体中心-代理列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "代理列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AgentQualificationEnterpriseReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.AgentQualificationEnterpriseRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/applet/application/ad/space/audit": { "post": { "description": "小程序应用-广告位审核", "consumes": [ @@ -386,7 +480,7 @@ } } }, - "/api/medium/applet/application/ad/space/list": { + "/api/mediumCenter/applet/application/ad/space/list": { "post": { "description": "媒体中心-媒体列表", "consumes": [ @@ -433,7 +527,7 @@ } } }, - "/api/medium/applet/application/ad/space/save": { + "/api/mediumCenter/applet/application/ad/space/save": { "post": { "description": "小程序应用-广告位列表", "consumes": [ @@ -480,7 +574,7 @@ } } }, - "/api/medium/applet/application/audit": { + "/api/mediumCenter/applet/application/audit": { "post": { "description": "小程序应用-审核", "consumes": [ @@ -527,7 +621,7 @@ } } }, - "/api/medium/applet/application/list": { + "/api/mediumCenter/applet/application/list": { "post": { "description": "小程序应用-列表数据", "consumes": [ @@ -574,7 +668,7 @@ } } }, - "/api/medium/applet/application/medium/list": { + "/api/mediumCenter/applet/application/medium/list": { "post": { "description": "媒体中心-媒体列表", "consumes": [ @@ -621,6 +715,194 @@ } } }, + "/api/mediumCenter/medium/bind/agent/del": { + "post": { + "description": "媒体中心-媒体绑定代理删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体绑定代理删除", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumListDelReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/medium/bind/agent/list": { + "post": { + "description": "媒体中心-媒体绑定代理列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体绑定代理列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/medium/bind/agent/save": { + "post": { + "description": "媒体中心-媒体绑定代理操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体绑定代理操作", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumListSaveReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/mediumCenter/medium/list": { + "post": { + "description": "媒体中心-媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.MediumQualificationEnterpriseReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumQualificationEnterpriseRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/mediumQualification/bank": { "post": { "responses": { @@ -1747,7 +2029,7 @@ } } }, - "/api/setCenter/basic/getOss": { + "/api/setCenter/basic/getMob": { "get": { "description": "基础设置-mob获取", "consumes": [ @@ -1785,7 +2067,45 @@ } } }, - "/api/setCenter/basic/setOss": { + "/api/setCenter/basic/getOss": { + "get": { + "description": "基础设置-oss获取", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "设置中心-基础设置" + ], + "summary": "oss获取", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/md.SetOssResp" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/setCenter/basic/setMob": { "post": { "description": "基础设置-mob设置", "consumes": [ @@ -1832,6 +2152,53 @@ } } }, + "/api/setCenter/basic/setOss": { + "post": { + "description": "基础设置-oss设置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "设置中心-基础设置" + ], + "summary": "oss设置", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SetOssReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/setCenter/basic/wxOpenGet": { "get": { "description": "基础设置-微信三方应用获取", @@ -2128,6 +2495,10 @@ "md.AgentQualificationBankData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "agent_id": { "type": "string", "example": "代理id" @@ -2213,6 +2584,10 @@ "md.AgentQualificationContactData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "address": { "type": "string", "example": "联系地址" @@ -2292,6 +2667,10 @@ "md.AgentQualificationEnterpriseData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "agent_id": { "type": "string", "example": "代理id" @@ -2891,9 +3270,114 @@ } } }, + "md.MediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "business_license_address": { + "type": "string", + "example": "营业执照地址" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "id": { + "type": "string", + "example": "id" + }, + "legal_representative": { + "type": "string", + "example": "法定代表人" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + } + } + }, + "md.MediumListDelReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.MediumListReq": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.MediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.MediumListData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.MediumListSaveReq": { + "type": "object", + "properties": { + "medium_id": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, "md.MediumQualificationContactData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "address": { "type": "string", "example": "联系地址" @@ -2973,6 +3457,10 @@ "md.MediumQualificationEnterpriseData": { "type": "object", "properties": { + "account": { + "type": "string", + "example": "账号" + }, "business_license_address": { "type": "string", "example": "营业执照地址" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index e4ff0d2..9c50709 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -57,6 +57,9 @@ definitions: type: object md.AgentQualificationBankData: properties: + account: + example: 账号 + type: string agent_id: example: 代理id type: string @@ -117,6 +120,9 @@ definitions: type: object md.AgentQualificationContactData: properties: + account: + example: 账号 + type: string address: example: 联系地址 type: string @@ -172,6 +178,9 @@ definitions: type: object md.AgentQualificationEnterpriseData: properties: + account: + example: 账号 + type: string agent_id: example: 代理id type: string @@ -592,8 +601,80 @@ definitions: token: type: string type: object + md.MediumListData: + properties: + account: + example: 媒体账号 + type: string + business_license_address: + example: 营业执照地址 + type: string + company_name: + example: 公司名称 + type: string + id: + example: id + type: string + legal_representative: + example: 法定代表人 + type: string + medium_id: + example: 媒体id + type: string + memo: + example: 备注 审核时填写的 + type: string + state: + example: 状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝) + type: string + unified_social_credit_code: + example: 统一社会信用代码 + type: string + type: object + md.MediumListDelReq: + properties: + id: + example: 列表id + type: string + type: object + md.MediumListReq: + properties: + id: + type: string + limit: + type: string + name: + type: string + page: + type: string + state: + type: string + type: object + md.MediumListRes: + properties: + list: + items: + $ref: '#/definitions/md.MediumListData' + type: array + state: + items: + $ref: '#/definitions/md.SelectData' + type: array + total: + type: integer + type: object + md.MediumListSaveReq: + properties: + medium_id: + type: string + username: + type: string + type: object md.MediumQualificationContactData: properties: + account: + example: 账号 + type: string address: example: 联系地址 type: string @@ -649,6 +730,9 @@ definitions: type: object md.MediumQualificationEnterpriseData: properties: + account: + example: 账号 + type: string business_license_address: example: 营业执照地址 type: string @@ -1195,7 +1279,69 @@ paths: summary: 登陆 tags: - 登录 - /api/medium/applet/application/ad/space/audit: + /api/mediumCenter/agent/bind/medium/list: + post: + consumes: + - application/json + description: 媒体中心-代理绑定媒体列表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.MediumListReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.MediumListRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 代理绑定媒体列表 + tags: + - 媒体中心------嘉俊 + /api/mediumCenter/agent/list: + post: + consumes: + - application/json + description: 媒体中心-代理列表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AgentQualificationEnterpriseReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.AgentQualificationEnterpriseRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 代理列表 + tags: + - 媒体中心------嘉俊 + /api/mediumCenter/applet/application/ad/space/audit: post: consumes: - application/json @@ -1226,7 +1372,7 @@ paths: summary: 广告位审核 tags: - 媒体中心------嘉俊 - /api/medium/applet/application/ad/space/list: + /api/mediumCenter/applet/application/ad/space/list: post: consumes: - application/json @@ -1257,7 +1403,7 @@ paths: summary: 媒体列表 tags: - 媒体中心------嘉俊 - /api/medium/applet/application/ad/space/save: + /api/mediumCenter/applet/application/ad/space/save: post: consumes: - application/json @@ -1288,7 +1434,7 @@ paths: summary: 广告位列表 tags: - 媒体中心------嘉俊 - /api/medium/applet/application/audit: + /api/mediumCenter/applet/application/audit: post: consumes: - application/json @@ -1319,7 +1465,7 @@ paths: summary: 审核 tags: - 媒体中心------嘉俊 - /api/medium/applet/application/list: + /api/mediumCenter/applet/application/list: post: consumes: - application/json @@ -1350,7 +1496,7 @@ paths: summary: 应用列表 tags: - 媒体中心------嘉俊 - /api/medium/applet/application/medium/list: + /api/mediumCenter/applet/application/medium/list: post: consumes: - application/json @@ -1381,6 +1527,130 @@ paths: summary: 媒体列表 tags: - 媒体中心------嘉俊 + /api/mediumCenter/medium/bind/agent/del: + post: + consumes: + - application/json + description: 媒体中心-媒体绑定代理删除 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.MediumListDelReq' + produces: + - application/json + responses: + "200": + description: '具体看返回内容 ' + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 媒体绑定代理删除 + tags: + - 媒体中心------嘉俊 + /api/mediumCenter/medium/bind/agent/list: + post: + consumes: + - application/json + description: 媒体中心-媒体绑定代理列表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.MediumListReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.MediumListRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 媒体绑定代理列表 + tags: + - 媒体中心------嘉俊 + /api/mediumCenter/medium/bind/agent/save: + post: + consumes: + - application/json + description: 媒体中心-媒体绑定代理操作 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.MediumListSaveReq' + produces: + - application/json + responses: + "200": + description: '具体看返回内容 ' + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 媒体绑定代理操作 + tags: + - 媒体中心------嘉俊 + /api/mediumCenter/medium/list: + post: + consumes: + - application/json + description: 媒体中心-媒体列表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.MediumQualificationEnterpriseReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.MediumQualificationEnterpriseRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 媒体列表 + tags: + - 媒体中心------嘉俊 /api/mediumQualification/bank: post: responses: @@ -2122,7 +2392,7 @@ paths: summary: 更新 tags: - 设置中心-小程序设置 - /api/setCenter/basic/getOss: + /api/setCenter/basic/getMob: get: consumes: - application/json @@ -2147,7 +2417,32 @@ paths: summary: mob获取 tags: - 设置中心-基础设置 - /api/setCenter/basic/setOss: + /api/setCenter/basic/getOss: + get: + consumes: + - application/json + description: 基础设置-oss获取 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/md.SetOssResp' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: oss获取 + tags: + - 设置中心-基础设置 + /api/setCenter/basic/setMob: post: consumes: - application/json @@ -2178,6 +2473,37 @@ paths: summary: mob设置 tags: - 设置中心-基础设置 + /api/setCenter/basic/setOss: + post: + consumes: + - application/json + description: 基础设置-oss设置 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.SetOssReq' + produces: + - application/json + responses: + "200": + description: success + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: oss设置 + tags: + - 设置中心-基础设置 /api/setCenter/basic/wxOpenGet: get: consumes: