mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
【更新】更新
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
entity "pandax/apps/system/entity"
|
||||
services "pandax/apps/system/services"
|
||||
"pandax/base/biz"
|
||||
"pandax/base/ctx"
|
||||
"pandax/base/ginx"
|
||||
"pandax/base/utils"
|
||||
"pandax/pkg/global"
|
||||
@@ -27,7 +26,7 @@ type DictApi struct {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/type/list [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictTypeList(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) GetDictTypeList(rc *ginx.ReqCtx) {
|
||||
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
|
||||
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
|
||||
status := rc.GinCtx.Query("status")
|
||||
@@ -50,7 +49,7 @@ func (p *DictApi) GetDictTypeList(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/type/{dictId} [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictType(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) GetDictType(rc *ginx.ReqCtx) {
|
||||
dictId := ginx.PathParamInt(rc.GinCtx, "dictId")
|
||||
p.DictType.FindOne(int64(dictId))
|
||||
}
|
||||
@@ -65,7 +64,7 @@ func (p *DictApi) GetDictType(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dict/type [post]
|
||||
// @Security X-TOKEN
|
||||
func (p *DictApi) InsertDictType(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) InsertDictType(rc *ginx.ReqCtx) {
|
||||
var dict entity.SysDictType
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &dict)
|
||||
|
||||
@@ -83,7 +82,7 @@ func (p *DictApi) InsertDictType(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dict/type [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *DictApi) UpdateDictType(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) UpdateDictType(rc *ginx.ReqCtx) {
|
||||
var dict entity.SysDictType
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &dict)
|
||||
|
||||
@@ -98,7 +97,7 @@ func (p *DictApi) UpdateDictType(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dict/type/{dictId} [delete]
|
||||
func (p *DictApi) DeleteDictType(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) DeleteDictType(rc *ginx.ReqCtx) {
|
||||
dictId := rc.GinCtx.Param("dictId")
|
||||
dictIds := utils.IdsStrToIdsIntGroup(dictId)
|
||||
|
||||
@@ -124,7 +123,7 @@ func (p *DictApi) DeleteDictType(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dict/type/export [get]
|
||||
func (p *DictApi) ExportDictType(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) ExportDictType(rc *ginx.ReqCtx) {
|
||||
filename := rc.GinCtx.Query("filename")
|
||||
status := rc.GinCtx.Query("status")
|
||||
dictName := rc.GinCtx.Query("dictName")
|
||||
@@ -145,7 +144,7 @@ func (p *DictApi) ExportDictType(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/data/list [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictDataList(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) GetDictDataList(rc *ginx.ReqCtx) {
|
||||
dictLabel := rc.GinCtx.Query("dictLabel")
|
||||
dictType := rc.GinCtx.Query("dictType")
|
||||
status := rc.GinCtx.Query("status")
|
||||
@@ -159,7 +158,7 @@ func (p *DictApi) GetDictDataList(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/data/type [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictDataListByDictType(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) GetDictDataListByDictType(rc *ginx.ReqCtx) {
|
||||
dictType := rc.GinCtx.Query("dictType")
|
||||
biz.IsTrue(dictType != "", "请传入字典类型")
|
||||
rc.ResData = p.DictData.FindList(entity.SysDictData{DictType: dictType})
|
||||
@@ -172,7 +171,7 @@ func (p *DictApi) GetDictDataListByDictType(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/data/{dictCode} [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictData(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) GetDictData(rc *ginx.ReqCtx) {
|
||||
dictCode := ginx.PathParamInt(rc.GinCtx, "dictCode")
|
||||
p.DictData.FindOne(int64(dictCode))
|
||||
}
|
||||
@@ -187,7 +186,7 @@ func (p *DictApi) GetDictData(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dict/data [post]
|
||||
// @Security X-TOKEN
|
||||
func (p *DictApi) InsertDictData(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) InsertDictData(rc *ginx.ReqCtx) {
|
||||
var data entity.SysDictData
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
@@ -205,7 +204,7 @@ func (p *DictApi) InsertDictData(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dict/data [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *DictApi) UpdateDictData(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) UpdateDictData(rc *ginx.ReqCtx) {
|
||||
var data entity.SysDictData
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
@@ -220,7 +219,7 @@ func (p *DictApi) UpdateDictData(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dict/data/{dictCode} [delete]
|
||||
func (p *DictApi) DeleteDictData(rc *ctx.ReqCtx) {
|
||||
func (p *DictApi) DeleteDictData(rc *ginx.ReqCtx) {
|
||||
param := rc.GinCtx.Param("dictCode")
|
||||
p.DictData.Delete(utils.IdsStrToIdsIntGroup(param))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user