Merge remote-tracking branch 'origin/main' into multi-tenant

This commit is contained in:
TsMask
2025-01-24 20:49:26 +08:00
66 changed files with 16618 additions and 196 deletions

View File

@@ -37,7 +37,17 @@ type UDMAuthController struct {
// UDM鉴权用户重载数据
//
// POST /resetData/:neId
// PUT /resetData/:neId
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User Reload Data
// @Description UDM Authentication User Reload Data
// @Router /neData/udm/auth/resetData/{neId} [put]
func (s *UDMAuthController) ResetData(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neId := c.Param("neId")
@@ -53,6 +63,19 @@ func (s *UDMAuthController) ResetData(c *gin.Context) {
// UDM鉴权用户列表
//
// GET /list
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param neId query string true "NE ID" default(001)
// @Param imsi query string false "IMSI"
// @Param pageNum query number true "pageNum" default(1)
// @Param pageSize query number true "pageSize" default(10)
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User List
// @Description UDM Authentication User List
// @Router /neData/udm/auth/list [get]
func (s *UDMAuthController) List(c *gin.Context) {
querys := ctx.QueryMap(c)
data := s.udmAuthService.SelectPage(querys)
@@ -62,6 +85,17 @@ func (s *UDMAuthController) List(c *gin.Context) {
// UDM鉴权用户信息
//
// GET /:neId/:imsi
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param value path string true "IMSI"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User Information
// @Description UDM Authentication User Information
// @Router /neData/udm/auth/{neId}/{value} [get]
func (s *UDMAuthController) Info(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neId := c.Param("neId")
@@ -107,6 +141,17 @@ func (s *UDMAuthController) Info(c *gin.Context) {
// UDM鉴权用户新增
//
// POST /:neId
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param data body object true "Request Param"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User Added
// @Description UDM Authentication User Added
// @Router /neData/udm/auth/{neId} [post]
func (s *UDMAuthController) Add(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neId := c.Param("neId")
@@ -155,6 +200,18 @@ func (s *UDMAuthController) Add(c *gin.Context) {
// UDM鉴权用户批量新增
//
// POST /:neId/:num
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param value path number true "Number includes starting imsi"
// @Param data body object true "Request Param"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User Batch Add
// @Description UDM Authentication User Batch Add
// @Router /neData/udm/auth/{neId}/{value} [post]
func (s *UDMAuthController) Adds(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neId := c.Param("neId")
@@ -204,6 +261,17 @@ func (s *UDMAuthController) Adds(c *gin.Context) {
// UDM鉴权用户修改
//
// PUT /:neId
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param data body object true "Request Param"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authenticated User Modification
// @Description UDM Authenticated User Modification
// @Router /neData/udm/auth/{neId} [put]
func (s *UDMAuthController) Edit(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neId := c.Param("neId")
@@ -252,6 +320,17 @@ func (s *UDMAuthController) Edit(c *gin.Context) {
// UDM鉴权用户删除
//
// DELETE /:neId/:imsi
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param value path string true "IMSI, multiple separated by a , sign"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authenticated User Deletion
// @Description UDM Authenticated User Deletion
// @Router /neData/udm/auth/{neId}/{value} [delete]
func (s *UDMAuthController) Remove(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neId := c.Param("neId")
@@ -305,6 +384,18 @@ func (s *UDMAuthController) Remove(c *gin.Context) {
// UDM鉴权用户批量删除
//
// DELETE /:neId/:imsi/:num
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param neId path string true "NE ID" default(001)
// @Param imsi path string true "IMSI"
// @Param num path number true "Number includes starting imsi"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authentication User Batch Deletion
// @Description UDM Authentication User Batch Deletion
// @Router /neData/udm/auth/{neId}/{imsi}/{num} [delete]
func (s *UDMAuthController) Removes(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neId := c.Param("neId")
@@ -347,6 +438,16 @@ func (s *UDMAuthController) Removes(c *gin.Context) {
// UDM鉴权用户导出
//
// POST /export
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param data body object true "Request Param"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authenticated User Export
// @Description UDM Authenticated User Export
// @Router /neData/udm/auth/export [post]
func (s *UDMAuthController) Export(c *gin.Context) {
language := ctx.AcceptLanguage(c)
// 查询结果,根据查询条件结果,单页最大值限制
@@ -426,13 +527,23 @@ func (s *UDMAuthController) Export(c *gin.Context) {
// UDM鉴权用户导入
//
// POST /import
//
// @Tags network_data/udm/auth
// @Accept json
// @Produce json
// @Param data body object true "Request Param"
// @Success 200 {object} object "Response Results"
// @Security TokenAuth
// @Summary UDM Authenticated User Import
// @Description UDM Authenticated User Import
// @Router /neData/udm/auth/import [post]
func (s *UDMAuthController) Import(c *gin.Context) {
language := ctx.AcceptLanguage(c)
var body struct {
NeId string `json:"neId" binding:"required"`
UploadPath string `json:"uploadPath" binding:"required"`
TypeVal string `json:"typeVal" binding:"required,oneof=default k4"`
TypeData any `json:"typeData"`
NeId string `json:"neId" binding:"required"` // 网元ID
UploadPath string `json:"uploadPath" binding:"required"` // 上传文件路径
TypeVal string `json:"typeVal" binding:"required,oneof=default k4"` // default: 默认导入方式, k4: k4类型导入方式
TypeData any `json:"typeData"` // k4类型的数据密钥
}
if err := c.ShouldBindBodyWith(&body, binding.JSON); err != nil {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))