feat: 从黄果 NET hgdjnet-server 9bfbafe 导入 HKDJ 官网后端

来源:hgdjnet-server 9bfbafe10d417deea959bd53117bc88a10e60a83
项目身份 HKDJ / JHA-216,独立官网仓库,Jenkins 守卫键 hkdjnet
测试目录 /server/hkdj_net,App/Web API 30331/30332

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 11:20:04 +08:00
co-authored by Claude Opus 4.7
parent 99a4854def
commit 85c0071fd8
653 changed files with 85000 additions and 0 deletions
+111
View File
@@ -0,0 +1,111 @@
package web_translation
import (
"hkdj-web-server/pub/common"
"hkdj-web-server/pub/common/srvdef"
"hkdj-web-server/pub/models/translationcategorymod"
"hkdj-web-server/web/service/srv_translationcategory"
"github.com/gin-gonic/gin"
)
// @Tags 导航分类
// @Summary 分组分页获取导航分类
// @Description 分组分页获取导航分类
// @Accept json
// @Produce json
// @Param param body srv_translationcategory.TranslationCategoryReq true "参数列表"
// @Success 200 {object} srv_translationcategory.TranslationCategoryResp "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/translationcategory/list [POST]
func GetTranslationCategory(ctx *gin.Context) {
var req = &srv_translationcategory.TranslationCategoryReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
return
}
resp, serr := srv_translationcategory.GetTranslationCategorys(ctx, req)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, resp)
}
// @Tags 导航分类
// @Summary 添加一个导航分类
// @Description 添加一个导航分类
// @Accept json
// @Produce json
// @Param param body translationcategorymod.TranslationCategory true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/translationcategory/add [POST]
func AddOnetTranslationCategory(ctx *gin.Context) {
var req = &translationcategorymod.TranslationCategory{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, err)
return
}
serr := srv_translationcategory.AddTranslationCategory(ctx, req)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, "")
}
// @Tags 导航分类
// @Summary 删除一个导航分类
// @Description 删除一个导航分类
// @Accept json
// @Produce json
// @Param param body srv_translationcategory.TranslationCategoryDelReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/translationcategory/del [POST]
func DelOnetTranslationCategory(ctx *gin.Context) {
var req = &srv_translationcategory.TranslationCategoryDelReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, err)
return
}
serr := srv_translationcategory.DelTranslationCategory(ctx, req.Id)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, "")
}
// @Tags 导航分类
// @Summary 更新一个导航分类
// @Description 更新一个导航分类
// @Accept json
// @Produce json
// @Param param body srv_translationcategory.TranslationCategoryUpdateReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/translationcategory/update [POST]
func UpdateOnetTranslationCategory(ctx *gin.Context) {
var req = &srv_translationcategory.TranslationCategoryUpdateReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
return
}
serr := srv_translationcategory.UpdateTranslationCategory(ctx, req.Id, req.Param)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, "")
}
+111
View File
@@ -0,0 +1,111 @@
package web_translation
import (
"hkdj-web-server/pub/common"
"hkdj-web-server/pub/common/srvdef"
"hkdj-web-server/pub/models/translationmod"
"hkdj-web-server/web/service/srv_translation"
"github.com/gin-gonic/gin"
)
// @Tags 导航跳转信息
// @Summary 分组分页获取导航跳转信息
// @Description 分组分页获取导航跳转信息
// @Accept json
// @Produce json
// @Param param body srv_translation.TranslationInfoReq true "参数列表"
// @Success 200 {object} srv_translation.TranslationInfoResp "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/translation/list [POST]
func GetTranslation(ctx *gin.Context) {
var req = &srv_translation.TranslationInfoReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
return
}
resp, serr := srv_translation.GetTranslationInfos(ctx, req)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, resp)
}
// @Tags 导航跳转信息
// @Summary 添加一个导航跳转信息
// @Description 添加一个导航跳转信息
// @Accept json
// @Produce json
// @Param param body translationmod.TranslationInfo true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/translation/add [POST]
func AddOnetTranslation(ctx *gin.Context) {
var req = &translationmod.TranslationInfo{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, err)
return
}
serr := srv_translation.AddTranslationInfo(ctx, req)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, "")
}
// @Tags 导航跳转信息
// @Summary 删除一个导航跳转信息
// @Description 删除一个导航跳转信息
// @Accept json
// @Produce json
// @Param param body srv_translation.TranslationInfoDelReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/translation/del [POST]
func DelOnetTranslation(ctx *gin.Context) {
var req = &srv_translation.TranslationInfoDelReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, err)
return
}
serr := srv_translation.DelTranslationInfo(ctx, req.Id)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, "")
}
// @Tags 导航跳转信息
// @Summary 更新一个导航跳转信息
// @Description 更新一个导航跳转信息
// @Accept json
// @Produce json
// @Param param body srv_translation.TranslationInfoUpdateReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/translation/update [POST]
func UpdateOnetTranslation(ctx *gin.Context) {
var req = &srv_translation.TranslationInfoUpdateReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
return
}
serr := srv_translation.UpdateTranslationInfo(ctx, req.Id, req.Param)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, "")
}