1.新建产品管理相关接口;
2.go fmt项目;
This commit is contained in:
parent
62d101c2bc
commit
1759253505
119
app/admin/apis/product_manage/a_product_manage.go
Normal file
119
app/admin/apis/product_manage/a_product_manage.go
Normal file
|
@ -0,0 +1,119 @@
|
|||
package product_manage
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/app/admin/models/m_product_manage"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ProductList 查询产品列表
|
||||
// @Summary 查询产品列表
|
||||
// @Tags 产品管理
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Param request body m_product_manage.ProductListReq true "查询产品列表模型"
|
||||
// @Success 200 {object} m_product_manage.ProductListResp
|
||||
// @Router /api/v1/product/list [post]
|
||||
func ProductList(c *gin.Context) {
|
||||
var req m_product_manage.ProductListReq
|
||||
|
||||
// 解析请求参数
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
// 调用服务层的 GetProductList 函数获取数据
|
||||
resp, err := m_product_manage.GetProductList(c.Request.Context(), req)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "查询失败"})
|
||||
return
|
||||
}
|
||||
|
||||
// 返回查询结果
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
// CreateProduct 新建产品
|
||||
// @Summary 新建产品
|
||||
// @Tags 产品管理
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Param request body m_product_manage.CreateProductReq true "新建产品模型"
|
||||
// @Success 200 {object} m_product_manage.CreateProductResp
|
||||
// @Router /api/v1/product/create [post]
|
||||
func CreateProduct(c *gin.Context) {
|
||||
var req m_product_manage.CreateProductReq
|
||||
|
||||
// 解析请求参数
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
// 调用服务层的 CreateProduct 函数来处理逻辑
|
||||
resp, err := m_product_manage.CreateProduct(req)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "创建失败"})
|
||||
return
|
||||
}
|
||||
|
||||
// 返回创建结果
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
// EditProduct 编辑产品
|
||||
// @Summary 编辑产品
|
||||
// @Tags 产品管理
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Param request body m_product_manage.EditProductReq true "编辑产品模型"
|
||||
// @Success 200 {object} m_product_manage.EditProductResp
|
||||
// @Router /api/v1/product/edit [post]
|
||||
func EditProduct(c *gin.Context) {
|
||||
var req m_product_manage.EditProductReq
|
||||
|
||||
// 解析请求参数
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
// 调用服务层的 EditProduct 函数来处理逻辑
|
||||
resp, err := m_product_manage.EditProduct(req)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "编辑失败"})
|
||||
return
|
||||
}
|
||||
|
||||
// 返回编辑结果
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
// DeleteProduct 删除产品
|
||||
// @Summary 删除产品
|
||||
// @Tags 产品管理
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Param request body m_product_manage.DeleteProductReq true "删除产品模型"
|
||||
// @Success 200 {object} m_product_manage.DeleteProductResp
|
||||
// @Router /api/v1/product/delete [post]
|
||||
func DeleteProduct(c *gin.Context) {
|
||||
var req m_product_manage.DeleteProductReq
|
||||
|
||||
// 解析请求参数
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
// 调用服务层的 DeleteProduct 函数来处理逻辑
|
||||
resp, err := m_product_manage.DeleteProduct(req)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "删除失败"})
|
||||
return
|
||||
}
|
||||
|
||||
// 返回删除结果
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
|
@ -145,4 +145,4 @@ func (e SysApi) DeleteSysApi(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
e.OK(req.GetId(), "删除成功")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,5 +216,5 @@ func (e SysDictData) GetAll(c *gin.Context) {
|
|||
l = append(l, d)
|
||||
}
|
||||
|
||||
e.OK(l,"查询成功")
|
||||
e.OK(l, "查询成功")
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ type SysDictType struct {
|
|||
// @Security Bearer
|
||||
func (e SysDictType) GetPage(c *gin.Context) {
|
||||
s := service.SysDictType{}
|
||||
req :=dto.SysDictTypeGetPageReq{}
|
||||
req := dto.SysDictTypeGetPageReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.Form).
|
||||
|
@ -62,7 +62,7 @@ func (e SysDictType) GetPage(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysDictType) Get(c *gin.Context) {
|
||||
s := service.SysDictType{}
|
||||
req :=dto.SysDictTypeGetReq{}
|
||||
req := dto.SysDictTypeGetReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, nil).
|
||||
|
@ -82,7 +82,7 @@ func (e SysDictType) Get(c *gin.Context) {
|
|||
e.OK(object, "查询成功")
|
||||
}
|
||||
|
||||
//Insert 字典类型创建
|
||||
// Insert 字典类型创建
|
||||
// @Summary 添加字典类型
|
||||
// @Description 获取JSON
|
||||
// @Tags 字典类型
|
||||
|
@ -94,7 +94,7 @@ func (e SysDictType) Get(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysDictType) Insert(c *gin.Context) {
|
||||
s := service.SysDictType{}
|
||||
req :=dto.SysDictTypeInsertReq{}
|
||||
req := dto.SysDictTypeInsertReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.JSON).
|
||||
|
@ -109,7 +109,7 @@ func (e SysDictType) Insert(c *gin.Context) {
|
|||
err = s.Insert(&req)
|
||||
if err != nil {
|
||||
e.Logger.Error(err)
|
||||
e.Error(500, err,fmt.Sprintf(" 创建字典类型失败,详情:%s", err.Error()))
|
||||
e.Error(500, err, fmt.Sprintf(" 创建字典类型失败,详情:%s", err.Error()))
|
||||
return
|
||||
}
|
||||
e.OK(req.GetId(), "创建成功")
|
||||
|
@ -127,7 +127,7 @@ func (e SysDictType) Insert(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysDictType) Update(c *gin.Context) {
|
||||
s := service.SysDictType{}
|
||||
req :=dto.SysDictTypeUpdateReq{}
|
||||
req := dto.SysDictTypeUpdateReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.JSON, nil).
|
||||
|
@ -157,7 +157,7 @@ func (e SysDictType) Update(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysDictType) Delete(c *gin.Context) {
|
||||
s := service.SysDictType{}
|
||||
req :=dto.SysDictTypeDeleteReq{}
|
||||
req := dto.SysDictTypeDeleteReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.JSON, nil).
|
||||
|
@ -189,7 +189,7 @@ func (e SysDictType) Delete(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysDictType) GetAll(c *gin.Context) {
|
||||
s := service.SysDictType{}
|
||||
req :=dto.SysDictTypeGetPageReq{}
|
||||
req := dto.SysDictTypeGetPageReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.Form).
|
||||
|
@ -207,4 +207,4 @@ func (e SysDictType) GetAll(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
e.OK(list, "查询成功")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ type SysLoginLog struct {
|
|||
// @Security Bearer
|
||||
func (e SysLoginLog) GetPage(c *gin.Context) {
|
||||
s := service.SysLoginLog{}
|
||||
req :=dto.SysLoginLogGetPageReq{}
|
||||
req := dto.SysLoginLogGetPageReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.Form).
|
||||
|
@ -60,7 +60,7 @@ func (e SysLoginLog) GetPage(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysLoginLog) Get(c *gin.Context) {
|
||||
s := service.SysLoginLog{}
|
||||
req :=dto.SysLoginLogGetReq{}
|
||||
req := dto.SysLoginLogGetReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req).
|
||||
|
@ -90,7 +90,7 @@ func (e SysLoginLog) Get(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysLoginLog) Delete(c *gin.Context) {
|
||||
s := service.SysLoginLog{}
|
||||
req :=dto.SysLoginLogDeleteReq{}
|
||||
req := dto.SysLoginLogDeleteReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.JSON, nil).
|
||||
|
@ -107,4 +107,4 @@ func (e SysLoginLog) Delete(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
e.OK(req.GetId(), "删除成功")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,7 +253,7 @@ func (e SysMenu) GetMenuRole(c *gin.Context) {
|
|||
func (e SysMenu) GetMenuTreeSelect(c *gin.Context) {
|
||||
m := service.SysMenu{}
|
||||
r := service.SysRole{}
|
||||
req :=dto.SelectRole{}
|
||||
req := dto.SelectRole{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
MakeService(&m.Service).
|
||||
|
@ -284,4 +284,4 @@ func (e SysMenu) GetMenuTreeSelect(c *gin.Context) {
|
|||
"menus": result,
|
||||
"checkedKeys": menuIds,
|
||||
}, "获取成功")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ func (e SysOperaLog) GetPage(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysOperaLog) Get(c *gin.Context) {
|
||||
s := new(service.SysOperaLog)
|
||||
req :=dto.SysOperaLogGetReq{}
|
||||
req := dto.SysOperaLogGetReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, nil).
|
||||
|
@ -96,7 +96,7 @@ func (e SysOperaLog) Get(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysOperaLog) Delete(c *gin.Context) {
|
||||
s := new(service.SysOperaLog)
|
||||
req :=dto.SysOperaLogDeleteReq{}
|
||||
req := dto.SysOperaLogDeleteReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.JSON).
|
||||
|
@ -111,7 +111,7 @@ func (e SysOperaLog) Delete(c *gin.Context) {
|
|||
err = s.Remove(&req)
|
||||
if err != nil {
|
||||
e.Logger.Error(err)
|
||||
e.Error(500,err, fmt.Sprintf("删除失败!错误详情:%s", err.Error()))
|
||||
e.Error(500, err, fmt.Sprintf("删除失败!错误详情:%s", err.Error()))
|
||||
return
|
||||
}
|
||||
e.OK(req.GetId(), "删除成功")
|
||||
|
|
|
@ -2,7 +2,7 @@ package apis
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
"github.com/go-admin-team/go-admin-core/sdk/api"
|
||||
|
@ -31,7 +31,7 @@ type SysPost struct {
|
|||
// @Security Bearer
|
||||
func (e SysPost) GetPage(c *gin.Context) {
|
||||
s := service.SysPost{}
|
||||
req :=dto.SysPostPageReq{}
|
||||
req := dto.SysPostPageReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.Form).
|
||||
|
@ -65,7 +65,7 @@ func (e SysPost) GetPage(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysPost) Get(c *gin.Context) {
|
||||
s := service.SysPost{}
|
||||
req :=dto.SysPostGetReq{}
|
||||
req := dto.SysPostGetReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, nil).
|
||||
|
@ -99,7 +99,7 @@ func (e SysPost) Get(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysPost) Insert(c *gin.Context) {
|
||||
s := service.SysPost{}
|
||||
req :=dto.SysPostInsertReq{}
|
||||
req := dto.SysPostInsertReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.JSON).
|
||||
|
@ -131,7 +131,7 @@ func (e SysPost) Insert(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysPost) Update(c *gin.Context) {
|
||||
s := service.SysPost{}
|
||||
req :=dto.SysPostUpdateReq{}
|
||||
req := dto.SysPostUpdateReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.JSON, nil).
|
||||
|
@ -163,7 +163,7 @@ func (e SysPost) Update(c *gin.Context) {
|
|||
// @Security Bearer
|
||||
func (e SysPost) Delete(c *gin.Context) {
|
||||
s := service.SysPost{}
|
||||
req :=dto.SysPostDeleteReq{}
|
||||
req := dto.SysPostDeleteReq{}
|
||||
err := e.MakeContext(c).
|
||||
MakeOrm().
|
||||
Bind(&req, binding.JSON).
|
||||
|
@ -181,4 +181,4 @@ func (e SysPost) Delete(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
e.OK(req.GetId(), "删除成功")
|
||||
}
|
||||
}
|
||||
|
|
23
app/admin/models/base_model.go
Normal file
23
app/admin/models/base_model.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
var RecordNotFound = gorm.ErrRecordNotFound
|
||||
|
||||
type Model struct {
|
||||
ID uint64 `json:"id" gorm:"primary_key;AUTO_INCREMENT"` // 数据库记录编号
|
||||
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
|
||||
DeletedAt *time.Time `json:"-" sql:"index"` // 删除时间
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
// 数据集
|
||||
RequestId string `protobuf:"bytes,1,opt,name=requestId,proto3" json:"requestId,omitempty"`
|
||||
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
|
||||
}
|
19
app/admin/router/bus_product_manage.go
Normal file
19
app/admin/router/bus_product_manage.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
|
||||
"go-admin/app/admin/apis/product_manage"
|
||||
"go-admin/common/middleware"
|
||||
)
|
||||
|
||||
// 需认证的路由代码
|
||||
func registerProductManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
|
||||
product := v1.Group("/product").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
||||
{
|
||||
product.POST("/list", product_manage.ProductList) // 产品列表
|
||||
product.POST("/create", product_manage.CreateProduct) // 创建产品
|
||||
product.POST("/edit", product_manage.EditProduct) // 编辑产品
|
||||
product.POST("/delete", product_manage.DeleteProduct) // 删除产品
|
||||
}
|
||||
}
|
|
@ -38,4 +38,7 @@ func businessCheckRoleRouter(r *gin.Engine, authMiddleware *jwtauth.GinJWTMiddle
|
|||
for _, f := range routerCheckRole {
|
||||
f(v1, authMiddleware)
|
||||
}
|
||||
|
||||
// 产品管理
|
||||
registerProductManageRouter(v1, authMiddleware)
|
||||
}
|
||||
|
|
|
@ -29,4 +29,4 @@ func registerSysDeptRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
|
|||
r1.GET("/deptTree", api.Get2Tree)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,4 +21,4 @@ func registerSysLoginLogRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMi
|
|||
r.GET("/:id", api.Get)
|
||||
r.DELETE("", api.Delete)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,4 +30,4 @@ func registerSysMenuRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
|
|||
//r1.GET("/menuids", api.GetMenuIDS)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,4 @@ func registerSysOperaLogRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMi
|
|||
r.GET("/:id", api.Get)
|
||||
r.DELETE("", api.Delete)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,4 +22,4 @@ func registerSyPostRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddlew
|
|||
r.PUT("/:id", api.Update)
|
||||
r.DELETE("", api.Delete)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,4 +36,4 @@ func registerSysUserRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
|
|||
{
|
||||
v1auth.GET("/getinfo", api.GetInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,15 +7,15 @@ import (
|
|||
|
||||
// SysDeptGetPageReq 列表或者搜索使用结构体
|
||||
type SysDeptGetPageReq struct {
|
||||
DeptId int `form:"deptId" search:"type:exact;column:dept_id;table:sys_dept" comment:"id"` //id
|
||||
ParentId int `form:"parentId" search:"type:exact;column:parent_id;table:sys_dept" comment:"上级部门"` //上级部门
|
||||
DeptPath string `form:"deptPath" search:"type:exact;column:dept_path;table:sys_dept" comment:""` //路径
|
||||
DeptName string `form:"deptName" search:"type:exact;column:dept_name;table:sys_dept" comment:"部门名称"` //部门名称
|
||||
Sort int `form:"sort" search:"type:exact;column:sort;table:sys_dept" comment:"排序"` //排序
|
||||
Leader string `form:"leader" search:"type:exact;column:leader;table:sys_dept" comment:"负责人"` //负责人
|
||||
Phone string `form:"phone" search:"type:exact;column:phone;table:sys_dept" comment:"手机"` //手机
|
||||
Email string `form:"email" search:"type:exact;column:email;table:sys_dept" comment:"邮箱"` //邮箱
|
||||
Status string `form:"status" search:"type:exact;column:status;table:sys_dept" comment:"状态"` //状态
|
||||
DeptId int `form:"deptId" search:"type:exact;column:dept_id;table:sys_dept" comment:"id"` //id
|
||||
ParentId int `form:"parentId" search:"type:exact;column:parent_id;table:sys_dept" comment:"上级部门"` //上级部门
|
||||
DeptPath string `form:"deptPath" search:"type:exact;column:dept_path;table:sys_dept" comment:""` //路径
|
||||
DeptName string `form:"deptName" search:"type:exact;column:dept_name;table:sys_dept" comment:"部门名称"` //部门名称
|
||||
Sort int `form:"sort" search:"type:exact;column:sort;table:sys_dept" comment:"排序"` //排序
|
||||
Leader string `form:"leader" search:"type:exact;column:leader;table:sys_dept" comment:"负责人"` //负责人
|
||||
Phone string `form:"phone" search:"type:exact;column:phone;table:sys_dept" comment:"手机"` //手机
|
||||
Email string `form:"email" search:"type:exact;column:email;table:sys_dept" comment:"邮箱"` //邮箱
|
||||
Status string `form:"status" search:"type:exact;column:status;table:sys_dept" comment:"状态"` //状态
|
||||
}
|
||||
|
||||
func (m *SysDeptGetPageReq) GetNeedSearch() interface{} {
|
||||
|
|
|
@ -54,4 +54,4 @@ type SysLoginLogDeleteReq struct {
|
|||
|
||||
func (s *SysLoginLogDeleteReq) GetId() interface{} {
|
||||
return s.Ids
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,4 +107,4 @@ type SysRoleMenu struct {
|
|||
// return nil, err
|
||||
// }
|
||||
// return r, nil
|
||||
//}
|
||||
//}
|
||||
|
|
|
@ -83,7 +83,7 @@ func (e Gen) Preview(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
tab, _ := table.Get(db,false)
|
||||
tab, _ := table.Get(db, false)
|
||||
var b1 bytes.Buffer
|
||||
err = t1.Execute(&b1, tab)
|
||||
var b2 bytes.Buffer
|
||||
|
@ -129,7 +129,7 @@ func (e Gen) GenCode(c *gin.Context) {
|
|||
}
|
||||
|
||||
table.TableId = id
|
||||
tab, _ := table.Get(db,false)
|
||||
tab, _ := table.Get(db, false)
|
||||
|
||||
e.NOActionsGen(c, tab)
|
||||
|
||||
|
@ -155,7 +155,7 @@ func (e Gen) GenApiToFile(c *gin.Context) {
|
|||
}
|
||||
|
||||
table.TableId = id
|
||||
tab, _ := table.Get(db,false)
|
||||
tab, _ := table.Get(db, false)
|
||||
e.genApiToFile(c, tab)
|
||||
|
||||
e.OK("", "Code generated successfully!")
|
||||
|
@ -302,7 +302,7 @@ func (e Gen) GenMenuAndApi(c *gin.Context) {
|
|||
}
|
||||
|
||||
table.TableId = id
|
||||
tab, _ := table.Get(e.Orm,true)
|
||||
tab, _ := table.Get(e.Orm, true)
|
||||
tab.MLTBName = strings.Replace(tab.TBName, "_", "-", -1)
|
||||
|
||||
Mmenu := dto.SysMenuInsertReq{}
|
||||
|
|
|
@ -79,7 +79,7 @@ func (e SysTable) Get(c *gin.Context) {
|
|||
|
||||
var data tools.SysTables
|
||||
data.TableId, _ = pkg.StringToInt(c.Param("tableId"))
|
||||
result, err := data.Get(db,true)
|
||||
result, err := data.Get(db, true)
|
||||
if err != nil {
|
||||
log.Errorf("Get error, %s", err.Error())
|
||||
e.Error(500, err, "")
|
||||
|
@ -106,7 +106,7 @@ func (e SysTable) GetSysTablesInfo(c *gin.Context) {
|
|||
if c.Request.FormValue("tableName") != "" {
|
||||
data.TBName = c.Request.FormValue("tableName")
|
||||
}
|
||||
result, err := data.Get(db,true)
|
||||
result, err := data.Get(db, true)
|
||||
if err != nil {
|
||||
log.Errorf("Get error, %s", err.Error())
|
||||
e.Error(500, err, "抱歉未找到相关信息")
|
||||
|
|
|
@ -67,4 +67,4 @@ func (e *DBColumns) GetList(tx *gorm.DB) ([]DBColumns, error) {
|
|||
return doc, err
|
||||
}
|
||||
return doc, nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ func init() {
|
|||
routerCheckRole = append(routerCheckRole, sysNoCheckRoleRouter, registerDBRouter, registerSysTableRouter)
|
||||
}
|
||||
|
||||
func sysNoCheckRoleRouter(v1 *gin.RouterGroup ,authMiddleware *jwt.GinJWTMiddleware) {
|
||||
func sysNoCheckRoleRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
|
||||
r1 := v1.Group("")
|
||||
{
|
||||
sys := apis.System{}
|
||||
|
@ -53,4 +53,4 @@ func registerSysTableRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddl
|
|||
tablesInfo.GET("", sysTable.GetSysTablesInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,4 @@ func registerMonitorRouter(v1 *gin.RouterGroup) {
|
|||
c.Status(http.StatusOK)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ func init() {
|
|||
rootCmd.AddCommand(app.StartCmd)
|
||||
}
|
||||
|
||||
//Execute : apply commands
|
||||
// Execute : apply commands
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
os.Exit(-1)
|
||||
|
|
|
@ -13,4 +13,4 @@ type SysApi struct {
|
|||
|
||||
func (SysApi) TableName() string {
|
||||
return "sys_api"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
package models
|
||||
|
||||
type SysMenu struct {
|
||||
MenuId int `json:"menuId" gorm:"primaryKey;autoIncrement"`
|
||||
MenuName string `json:"menuName" gorm:"size:128;"`
|
||||
Title string `json:"title" gorm:"size:128;"`
|
||||
Icon string `json:"icon" gorm:"size:128;"`
|
||||
Path string `json:"path" gorm:"size:128;"`
|
||||
Paths string `json:"paths" gorm:"size:128;"`
|
||||
MenuType string `json:"menuType" gorm:"size:1;"`
|
||||
Action string `json:"action" gorm:"size:16;"`
|
||||
Permission string `json:"permission" gorm:"size:255;"`
|
||||
ParentId int `json:"parentId" gorm:"size:11;"`
|
||||
NoCache bool `json:"noCache" gorm:"size:8;"`
|
||||
Breadcrumb string `json:"breadcrumb" gorm:"size:255;"`
|
||||
Component string `json:"component" gorm:"size:255;"`
|
||||
Sort int `json:"sort" gorm:"size:4;"`
|
||||
Visible string `json:"visible" gorm:"size:1;"`
|
||||
IsFrame string `json:"isFrame" gorm:"size:1;DEFAULT:0;"`
|
||||
SysApi []SysApi `json:"sysApi" gorm:"many2many:sys_menu_api_rule"`
|
||||
MenuId int `json:"menuId" gorm:"primaryKey;autoIncrement"`
|
||||
MenuName string `json:"menuName" gorm:"size:128;"`
|
||||
Title string `json:"title" gorm:"size:128;"`
|
||||
Icon string `json:"icon" gorm:"size:128;"`
|
||||
Path string `json:"path" gorm:"size:128;"`
|
||||
Paths string `json:"paths" gorm:"size:128;"`
|
||||
MenuType string `json:"menuType" gorm:"size:1;"`
|
||||
Action string `json:"action" gorm:"size:16;"`
|
||||
Permission string `json:"permission" gorm:"size:255;"`
|
||||
ParentId int `json:"parentId" gorm:"size:11;"`
|
||||
NoCache bool `json:"noCache" gorm:"size:8;"`
|
||||
Breadcrumb string `json:"breadcrumb" gorm:"size:255;"`
|
||||
Component string `json:"component" gorm:"size:255;"`
|
||||
Sort int `json:"sort" gorm:"size:4;"`
|
||||
Visible string `json:"visible" gorm:"size:1;"`
|
||||
IsFrame string `json:"isFrame" gorm:"size:1;DEFAULT:0;"`
|
||||
SysApi []SysApi `json:"sysApi" gorm:"many2many:sys_menu_api_rule"`
|
||||
ControlBy
|
||||
ModelTime
|
||||
}
|
||||
|
||||
func (SysMenu) TableName() string {
|
||||
return "sys_menu"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,4 +13,4 @@ type SysPost struct {
|
|||
|
||||
func (SysPost) TableName() string {
|
||||
return "sys_post"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,4 +17,4 @@ type SysRole struct {
|
|||
|
||||
func (SysRole) TableName() string {
|
||||
return "sys_role"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@ import (
|
|||
"go-admin/common/global"
|
||||
)
|
||||
|
||||
var DB *gorm.DB
|
||||
|
||||
// Setup 配置数据库
|
||||
func Setup() {
|
||||
for k := range toolsConfig.DatabasesConfig {
|
||||
|
|
|
@ -40,8 +40,8 @@ func (e *QiNiuKODO) getToken() string {
|
|||
return upToken
|
||||
}
|
||||
|
||||
//Setup 装载
|
||||
//endpoint sss
|
||||
// Setup 装载
|
||||
// endpoint sss
|
||||
func (e *QiNiuKODO) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error {
|
||||
|
||||
mac := qbox.NewMac(accessKeyID, accessKeySecret)
|
||||
|
|
|
@ -10,8 +10,8 @@ type ALiYunOSS struct {
|
|||
BucketName string
|
||||
}
|
||||
|
||||
//Setup 装载
|
||||
//endpoint sss
|
||||
// Setup 装载
|
||||
// endpoint sss
|
||||
func (e *ALiYunOSS) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error {
|
||||
client, err := oss.New(endpoint, accessKeyID, accessKeySecret)
|
||||
if err != nil {
|
||||
|
|
|
@ -33,4 +33,4 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) {
|
|||
TimeFunc: time.Now,
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,6 @@ var CasbinExclude = []UrlInfo{
|
|||
{Url: "/", Method: "GET"},
|
||||
{Url: "/api/v1/server-monitor", Method: "GET"},
|
||||
{Url: "/api/v1/public/uploadFile", Method: "POST"},
|
||||
{Url: "/api/v1/user/pwd/set", Method: "PUT"},
|
||||
{Url: "/api/v1/user/pwd/set", Method: "PUT"},
|
||||
{Url: "/api/v1/sys-user", Method: "PUT"},
|
||||
}
|
||||
|
|
|
@ -29,4 +29,4 @@ type ModelTime struct {
|
|||
CreatedAt time.Time `json:"createdAt" gorm:"comment:创建时间"`
|
||||
UpdatedAt time.Time `json:"updatedAt" gorm:"comment:最后更新时间"`
|
||||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index;comment:删除时间"`
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ const (
|
|||
// Directory 目录
|
||||
Directory string = "M"
|
||||
// Menu 菜单
|
||||
Menu string = "C"
|
||||
Menu string = "C"
|
||||
// Button 按钮
|
||||
Button string = "F"
|
||||
Button string = "F"
|
||||
)
|
||||
|
|
|
@ -3,12 +3,14 @@ package config
|
|||
var ExtConfig Extend
|
||||
|
||||
// Extend 扩展配置
|
||||
// extend:
|
||||
// demo:
|
||||
// name: demo-name
|
||||
//
|
||||
// extend:
|
||||
// demo:
|
||||
// name: demo-name
|
||||
//
|
||||
// 使用方法: config.ExtConfig......即可!!
|
||||
type Extend struct {
|
||||
AMap AMap // 这里配置对应配置文件的结构即可
|
||||
AMap AMap // 这里配置对应配置文件的结构即可
|
||||
}
|
||||
|
||||
type AMap struct {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Package admin GENERATED BY SWAG; DO NOT EDIT
|
||||
// This file was generated by swaggo/swag
|
||||
// Package admin Code generated by swaggo/swag. DO NOT EDIT
|
||||
package admin
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
|
@ -61,27 +60,9 @@ const docTemplateadmin = `{
|
|||
"summary": "获取验证码",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{\"code\": 200, \"data\": [...]}",
|
||||
"description": "{\"code\": 200, \"data\": [...], \"id\": \"xyz\", \"msg\": \"success\"}",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.Response"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"msg": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/response.Response"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1250,6 +1231,138 @@ const docTemplateadmin = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/product/create": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"产品管理"
|
||||
],
|
||||
"summary": "新建产品",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "新建产品模型",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.CreateProductReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.CreateProductResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/product/delete": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"产品管理"
|
||||
],
|
||||
"summary": "删除产品",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "删除产品模型",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.DeleteProductReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.DeleteProductResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/product/edit": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"产品管理"
|
||||
],
|
||||
"summary": "编辑产品",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "编辑产品模型",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.EditProductReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.EditProductResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/product/list": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"产品管理"
|
||||
],
|
||||
"summary": "查询产品列表",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "查询产品列表模型",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.ProductListReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.ProductListResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/public/uploadFile": {
|
||||
"post": {
|
||||
"security": [
|
||||
|
@ -1679,7 +1792,7 @@ const docTemplateadmin = `{
|
|||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1757,7 +1870,7 @@ const docTemplateadmin = `{
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1873,7 +1986,7 @@ const docTemplateadmin = `{
|
|||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3041,17 +3154,11 @@ const docTemplateadmin = `{
|
|||
"dto.SysDictDataDeleteReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createBy": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"updateBy": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -3319,7 +3426,7 @@ const docTemplateadmin = `{
|
|||
"sysApi": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
|
@ -3406,7 +3513,7 @@ const docTemplateadmin = `{
|
|||
"sysApi": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
|
@ -3574,13 +3681,13 @@ const docTemplateadmin = `{
|
|||
"sysDept": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysDept"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysDept"
|
||||
}
|
||||
},
|
||||
"sysMenu": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysMenu"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysMenu"
|
||||
}
|
||||
},
|
||||
"updateBy": {
|
||||
|
@ -3643,13 +3750,13 @@ const docTemplateadmin = `{
|
|||
"sysDept": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysDept"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysDept"
|
||||
}
|
||||
},
|
||||
"sysMenu": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysMenu"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysMenu"
|
||||
}
|
||||
},
|
||||
"updateBy": {
|
||||
|
@ -3795,30 +3902,7 @@ const docTemplateadmin = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"handler.Login": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"code",
|
||||
"password",
|
||||
"username",
|
||||
"uuid"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"uuid": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.SysApi": {
|
||||
"go-admin_app_admin_models.SysApi": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"action": {
|
||||
|
@ -3853,7 +3937,7 @@ const docTemplateadmin = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.SysConfig": {
|
||||
"go-admin_app_admin_models.SysConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"configKey": {
|
||||
|
@ -3891,13 +3975,13 @@ const docTemplateadmin = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.SysDept": {
|
||||
"go-admin_app_admin_models.SysDept": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"children": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysDept"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysDept"
|
||||
}
|
||||
},
|
||||
"createBy": {
|
||||
|
@ -3955,7 +4039,7 @@ const docTemplateadmin = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.SysMenu": {
|
||||
"go-admin_app_admin_models.SysMenu": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"action": {
|
||||
|
@ -3973,7 +4057,7 @@ const docTemplateadmin = `{
|
|||
"children": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysMenu"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysMenu"
|
||||
}
|
||||
},
|
||||
"component": {
|
||||
|
@ -4033,7 +4117,7 @@ const docTemplateadmin = `{
|
|||
"sysApi": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
|
@ -4050,6 +4134,309 @@ const docTemplateadmin = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"handler.Login": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"code",
|
||||
"password",
|
||||
"username",
|
||||
"uuid"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"uuid": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.BusProductDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"city": {
|
||||
"description": "城市(可选,避免返回空字符串)",
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"discount": {
|
||||
"description": "折扣",
|
||||
"type": "number"
|
||||
},
|
||||
"id": {
|
||||
"description": "产品ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"platform": {
|
||||
"description": "运营商:1-移动 2-联通 3-电信 4-不限",
|
||||
"type": "integer"
|
||||
},
|
||||
"price": {
|
||||
"description": "标准价格",
|
||||
"type": "number"
|
||||
},
|
||||
"product_code": {
|
||||
"description": "产品编码",
|
||||
"type": "string"
|
||||
},
|
||||
"product_name": {
|
||||
"description": "产品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"product_type": {
|
||||
"description": "产品类型:1-短信 2-话费 3-流量",
|
||||
"type": "integer"
|
||||
},
|
||||
"province": {
|
||||
"description": "运营商省份",
|
||||
"type": "string"
|
||||
},
|
||||
"retail_price": {
|
||||
"description": "建议零售价格",
|
||||
"type": "number"
|
||||
},
|
||||
"updated_at": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.CreateProductReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"platform",
|
||||
"price",
|
||||
"product_code",
|
||||
"product_name",
|
||||
"product_type",
|
||||
"province"
|
||||
],
|
||||
"properties": {
|
||||
"city": {
|
||||
"description": "城市(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "产品描述",
|
||||
"type": "string"
|
||||
},
|
||||
"discount": {
|
||||
"description": "折扣",
|
||||
"type": "number"
|
||||
},
|
||||
"platform": {
|
||||
"description": "运营商:1-移动 2-联通 3-电信",
|
||||
"type": "integer"
|
||||
},
|
||||
"price": {
|
||||
"description": "标准价格",
|
||||
"type": "number"
|
||||
},
|
||||
"product_attr": {
|
||||
"description": "产品属性:1-直连运营商 2-第三方",
|
||||
"type": "integer"
|
||||
},
|
||||
"product_code": {
|
||||
"description": "产品编码",
|
||||
"type": "string"
|
||||
},
|
||||
"product_name": {
|
||||
"description": "产品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"product_type": {
|
||||
"description": "产品类型:1-短信 2-话费 3-流量",
|
||||
"type": "integer"
|
||||
},
|
||||
"province": {
|
||||
"description": "运营商省份",
|
||||
"type": "string"
|
||||
},
|
||||
"retail_price": {
|
||||
"description": "建议零售价格",
|
||||
"type": "number"
|
||||
},
|
||||
"service_code": {
|
||||
"description": "服务编码",
|
||||
"type": "string"
|
||||
},
|
||||
"size": {
|
||||
"description": "流量大小",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "类型:1-省内 2-国内",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.CreateProductResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "新创建的产品ID",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.DeleteProductReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "产品ID",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.DeleteProductResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"description": "是否删除成功",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.EditProductReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"product_code",
|
||||
"product_name"
|
||||
],
|
||||
"properties": {
|
||||
"city": {
|
||||
"description": "城市(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "产品描述",
|
||||
"type": "string"
|
||||
},
|
||||
"discount": {
|
||||
"description": "折扣",
|
||||
"type": "number"
|
||||
},
|
||||
"id": {
|
||||
"description": "产品ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"platform": {
|
||||
"description": "运营商:1-移动 2-联通 3-电信",
|
||||
"type": "integer"
|
||||
},
|
||||
"price": {
|
||||
"description": "标准价格",
|
||||
"type": "number"
|
||||
},
|
||||
"product_attr": {
|
||||
"description": "产品属性:1-直连运营商 2-第三方",
|
||||
"type": "integer"
|
||||
},
|
||||
"product_code": {
|
||||
"description": "产品编码",
|
||||
"type": "string"
|
||||
},
|
||||
"product_name": {
|
||||
"description": "产品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"product_type": {
|
||||
"description": "产品类型:1-短信 2-话费 3-流量",
|
||||
"type": "integer"
|
||||
},
|
||||
"province": {
|
||||
"description": "运营商省份",
|
||||
"type": "string"
|
||||
},
|
||||
"retail_price": {
|
||||
"description": "建议零售价格",
|
||||
"type": "number"
|
||||
},
|
||||
"service_code": {
|
||||
"description": "服务编码",
|
||||
"type": "string"
|
||||
},
|
||||
"size": {
|
||||
"description": "流量大小",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "类型:1-省内 2-国内",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.EditProductResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"description": "是否编辑成功",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.ProductListReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"page": {
|
||||
"description": "页码",
|
||||
"type": "integer"
|
||||
},
|
||||
"page_size": {
|
||||
"description": "每页大小",
|
||||
"type": "integer"
|
||||
},
|
||||
"platform": {
|
||||
"description": "运营商:1-移动 2-联通 3-电信(可选)",
|
||||
"type": "integer"
|
||||
},
|
||||
"product_code": {
|
||||
"description": "产品编码(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"product_name": {
|
||||
"description": "产品名称(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"product_type": {
|
||||
"description": "产品类型:1-短信 2-话费 3-流量(可选)",
|
||||
"type": "integer"
|
||||
},
|
||||
"province": {
|
||||
"description": "省份(可选)",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.ProductListResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"list": {
|
||||
"description": "产品列表",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/m_product_manage.BusProductDTO"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"description": "总记录数",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response.Page": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -4117,9 +4504,6 @@ const docTemplateadmin = `{
|
|||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"dictType": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -4252,9 +4636,6 @@ const docTemplateadmin = `{
|
|||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"functionAuthor": {
|
||||
"description": "功能作者",
|
||||
"type": "string"
|
||||
|
@ -4366,6 +4747,8 @@ var SwaggerInfoadmin = &swag.Spec{
|
|||
Description: "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!",
|
||||
InfoInstanceName: "admin",
|
||||
SwaggerTemplate: docTemplateadmin,
|
||||
LeftDelim: "{{",
|
||||
RightDelim: "}}",
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -52,27 +52,9 @@
|
|||
"summary": "获取验证码",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{\"code\": 200, \"data\": [...]}",
|
||||
"description": "{\"code\": 200, \"data\": [...], \"id\": \"xyz\", \"msg\": \"success\"}",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.Response"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"msg": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/response.Response"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1241,6 +1223,138 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/product/create": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"产品管理"
|
||||
],
|
||||
"summary": "新建产品",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "新建产品模型",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.CreateProductReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.CreateProductResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/product/delete": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"产品管理"
|
||||
],
|
||||
"summary": "删除产品",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "删除产品模型",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.DeleteProductReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.DeleteProductResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/product/edit": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"产品管理"
|
||||
],
|
||||
"summary": "编辑产品",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "编辑产品模型",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.EditProductReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.EditProductResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/product/list": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"产品管理"
|
||||
],
|
||||
"summary": "查询产品列表",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "查询产品列表模型",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.ProductListReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/m_product_manage.ProductListResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/public/uploadFile": {
|
||||
"post": {
|
||||
"security": [
|
||||
|
@ -1670,7 +1784,7 @@
|
|||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1748,7 +1862,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1864,7 +1978,7 @@
|
|||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3032,17 +3146,11 @@
|
|||
"dto.SysDictDataDeleteReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createBy": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"updateBy": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -3310,7 +3418,7 @@
|
|||
"sysApi": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
|
@ -3397,7 +3505,7 @@
|
|||
"sysApi": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
|
@ -3565,13 +3673,13 @@
|
|||
"sysDept": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysDept"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysDept"
|
||||
}
|
||||
},
|
||||
"sysMenu": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysMenu"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysMenu"
|
||||
}
|
||||
},
|
||||
"updateBy": {
|
||||
|
@ -3634,13 +3742,13 @@
|
|||
"sysDept": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysDept"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysDept"
|
||||
}
|
||||
},
|
||||
"sysMenu": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysMenu"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysMenu"
|
||||
}
|
||||
},
|
||||
"updateBy": {
|
||||
|
@ -3786,30 +3894,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"handler.Login": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"code",
|
||||
"password",
|
||||
"username",
|
||||
"uuid"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"uuid": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.SysApi": {
|
||||
"go-admin_app_admin_models.SysApi": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"action": {
|
||||
|
@ -3844,7 +3929,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.SysConfig": {
|
||||
"go-admin_app_admin_models.SysConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"configKey": {
|
||||
|
@ -3882,13 +3967,13 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.SysDept": {
|
||||
"go-admin_app_admin_models.SysDept": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"children": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysDept"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysDept"
|
||||
}
|
||||
},
|
||||
"createBy": {
|
||||
|
@ -3946,7 +4031,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.SysMenu": {
|
||||
"go-admin_app_admin_models.SysMenu": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"action": {
|
||||
|
@ -3964,7 +4049,7 @@
|
|||
"children": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysMenu"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysMenu"
|
||||
}
|
||||
},
|
||||
"component": {
|
||||
|
@ -4024,7 +4109,7 @@
|
|||
"sysApi": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.SysApi"
|
||||
"$ref": "#/definitions/go-admin_app_admin_models.SysApi"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
|
@ -4041,6 +4126,309 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"handler.Login": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"code",
|
||||
"password",
|
||||
"username",
|
||||
"uuid"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"uuid": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.BusProductDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"city": {
|
||||
"description": "城市(可选,避免返回空字符串)",
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"discount": {
|
||||
"description": "折扣",
|
||||
"type": "number"
|
||||
},
|
||||
"id": {
|
||||
"description": "产品ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"platform": {
|
||||
"description": "运营商:1-移动 2-联通 3-电信 4-不限",
|
||||
"type": "integer"
|
||||
},
|
||||
"price": {
|
||||
"description": "标准价格",
|
||||
"type": "number"
|
||||
},
|
||||
"product_code": {
|
||||
"description": "产品编码",
|
||||
"type": "string"
|
||||
},
|
||||
"product_name": {
|
||||
"description": "产品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"product_type": {
|
||||
"description": "产品类型:1-短信 2-话费 3-流量",
|
||||
"type": "integer"
|
||||
},
|
||||
"province": {
|
||||
"description": "运营商省份",
|
||||
"type": "string"
|
||||
},
|
||||
"retail_price": {
|
||||
"description": "建议零售价格",
|
||||
"type": "number"
|
||||
},
|
||||
"updated_at": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.CreateProductReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"platform",
|
||||
"price",
|
||||
"product_code",
|
||||
"product_name",
|
||||
"product_type",
|
||||
"province"
|
||||
],
|
||||
"properties": {
|
||||
"city": {
|
||||
"description": "城市(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "产品描述",
|
||||
"type": "string"
|
||||
},
|
||||
"discount": {
|
||||
"description": "折扣",
|
||||
"type": "number"
|
||||
},
|
||||
"platform": {
|
||||
"description": "运营商:1-移动 2-联通 3-电信",
|
||||
"type": "integer"
|
||||
},
|
||||
"price": {
|
||||
"description": "标准价格",
|
||||
"type": "number"
|
||||
},
|
||||
"product_attr": {
|
||||
"description": "产品属性:1-直连运营商 2-第三方",
|
||||
"type": "integer"
|
||||
},
|
||||
"product_code": {
|
||||
"description": "产品编码",
|
||||
"type": "string"
|
||||
},
|
||||
"product_name": {
|
||||
"description": "产品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"product_type": {
|
||||
"description": "产品类型:1-短信 2-话费 3-流量",
|
||||
"type": "integer"
|
||||
},
|
||||
"province": {
|
||||
"description": "运营商省份",
|
||||
"type": "string"
|
||||
},
|
||||
"retail_price": {
|
||||
"description": "建议零售价格",
|
||||
"type": "number"
|
||||
},
|
||||
"service_code": {
|
||||
"description": "服务编码",
|
||||
"type": "string"
|
||||
},
|
||||
"size": {
|
||||
"description": "流量大小",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "类型:1-省内 2-国内",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.CreateProductResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "新创建的产品ID",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.DeleteProductReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "产品ID",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.DeleteProductResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"description": "是否删除成功",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.EditProductReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"product_code",
|
||||
"product_name"
|
||||
],
|
||||
"properties": {
|
||||
"city": {
|
||||
"description": "城市(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "产品描述",
|
||||
"type": "string"
|
||||
},
|
||||
"discount": {
|
||||
"description": "折扣",
|
||||
"type": "number"
|
||||
},
|
||||
"id": {
|
||||
"description": "产品ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"platform": {
|
||||
"description": "运营商:1-移动 2-联通 3-电信",
|
||||
"type": "integer"
|
||||
},
|
||||
"price": {
|
||||
"description": "标准价格",
|
||||
"type": "number"
|
||||
},
|
||||
"product_attr": {
|
||||
"description": "产品属性:1-直连运营商 2-第三方",
|
||||
"type": "integer"
|
||||
},
|
||||
"product_code": {
|
||||
"description": "产品编码",
|
||||
"type": "string"
|
||||
},
|
||||
"product_name": {
|
||||
"description": "产品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"product_type": {
|
||||
"description": "产品类型:1-短信 2-话费 3-流量",
|
||||
"type": "integer"
|
||||
},
|
||||
"province": {
|
||||
"description": "运营商省份",
|
||||
"type": "string"
|
||||
},
|
||||
"retail_price": {
|
||||
"description": "建议零售价格",
|
||||
"type": "number"
|
||||
},
|
||||
"service_code": {
|
||||
"description": "服务编码",
|
||||
"type": "string"
|
||||
},
|
||||
"size": {
|
||||
"description": "流量大小",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "类型:1-省内 2-国内",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.EditProductResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"description": "是否编辑成功",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.ProductListReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"page": {
|
||||
"description": "页码",
|
||||
"type": "integer"
|
||||
},
|
||||
"page_size": {
|
||||
"description": "每页大小",
|
||||
"type": "integer"
|
||||
},
|
||||
"platform": {
|
||||
"description": "运营商:1-移动 2-联通 3-电信(可选)",
|
||||
"type": "integer"
|
||||
},
|
||||
"product_code": {
|
||||
"description": "产品编码(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"product_name": {
|
||||
"description": "产品名称(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"product_type": {
|
||||
"description": "产品类型:1-短信 2-话费 3-流量(可选)",
|
||||
"type": "integer"
|
||||
},
|
||||
"province": {
|
||||
"description": "省份(可选)",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"m_product_manage.ProductListResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"list": {
|
||||
"description": "产品列表",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/m_product_manage.BusProductDTO"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"description": "总记录数",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response.Page": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -4108,9 +4496,6 @@
|
|||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"dictType": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -4243,9 +4628,6 @@
|
|||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"functionAuthor": {
|
||||
"description": "功能作者",
|
||||
"type": "string"
|
||||
|
|
|
@ -170,14 +170,10 @@ definitions:
|
|||
type: object
|
||||
dto.SysDictDataDeleteReq:
|
||||
properties:
|
||||
createBy:
|
||||
type: integer
|
||||
ids:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
updateBy:
|
||||
type: integer
|
||||
type: object
|
||||
dto.SysDictDataGetAllResp:
|
||||
properties:
|
||||
|
@ -357,7 +353,7 @@ definitions:
|
|||
type: integer
|
||||
sysApi:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysApi'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysApi'
|
||||
type: array
|
||||
title:
|
||||
description: 显示名称
|
||||
|
@ -420,7 +416,7 @@ definitions:
|
|||
type: integer
|
||||
sysApi:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysApi'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysApi'
|
||||
type: array
|
||||
title:
|
||||
description: 显示名称
|
||||
|
@ -533,11 +529,11 @@ definitions:
|
|||
type: string
|
||||
sysDept:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysDept'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysDept'
|
||||
type: array
|
||||
sysMenu:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysMenu'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysMenu'
|
||||
type: array
|
||||
updateBy:
|
||||
type: integer
|
||||
|
@ -581,11 +577,11 @@ definitions:
|
|||
type: string
|
||||
sysDept:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysDept'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysDept'
|
||||
type: array
|
||||
sysMenu:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysMenu'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysMenu'
|
||||
type: array
|
||||
updateBy:
|
||||
type: integer
|
||||
|
@ -683,23 +679,7 @@ definitions:
|
|||
description: 用户ID
|
||||
type: integer
|
||||
type: object
|
||||
handler.Login:
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
username:
|
||||
type: string
|
||||
uuid:
|
||||
type: string
|
||||
required:
|
||||
- code
|
||||
- password
|
||||
- username
|
||||
- uuid
|
||||
type: object
|
||||
models.SysApi:
|
||||
go-admin_app_admin_models.SysApi:
|
||||
properties:
|
||||
action:
|
||||
type: string
|
||||
|
@ -722,7 +702,7 @@ definitions:
|
|||
updatedAt:
|
||||
type: string
|
||||
type: object
|
||||
models.SysConfig:
|
||||
go-admin_app_admin_models.SysConfig:
|
||||
properties:
|
||||
configKey:
|
||||
type: string
|
||||
|
@ -747,11 +727,11 @@ definitions:
|
|||
updatedAt:
|
||||
type: string
|
||||
type: object
|
||||
models.SysDept:
|
||||
go-admin_app_admin_models.SysDept:
|
||||
properties:
|
||||
children:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysDept'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysDept'
|
||||
type: array
|
||||
createBy:
|
||||
type: integer
|
||||
|
@ -792,7 +772,7 @@ definitions:
|
|||
updatedAt:
|
||||
type: string
|
||||
type: object
|
||||
models.SysMenu:
|
||||
go-admin_app_admin_models.SysMenu:
|
||||
properties:
|
||||
action:
|
||||
type: string
|
||||
|
@ -804,7 +784,7 @@ definitions:
|
|||
type: string
|
||||
children:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysMenu'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysMenu'
|
||||
type: array
|
||||
component:
|
||||
type: string
|
||||
|
@ -844,7 +824,7 @@ definitions:
|
|||
type: integer
|
||||
sysApi:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysApi'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysApi'
|
||||
type: array
|
||||
title:
|
||||
type: string
|
||||
|
@ -855,6 +835,226 @@ definitions:
|
|||
visible:
|
||||
type: string
|
||||
type: object
|
||||
handler.Login:
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
username:
|
||||
type: string
|
||||
uuid:
|
||||
type: string
|
||||
required:
|
||||
- code
|
||||
- password
|
||||
- username
|
||||
- uuid
|
||||
type: object
|
||||
m_product_manage.BusProductDTO:
|
||||
properties:
|
||||
city:
|
||||
description: 城市(可选,避免返回空字符串)
|
||||
type: string
|
||||
created_at:
|
||||
description: 创建时间
|
||||
type: string
|
||||
discount:
|
||||
description: 折扣
|
||||
type: number
|
||||
id:
|
||||
description: 产品ID
|
||||
type: integer
|
||||
platform:
|
||||
description: 运营商:1-移动 2-联通 3-电信 4-不限
|
||||
type: integer
|
||||
price:
|
||||
description: 标准价格
|
||||
type: number
|
||||
product_code:
|
||||
description: 产品编码
|
||||
type: string
|
||||
product_name:
|
||||
description: 产品名称
|
||||
type: string
|
||||
product_type:
|
||||
description: 产品类型:1-短信 2-话费 3-流量
|
||||
type: integer
|
||||
province:
|
||||
description: 运营商省份
|
||||
type: string
|
||||
retail_price:
|
||||
description: 建议零售价格
|
||||
type: number
|
||||
updated_at:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
m_product_manage.CreateProductReq:
|
||||
properties:
|
||||
city:
|
||||
description: 城市(可选)
|
||||
type: string
|
||||
description:
|
||||
description: 产品描述
|
||||
type: string
|
||||
discount:
|
||||
description: 折扣
|
||||
type: number
|
||||
platform:
|
||||
description: 运营商:1-移动 2-联通 3-电信
|
||||
type: integer
|
||||
price:
|
||||
description: 标准价格
|
||||
type: number
|
||||
product_attr:
|
||||
description: 产品属性:1-直连运营商 2-第三方
|
||||
type: integer
|
||||
product_code:
|
||||
description: 产品编码
|
||||
type: string
|
||||
product_name:
|
||||
description: 产品名称
|
||||
type: string
|
||||
product_type:
|
||||
description: 产品类型:1-短信 2-话费 3-流量
|
||||
type: integer
|
||||
province:
|
||||
description: 运营商省份
|
||||
type: string
|
||||
retail_price:
|
||||
description: 建议零售价格
|
||||
type: number
|
||||
service_code:
|
||||
description: 服务编码
|
||||
type: string
|
||||
size:
|
||||
description: 流量大小
|
||||
type: string
|
||||
type:
|
||||
description: 类型:1-省内 2-国内
|
||||
type: integer
|
||||
required:
|
||||
- platform
|
||||
- price
|
||||
- product_code
|
||||
- product_name
|
||||
- product_type
|
||||
- province
|
||||
type: object
|
||||
m_product_manage.CreateProductResp:
|
||||
properties:
|
||||
id:
|
||||
description: 新创建的产品ID
|
||||
type: integer
|
||||
type: object
|
||||
m_product_manage.DeleteProductReq:
|
||||
properties:
|
||||
id:
|
||||
description: 产品ID
|
||||
type: integer
|
||||
required:
|
||||
- id
|
||||
type: object
|
||||
m_product_manage.DeleteProductResp:
|
||||
properties:
|
||||
success:
|
||||
description: 是否删除成功
|
||||
type: boolean
|
||||
type: object
|
||||
m_product_manage.EditProductReq:
|
||||
properties:
|
||||
city:
|
||||
description: 城市(可选)
|
||||
type: string
|
||||
description:
|
||||
description: 产品描述
|
||||
type: string
|
||||
discount:
|
||||
description: 折扣
|
||||
type: number
|
||||
id:
|
||||
description: 产品ID
|
||||
type: integer
|
||||
platform:
|
||||
description: 运营商:1-移动 2-联通 3-电信
|
||||
type: integer
|
||||
price:
|
||||
description: 标准价格
|
||||
type: number
|
||||
product_attr:
|
||||
description: 产品属性:1-直连运营商 2-第三方
|
||||
type: integer
|
||||
product_code:
|
||||
description: 产品编码
|
||||
type: string
|
||||
product_name:
|
||||
description: 产品名称
|
||||
type: string
|
||||
product_type:
|
||||
description: 产品类型:1-短信 2-话费 3-流量
|
||||
type: integer
|
||||
province:
|
||||
description: 运营商省份
|
||||
type: string
|
||||
retail_price:
|
||||
description: 建议零售价格
|
||||
type: number
|
||||
service_code:
|
||||
description: 服务编码
|
||||
type: string
|
||||
size:
|
||||
description: 流量大小
|
||||
type: string
|
||||
type:
|
||||
description: 类型:1-省内 2-国内
|
||||
type: integer
|
||||
required:
|
||||
- id
|
||||
- product_code
|
||||
- product_name
|
||||
type: object
|
||||
m_product_manage.EditProductResp:
|
||||
properties:
|
||||
success:
|
||||
description: 是否编辑成功
|
||||
type: boolean
|
||||
type: object
|
||||
m_product_manage.ProductListReq:
|
||||
properties:
|
||||
page:
|
||||
description: 页码
|
||||
type: integer
|
||||
page_size:
|
||||
description: 每页大小
|
||||
type: integer
|
||||
platform:
|
||||
description: 运营商:1-移动 2-联通 3-电信(可选)
|
||||
type: integer
|
||||
product_code:
|
||||
description: 产品编码(可选)
|
||||
type: string
|
||||
product_name:
|
||||
description: 产品名称(可选)
|
||||
type: string
|
||||
product_type:
|
||||
description: 产品类型:1-短信 2-话费 3-流量(可选)
|
||||
type: integer
|
||||
province:
|
||||
description: 省份(可选)
|
||||
type: string
|
||||
type: object
|
||||
m_product_manage.ProductListResp:
|
||||
properties:
|
||||
list:
|
||||
description: 产品列表
|
||||
items:
|
||||
$ref: '#/definitions/m_product_manage.BusProductDTO'
|
||||
type: array
|
||||
total:
|
||||
description: 总记录数
|
||||
type: integer
|
||||
type: object
|
||||
response.Page:
|
||||
properties:
|
||||
count:
|
||||
|
@ -899,8 +1099,6 @@ definitions:
|
|||
type: integer
|
||||
createdAt:
|
||||
type: string
|
||||
deletedAt:
|
||||
type: string
|
||||
dictType:
|
||||
type: string
|
||||
edit:
|
||||
|
@ -989,8 +1187,6 @@ definitions:
|
|||
type: boolean
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
type: string
|
||||
functionAuthor:
|
||||
description: 功能作者
|
||||
type: string
|
||||
|
@ -1088,18 +1284,9 @@ paths:
|
|||
description: 获取验证码
|
||||
responses:
|
||||
"200":
|
||||
description: '{"code": 200, "data": [...]}'
|
||||
description: '{"code": 200, "data": [...], "id": "xyz", "msg": "success"}'
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.Response'
|
||||
- properties:
|
||||
data:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
msg:
|
||||
type: string
|
||||
type: object
|
||||
$ref: '#/definitions/response.Response'
|
||||
summary: 获取验证码
|
||||
tags:
|
||||
- 登陆
|
||||
|
@ -1829,6 +2016,90 @@ paths:
|
|||
summary: 获取岗位信息
|
||||
tags:
|
||||
- 岗位
|
||||
/api/v1/product/create:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: 新建产品模型
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/m_product_manage.CreateProductReq'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/m_product_manage.CreateProductResp'
|
||||
summary: 新建产品
|
||||
tags:
|
||||
- 产品管理
|
||||
/api/v1/product/delete:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: 删除产品模型
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/m_product_manage.DeleteProductReq'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/m_product_manage.DeleteProductResp'
|
||||
summary: 删除产品
|
||||
tags:
|
||||
- 产品管理
|
||||
/api/v1/product/edit:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: 编辑产品模型
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/m_product_manage.EditProductReq'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/m_product_manage.EditProductResp'
|
||||
summary: 编辑产品
|
||||
tags:
|
||||
- 产品管理
|
||||
/api/v1/product/list:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: 查询产品列表模型
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/m_product_manage.ProductListReq'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/m_product_manage.ProductListResp'
|
||||
summary: 查询产品列表
|
||||
tags:
|
||||
- 产品管理
|
||||
/api/v1/public/uploadFile:
|
||||
post:
|
||||
consumes:
|
||||
|
@ -2107,7 +2378,7 @@ paths:
|
|||
- properties:
|
||||
list:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysApi'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysApi'
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
|
@ -2132,7 +2403,7 @@ paths:
|
|||
- $ref: '#/definitions/response.Response'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/models.SysApi'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysApi'
|
||||
type: object
|
||||
security:
|
||||
- Bearer: []
|
||||
|
@ -2221,7 +2492,7 @@ paths:
|
|||
- properties:
|
||||
list:
|
||||
items:
|
||||
$ref: '#/definitions/models.SysApi'
|
||||
$ref: '#/definitions/go-admin_app_admin_models.SysApi'
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
|
|
Loading…
Reference in New Issue
Block a user