mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-29 14:01:26 +08:00
【更新】更新
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"pandax/apps/resource/entity"
|
||||
"pandax/apps/resource/services"
|
||||
"pandax/base/biz"
|
||||
"pandax/base/ctx"
|
||||
"pandax/base/ginx"
|
||||
email "pandax/base/mail"
|
||||
"pandax/base/utils"
|
||||
@@ -30,7 +29,7 @@ type ResEmailsApi struct {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /resource/email/list [get]
|
||||
// @Security
|
||||
func (p *ResEmailsApi) GetResEmailsList(rc *ctx.ReqCtx) {
|
||||
func (p *ResEmailsApi) GetResEmailsList(rc *ginx.ReqCtx) {
|
||||
|
||||
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
|
||||
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
|
||||
@@ -60,7 +59,7 @@ func (p *ResEmailsApi) GetResEmailsList(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /resource/email/{mailId} [get]
|
||||
// @Security
|
||||
func (p *ResEmailsApi) GetResEmails(rc *ctx.ReqCtx) {
|
||||
func (p *ResEmailsApi) GetResEmails(rc *ginx.ReqCtx) {
|
||||
mailId := ginx.PathParamInt(rc.GinCtx, "mailId")
|
||||
p.ResEmailsApp.FindOne(int64(mailId))
|
||||
}
|
||||
@@ -75,7 +74,7 @@ func (p *ResEmailsApi) GetResEmails(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /resource/email [post]
|
||||
// @Security X-TOKEN
|
||||
func (p *ResEmailsApi) InsertResEmails(rc *ctx.ReqCtx) {
|
||||
func (p *ResEmailsApi) InsertResEmails(rc *ginx.ReqCtx) {
|
||||
var data entity.ResEmail
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
@@ -92,7 +91,7 @@ func (p *ResEmailsApi) InsertResEmails(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /resource/email [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *ResEmailsApi) UpdateResEmails(rc *ctx.ReqCtx) {
|
||||
func (p *ResEmailsApi) UpdateResEmails(rc *ginx.ReqCtx) {
|
||||
var data entity.ResEmail
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
if utils.ISDdmMail(data.From) {
|
||||
@@ -111,7 +110,7 @@ func (p *ResEmailsApi) UpdateResEmails(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /resource/email/{mailId} [delete]
|
||||
func (p *ResEmailsApi) DeleteResEmails(rc *ctx.ReqCtx) {
|
||||
func (p *ResEmailsApi) DeleteResEmails(rc *ginx.ReqCtx) {
|
||||
|
||||
mailId := rc.GinCtx.Param("mailId")
|
||||
mailIds := utils.IdsStrToIdsIntGroup(mailId)
|
||||
@@ -128,7 +127,7 @@ func (p *ResEmailsApi) DeleteResEmails(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /resource/oss [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *ResEmailsApi) UpdateMailStatus(rc *ctx.ReqCtx) {
|
||||
func (p *ResEmailsApi) UpdateMailStatus(rc *ginx.ReqCtx) {
|
||||
var data entity.ResEmail
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
@@ -145,7 +144,7 @@ func (p *ResEmailsApi) UpdateMailStatus(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /resource/email/debugMail [post]
|
||||
// @Security X-TOKEN
|
||||
func (p *ResEmailsApi) DebugMail(rc *ctx.ReqCtx) {
|
||||
func (p *ResEmailsApi) DebugMail(rc *ginx.ReqCtx) {
|
||||
var data from.SendMail
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"pandax/apps/resource/entity"
|
||||
"pandax/apps/resource/services"
|
||||
"pandax/base/biz"
|
||||
"pandax/base/ctx"
|
||||
"pandax/base/ginx"
|
||||
"pandax/base/oss"
|
||||
"pandax/base/utils"
|
||||
@@ -32,7 +31,7 @@ type ResOssesApi struct {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /resource/oss/list [get]
|
||||
// @Security
|
||||
func (p *ResOssesApi) GetResOssesList(rc *ctx.ReqCtx) {
|
||||
func (p *ResOssesApi) GetResOssesList(rc *ginx.ReqCtx) {
|
||||
|
||||
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
|
||||
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
|
||||
@@ -63,7 +62,7 @@ func (p *ResOssesApi) GetResOssesList(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /resource/oss/{ossId} [get]
|
||||
// @Security
|
||||
func (p *ResOssesApi) GetResOsses(rc *ctx.ReqCtx) {
|
||||
func (p *ResOssesApi) GetResOsses(rc *ginx.ReqCtx) {
|
||||
ossId := ginx.PathParamInt(rc.GinCtx, "ossId")
|
||||
p.ResOssesApp.FindOne(int64(ossId))
|
||||
}
|
||||
@@ -78,7 +77,7 @@ func (p *ResOssesApi) GetResOsses(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /resource/oss [post]
|
||||
// @Security X-TOKEN
|
||||
func (p *ResOssesApi) InsertResOsses(rc *ctx.ReqCtx) {
|
||||
func (p *ResOssesApi) InsertResOsses(rc *ginx.ReqCtx) {
|
||||
var data entity.ResOss
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
@@ -95,7 +94,7 @@ func (p *ResOssesApi) InsertResOsses(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /resource/oss [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *ResOssesApi) UpdateResOsses(rc *ctx.ReqCtx) {
|
||||
func (p *ResOssesApi) UpdateResOsses(rc *ginx.ReqCtx) {
|
||||
var data entity.ResOss
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
if utils.IsDdmKey(data.AccessKey) {
|
||||
@@ -114,7 +113,7 @@ func (p *ResOssesApi) UpdateResOsses(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /resource/oss/{ossId} [delete]
|
||||
func (p *ResOssesApi) DeleteResOsses(rc *ctx.ReqCtx) {
|
||||
func (p *ResOssesApi) DeleteResOsses(rc *ginx.ReqCtx) {
|
||||
|
||||
ossId := rc.GinCtx.Param("ossId")
|
||||
ossIds := utils.IdsStrToIdsIntGroup(ossId)
|
||||
@@ -127,7 +126,7 @@ func (p *ResOssesApi) DeleteResOsses(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /resource/oss/uploadFile [post]
|
||||
func (p *ResOssesApi) UplaodResOsses(rc *ctx.ReqCtx) {
|
||||
func (p *ResOssesApi) UplaodResOsses(rc *ginx.ReqCtx) {
|
||||
file, _ := rc.GinCtx.FormFile("file")
|
||||
ossCode, _ := rc.GinCtx.GetQuery("ossCode")
|
||||
list := p.ResOssesApp.FindList(entity.ResOss{OssCode: ossCode})
|
||||
@@ -151,7 +150,7 @@ func (p *ResOssesApi) UplaodResOsses(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /resource/oss [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *ResOssesApi) UpdateOssStatus(rc *ctx.ReqCtx) {
|
||||
func (p *ResOssesApi) UpdateOssStatus(rc *ginx.ReqCtx) {
|
||||
var data entity.ResOss
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user