Dockerfile

This commit is contained in:
2026-03-18 10:18:03 +08:00
parent 5c5dbc7420
commit b65f3439f3
189 changed files with 19027 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
package service
import (
consts "assets/consts/asset"
"assets/consts/public"
dto "assets/model/dto/enum"
"context"
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/util/gconv"
)
type enum struct{}
// Enum 枚举服务
var Enum = new(enum)
// GetAssetType 获取资产类型
func (s *enum) GetAssetType(ctx context.Context, req *dto.GetAssetTypeReq) (res *dto.GetAssetTypeRes, err error) {
_, _ = ctx, req
res = new(dto.GetAssetTypeRes)
err = gconv.Structs(consts.GetAllAssetTypeKeyValue(), &res.Options)
return
}
func (s *enum) GetCategoryAttrType(ctx context.Context, req *dto.GetCategoryAttrTypeReq) (res *dto.GetCategoryAttrTypeRes, err error) {
_, _ = ctx, req
res = new(dto.GetCategoryAttrTypeRes)
err = gconv.Structs(consts.GetAllAttrTypeKeyValue(), &res.Options)
return
}
func (s *enum) GetSpecsUnit(ctx context.Context, req *dto.GetSpecsUnitReq) (res *dto.GetSpecsUnitRes, err error) {
res = new(dto.GetSpecsUnitRes)
if *req.AssetType == consts.AssetTypeVirtual {
keyValue := public.GetAllDurationTypeKeyValue()
err = gconv.Structs(keyValue, &res.Options)
if err != nil {
return
}
} else {
// 使用简化的 RPC 调用方式 - 直接传 map 参数
//dictData := &dto.GetDictRes{}
//if err = message.CallRPC(ctx, "dictService.GetDictWithDataByType", map[string]interface{}{"dictType": gconv.String(req.AssetType)}, dictData); err != nil {
// return
//}
//for _, v := range dictData.Values {
// res.Options = append(res.Options, dto.KeyValue{
// Key: v.DictValue,
// Value: v.DictLabel,
// })
//}
}
return
}
func (s *enum) GetTenantModuleType(ctx context.Context, req *dto.GetTenantModuleTypeReq) (res *dto.GetTenantModuleTypeRes, err error) {
_ = ctx
res = new(dto.GetTenantModuleTypeRes)
err = gconv.Structs(beans.GetTenantModuleTypes(req.AssetId), &res.Options)
return
}