mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-29 12:31: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"
|
||||
"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