From 3127be9b85f211516a5b7f0bf5f1bfd1af099a93 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 31 Aug 2023 10:15:43 +0800 Subject: [PATCH 1/3] fix --- constants/websocket.go | 4 ++-- server/websocket/internal/logic/ws_render_image.go | 2 +- utils/websocket_data/render_data.go | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/constants/websocket.go b/constants/websocket.go index 6a1b5a82..dd648800 100644 --- a/constants/websocket.go +++ b/constants/websocket.go @@ -27,6 +27,6 @@ const ( WEBSOCKET_RENDER_IMAGE Websocket = "WEBSOCKET_RENDER_IMAGE" //图片渲染消息(1级消息,双向通信) WEBSOCKET_RENDER_IMAGE_ERR Websocket = "WEBSOCKET_RENDER_IMAGE_ERR" //图片渲染失败消息(1级消息,单向通信) WEBSOCKET_COMBINE_IMAGE Websocket = "WEBSOCKET_COMBINE_IMAGE" //反回合成刀版图消息(2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程) - WEBSOCKET_ASSEMBLE_RENDER_DATA Websocket = "WEBSOCKET_ASSEMBLE_RENDER_DATA" //组装unity需要的数据 - WEBSOCKET_SEND_DATA_TO_UNITY Websocket = "WEBSOCKET_SEND_DATA_TO_UNITY" //发送到unity进行渲染 + WEBSOCKET_ASSEMBLE_RENDER_DATA Websocket = "WEBSOCKET_ASSEMBLE_RENDER_DATA" //组装unity需要的数据 (2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程) + WEBSOCKET_SEND_DATA_TO_UNITY Websocket = "WEBSOCKET_SEND_DATA_TO_UNITY" //发送到unity进行渲染 (2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程) ) diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index b465f32a..9f95ddf9 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -362,7 +362,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, combineImage st }, }) //发送运行阶段消息 - w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_SEND_DATA_TO_UNITY, websocket_data.ToUnityRspMsg{RenderId: info.RenderId})) + w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_SEND_DATA_TO_UNITY, websocket_data.AssembleRenderDataRspMsg{RenderId: info.RenderId})) logx.Info("发送到unity成功,刀版图:", combineImage /*, " 请求unity的数据:", string(postDataBytes)*/) return nil } diff --git a/utils/websocket_data/render_data.go b/utils/websocket_data/render_data.go index 275eca06..ef94f6d3 100644 --- a/utils/websocket_data/render_data.go +++ b/utils/websocket_data/render_data.go @@ -52,6 +52,11 @@ type CombineProcessTime struct { UploadCombineImageTakesTime string `json:"upload_combine_image_takes_time"` //上传刀版图耗时 } +// 发送到组装渲染阶段信息返回数据 +type AssembleRenderDataRspMsg struct { + RenderId string `json:"render_id"` //渲染id +} + // 发送到unity阶段信息返回数据 type ToUnityRspMsg struct { RenderId string `json:"render_id"` //渲染id From a94aab855ad2836932bf69117740e3c996b28ebd Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 31 Aug 2023 10:35:13 +0800 Subject: [PATCH 2/3] fix --- .../internal/logic/ws_render_image.go | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index 9f95ddf9..9948c7a8 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -194,15 +194,8 @@ func (w *wsConnectItem) renderImage(data []byte) { logx.Error("合成刀版图失败,合成的刀版图是空指针:", err) return } - //发送合图结果消息 - w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_COMBINE_IMAGE, websocket_data.CombineImageRspMsg{ - RenderId: renderImageData.RenderId, - CombineImage: combineImage, - CombineProcessTime: websocket_data.CombineProcessTime{ - CombineTakesTime: fmt.Sprintf("%dms", res.DiffTimeLogoCombine), - UploadCombineImageTakesTime: fmt.Sprintf("%dms", res.DiffTimeUploadFile), - }, - })) + //发送合图完毕阶段消息 + w.sendCombineImageStepResponseMessage(renderImageData.RenderId, combineImage, res.DiffTimeLogoCombine, res.DiffTimeUploadFile) //如果指定指定只返回刀版图 if renderImageData.OnlyReturnCombineImage { logx.Info("云渲染传入size id则不走unity云渲染,只返回刀版图,render_id:", renderImageData.RenderId) @@ -322,7 +315,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, combineImage st }, } //发送运行阶段消息(组装数据) - w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_ASSEMBLE_RENDER_DATA, websocket_data.ToUnityRspMsg{RenderId: info.RenderId})) + w.sendAssembleRenderDataStepResponseMessage(info.RenderId) sendData := map[string]interface{}{ "id": taskId, "order_id": 0, @@ -362,11 +355,33 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, combineImage st }, }) //发送运行阶段消息 - w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_SEND_DATA_TO_UNITY, websocket_data.AssembleRenderDataRspMsg{RenderId: info.RenderId})) + w.sendRenderDataToUnityStepResponseMessage(info.RenderId) logx.Info("发送到unity成功,刀版图:", combineImage /*, " 请求unity的数据:", string(postDataBytes)*/) return nil } +// 发送合图完毕阶段通知消息 +func (w *wsConnectItem) sendCombineImageStepResponseMessage(renderId, combineImage string, combineMsTime, uploadMsTime int64) { + w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_COMBINE_IMAGE, websocket_data.CombineImageRspMsg{ + RenderId: renderId, + CombineImage: combineImage, + CombineProcessTime: websocket_data.CombineProcessTime{ + CombineTakesTime: fmt.Sprintf("%dms", combineMsTime), + UploadCombineImageTakesTime: fmt.Sprintf("%dms", uploadMsTime), + }, + })) +} + +// 发送组装unity渲染数据完毕阶段通知消息 +func (w *wsConnectItem) sendAssembleRenderDataStepResponseMessage(renderId string) { + w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_ASSEMBLE_RENDER_DATA, websocket_data.ToUnityRspMsg{RenderId: renderId})) +} + +// 发送组装unity渲染数据完毕阶段通知消息 +func (w *wsConnectItem) sendRenderDataToUnityStepResponseMessage(renderId string) { + w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_SEND_DATA_TO_UNITY, websocket_data.AssembleRenderDataRspMsg{RenderId: renderId})) +} + // 增加渲染任务 func (w *wsConnectItem) createRenderTask(data renderImageControlChanItem) { if data.taskId == "" { From e2d6182f6266973755b03df634cc681901fba954 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 31 Aug 2023 11:04:27 +0800 Subject: [PATCH 3/3] fix --- model/gmodel/fs_admin_role_gen.go | 33 ++++++++++++ model/gmodel/fs_admin_role_logic.go | 2 + model/gmodel/fs_admin_user_gen.go | 44 ++++++++++++++++ model/gmodel/fs_admin_user_logic.go | 2 + model/gmodel/fs_product_gen.go | 2 +- model/gmodel/fs_product_model3d_gen.go | 2 +- model/gmodel/fs_product_template_tags_gen.go | 3 +- .../gmodel/fs_product_template_tags_logic.go | 8 +-- model/gmodel/fs_resource_gen.go | 2 +- model/gmodel/fs_user_gen.go | 52 +++++++++---------- model/gmodel/var_gen.go | 4 ++ .../logic/getproducttemplatetagslogic.go | 6 +-- utils/basic/request_parse.go | 2 +- 13 files changed, 124 insertions(+), 38 deletions(-) create mode 100644 model/gmodel/fs_admin_role_gen.go create mode 100644 model/gmodel/fs_admin_role_logic.go create mode 100644 model/gmodel/fs_admin_user_gen.go create mode 100644 model/gmodel/fs_admin_user_logic.go diff --git a/model/gmodel/fs_admin_role_gen.go b/model/gmodel/fs_admin_role_gen.go new file mode 100644 index 00000000..0b0b470d --- /dev/null +++ b/model/gmodel/fs_admin_role_gen.go @@ -0,0 +1,33 @@ +package gmodel + +import ( + "gorm.io/gorm" + "time" +) + +// fs_admin_role 后台--角色表 +type FsAdminRole struct { + Id int64 `gorm:"primary_key;default:0;" json:"id"` // 序号 + RolePid *int64 `gorm:"default:0;" json:"role_pid"` // 上级角色 + RoleName *string `gorm:"default:'';" json:"role_name"` // + DataAuthType *int64 `gorm:"default:1;" json:"data_auth_type"` // 数据权限类型 + DataAuth *string `gorm:"default:'';" json:"data_auth"` // + Status *int64 `gorm:"default:2;" json:"status"` // 状态:1=启用,2=停用 + Remark *string `gorm:"default:'';" json:"remark"` // + Sort *int64 `gorm:"default:0;" json:"sort"` // 排序权重 + CreateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"create_time"` // + UpdateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"update_time"` // + DeleteTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"delete_time"` // + CreateUid *int64 `gorm:"default:0;" json:"create_uid"` // 创建人 + UpdateUid *int64 `gorm:"default:0;" json:"update_uid"` // 更新人 + DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人 + IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:1=是 0=否 +} +type FsAdminRoleModel struct { + db *gorm.DB + name string +} + +func NewFsAdminRoleModel(db *gorm.DB) *FsAdminRoleModel { + return &FsAdminRoleModel{db: db, name: "fs_admin_role"} +} diff --git a/model/gmodel/fs_admin_role_logic.go b/model/gmodel/fs_admin_role_logic.go new file mode 100644 index 00000000..e68225aa --- /dev/null +++ b/model/gmodel/fs_admin_role_logic.go @@ -0,0 +1,2 @@ +package gmodel +// TODO: 使用model的属性做你想做的 \ No newline at end of file diff --git a/model/gmodel/fs_admin_user_gen.go b/model/gmodel/fs_admin_user_gen.go new file mode 100644 index 00000000..5221094f --- /dev/null +++ b/model/gmodel/fs_admin_user_gen.go @@ -0,0 +1,44 @@ +package gmodel + +import ( + "gorm.io/gorm" + "time" +) + +// fs_admin_user 后台--管理员表 +type FsAdminUser struct { + Id int64 `gorm:"primary_key;default:0;" json:"id"` // 序号 + DepartmentId *int64 `gorm:"default:0;" json:"department_id"` // 部门 + RoleId *int64 `gorm:"default:0;" json:"role_id"` // 角色 + EmployeeId *int64 `gorm:"default:0;" json:"employee_id"` // 员工 + Type *int64 `gorm:"default:0;" json:"type"` // 类型:1=超级管理员,2=普通管理员 + Account *string `gorm:"default:'';" json:"account"` // + Password *string `gorm:"default:'';" json:"password"` // + Nickname *string `gorm:"default:'';" json:"nickname"` // + Mobile *string `gorm:"default:'';" json:"mobile"` // + Email *string `gorm:"default:'';" json:"email"` // + Salt *string `gorm:"default:'';" json:"salt"` // + LoginInitPassword *string `gorm:"default:'';" json:"login_init_password"` // + LoginLastTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"login_last_time"` // + LoginLastIp *string `gorm:"default:'';" json:"login_last_ip"` // + LoginNum *int64 `gorm:"default:0;" json:"login_num"` // 登录次数 + Status *int64 `gorm:"default:2;" json:"status"` // 状态:1=启用,2=停用 + Remark *string `gorm:"default:'';" json:"remark"` // + Sort *int64 `gorm:"default:0;" json:"sort"` // 排序权重 + CreateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"create_time"` // + UpdateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"update_time"` // + DeleteTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"delete_time"` // + CreateUid *int64 `gorm:"default:0;" json:"create_uid"` // 创建人 + UpdateUid *int64 `gorm:"default:0;" json:"update_uid"` // 更新人 + DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人 + IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:1=是 0=否 + RoleIds *string `gorm:"default:'';" json:"role_ids"` // +} +type FsAdminUserModel struct { + db *gorm.DB + name string +} + +func NewFsAdminUserModel(db *gorm.DB) *FsAdminUserModel { + return &FsAdminUserModel{db: db, name: "fs_admin_user"} +} diff --git a/model/gmodel/fs_admin_user_logic.go b/model/gmodel/fs_admin_user_logic.go new file mode 100644 index 00000000..e68225aa --- /dev/null +++ b/model/gmodel/fs_admin_user_logic.go @@ -0,0 +1,2 @@ +package gmodel +// TODO: 使用model的属性做你想做的 \ No newline at end of file diff --git a/model/gmodel/fs_product_gen.go b/model/gmodel/fs_product_gen.go index b888f9f2..f2b22738 100644 --- a/model/gmodel/fs_product_gen.go +++ b/model/gmodel/fs_product_gen.go @@ -22,7 +22,7 @@ type FsProduct struct { SizeIds *string `gorm:"default:'';" json:"size_ids"` // 尺寸 1,2,3,4 MaterialIds *string `gorm:"default:'';" json:"material_ids"` // 材质 1,2,3 TagIds *string `gorm:"default:'';" json:"tag_ids"` // 标签 逗号间隔 - Status *int64 `gorm:"default:0;" json:"status"` // 状态位 弃用 + Status *int64 `gorm:"default:1;" json:"status"` // 状态位 弃用 ProduceDays *int64 `gorm:"default:0;" json:"produce_days"` // 生产天数 DeliveryDays *int64 `gorm:"default:0;" json:"delivery_days"` // 运送天数 CoverImg *string `gorm:"default:'';" json:"cover_img"` // 背景图 diff --git a/model/gmodel/fs_product_model3d_gen.go b/model/gmodel/fs_product_model3d_gen.go index eec65e9d..51b4e511 100644 --- a/model/gmodel/fs_product_model3d_gen.go +++ b/model/gmodel/fs_product_model3d_gen.go @@ -18,7 +18,7 @@ type FsProductModel3d struct { Light *int64 `gorm:"default:0;" json:"light"` // 灯光组 LightList *string `gorm:"default:'';" json:"light_list"` // 灯光备选项 PartId *int64 `gorm:"default:0;" json:"part_id"` // 配件选项id(配件就是模型的id) - PartList *string `gorm:"default:'';" json:"part_list"` // 配件备选项 + PartList *string `gorm:"default:'';" json:"part_list"` // Status *int64 `gorm:"default:0;" json:"status"` // 状态位 显示 删除 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 OptionTemplate *int64 `gorm:"default:0;" json:"option_template"` // 配件绑定的公共模板 diff --git a/model/gmodel/fs_product_template_tags_gen.go b/model/gmodel/fs_product_template_tags_gen.go index 4cc602cc..a3c4af82 100644 --- a/model/gmodel/fs_product_template_tags_gen.go +++ b/model/gmodel/fs_product_template_tags_gen.go @@ -7,9 +7,10 @@ import ( // fs_product_template_tags 模板标签表 type FsProductTemplateTags struct { Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID - TemplateTag *string `gorm:"unique_key;default:'';" json:"template_tag"` // 标题 + TemplateTag *string `gorm:"unique_key;default:'';" json:"template_tag"` // Cover *string `gorm:"default:'';" json:"cover"` // 缩略图 Status *int64 `gorm:"default:0;" json:"status"` // 状态 1:可用 + IsHide *int64 `gorm:"default:0;" json:"is_hide"` // 是否隐藏 CreateAt *int64 `gorm:"default:0;" json:"create_at"` // 创建时间 Groups *string `gorm:"default:'';" json:"groups"` // 分组信息 } diff --git a/model/gmodel/fs_product_template_tags_logic.go b/model/gmodel/fs_product_template_tags_logic.go index 53e76130..d0492bd2 100755 --- a/model/gmodel/fs_product_template_tags_logic.go +++ b/model/gmodel/fs_product_template_tags_logic.go @@ -23,8 +23,8 @@ func (pt *FsProductTemplateTagsModel) FindOne(ctx context.Context, id int64, fie err = db.Take(&resp).Error return resp, err } -func (pt *FsProductTemplateTagsModel) GetList(ctx context.Context, page, limit int, orderBy string) (resp []FsProductTemplateTags, err error) { - db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`status` = ?", 1) +func (pt *FsProductTemplateTagsModel) GetList(ctx context.Context, page, limit int, isHide, status int64, orderBy string) (resp []FsProductTemplateTags, err error) { + db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`is_hide` = ? and `status` = ?", isHide, status) if orderBy != "" { db = db.Order(orderBy) } @@ -32,11 +32,11 @@ func (pt *FsProductTemplateTagsModel) GetList(ctx context.Context, page, limit i err = db.Offset(offset).Limit(limit).Find(&resp).Error return resp, err } -func (pt *FsProductTemplateTagsModel) GetListByTagNames(ctx context.Context, tagNames []string, limit int, orderBy string) (resp []FsProductTemplateTags, err error) { +func (pt *FsProductTemplateTagsModel) GetListByTagNames(ctx context.Context, tagNames []string, limit int, isHide, status int64, orderBy string) (resp []FsProductTemplateTags, err error) { if len(tagNames) == 0 { return nil, nil } - db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`template_tag` in (?) and `status` = ?", tagNames, 1) + db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`template_tag` in (?) and `is_hide` = ? and `status` = ?", tagNames, isHide, status) if orderBy != "" { db = db.Order(orderBy) } diff --git a/model/gmodel/fs_resource_gen.go b/model/gmodel/fs_resource_gen.go index a85dc617..783cc547 100644 --- a/model/gmodel/fs_resource_gen.go +++ b/model/gmodel/fs_resource_gen.go @@ -15,7 +15,7 @@ type FsResource struct { Version *string `gorm:"index;default:'0';" json:"version"` // 版本信息 UploadedAt *time.Time `gorm:"index;default:'0000-00-00 00:00:00';" json:"uploaded_at"` // Metadata *string `gorm:"default:'';" json:"metadata"` // 元数据,json格式,存储图像分率 - MetaKey1 *string `gorm:"index;default:'';" json:"meta_key1"` // 需要关键信息查询的自定义属性1,可以动态增加 + MetaKey1 *string `gorm:"default:'';" json:"meta_key1"` // 需要关键信息查询的自定义属性1,可以动态增加 ApiType *int64 `gorm:"default:1;" json:"api_type"` // 调用类型:1=对外,2=对内 BucketName *string `gorm:"default:'';" json:"bucket_name"` // 存储桶名: 1=持久 2=缓存 Source *string `gorm:"default:'';" json:"source"` // 来源 diff --git a/model/gmodel/fs_user_gen.go b/model/gmodel/fs_user_gen.go index 6c56d10a..ac8a8e73 100644 --- a/model/gmodel/fs_user_gen.go +++ b/model/gmodel/fs_user_gen.go @@ -6,32 +6,32 @@ import ( // fs_user 用户表 type FsUser struct { - Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID - FaceId *int64 `gorm:"default:0;" json:"face_id"` // facebook的userid - GoogleId *int64 `gorm:"default:0;" json:"google_id"` // google的sub - FirstName *string `gorm:"default:'';" json:"first_name"` // FirstName - LastName *string `gorm:"default:'';" json:"last_name"` // LastName - Username *string `gorm:"unique_key;default:'';" json:"username"` // - Company *string `gorm:"default:'';" json:"company"` // 公司名称 - Mobile *string `gorm:"default:'';" json:"mobile"` // 手机号码 - AuthKey *string `gorm:"default:'';" json:"auth_key"` // - PasswordHash *string `gorm:"default:'';" json:"password_hash"` // - VerificationToken *string `gorm:"default:'';" json:"verification_token"` // - PasswordResetToken *string `gorm:"unique_key;default:'';" json:"password_reset_token"` // - Email *string `gorm:"unique_key;default:'';" json:"email"` // 邮箱 - Type *int64 `gorm:"default:0;" json:"type"` // 1普通餐厅 2连锁餐厅 - Status *int64 `gorm:"default:1;" json:"status"` // 1正常 0不正常 - IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除 1删除 - CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 添加时间 - UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` // 更新时间 - IsOrderStatusEmail *int64 `gorm:"default:0;" json:"is_order_status_email"` // 订单状态改变时是否接收邮件 - IsEmailAdvertisement *int64 `gorm:"default:0;" json:"is_email_advertisement"` // 是否接收邮件广告 - IsOrderStatusPhone *int64 `gorm:"default:0;" json:"is_order_status_phone"` // 订单状态改变是是否接收电话 - IsPhoneAdvertisement *int64 `gorm:"default:0;" json:"is_phone_advertisement"` // 是否接收短信广告 - IsOpenRender *int64 `gorm:"default:0;" json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭) - IsThousandFace *int64 `gorm:"default:0;" json:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在) - IsLowRendering *int64 `gorm:"default:0;" json:"is_low_rendering"` // - IsRemoveBg *int64 `gorm:"default:1;" json:"is_remove_bg"` // 用户上传logo是否去除背景 + Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID + FaceId *int64 `gorm:"default:0;" json:"face_id"` // facebook的userid + GoogleId *int64 `gorm:"default:0;" json:"google_id"` // google的sub + FirstName *string `gorm:"default:'';" json:"first_name"` // FirstName + LastName *string `gorm:"default:'';" json:"last_name"` // LastName + Username *string `gorm:"index;default:'';" json:"username"` // + Company *string `gorm:"default:'';" json:"company"` // 公司名称 + Mobile *string `gorm:"default:'';" json:"mobile"` // 手机号码 + AuthKey *string `gorm:"default:'';" json:"auth_key"` // + PasswordHash *string `gorm:"default:'';" json:"password_hash"` // + VerificationToken *string `gorm:"default:'';" json:"verification_token"` // + PasswordResetToken *string `gorm:"default:'';" json:"password_reset_token"` // + Email *string `gorm:"unique_key;default:'';" json:"email"` // 邮箱 + Type *int64 `gorm:"default:0;" json:"type"` // 1普通餐厅 2连锁餐厅 + Status *int64 `gorm:"default:1;" json:"status"` // 1正常 0不正常 + IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除 1删除 + CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 添加时间 + UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` // 更新时间 + IsOrderStatusEmail *int64 `gorm:"default:0;" json:"is_order_status_email"` // 订单状态改变时是否接收邮件 + IsEmailAdvertisement *int64 `gorm:"default:0;" json:"is_email_advertisement"` // 是否接收邮件广告 + IsOrderStatusPhone *int64 `gorm:"default:0;" json:"is_order_status_phone"` // 订单状态改变是是否接收电话 + IsPhoneAdvertisement *int64 `gorm:"default:0;" json:"is_phone_advertisement"` // 是否接收短信广告 + IsOpenRender *int64 `gorm:"default:0;" json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭) + IsThousandFace *int64 `gorm:"default:0;" json:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在) + IsLowRendering *int64 `gorm:"default:0;" json:"is_low_rendering"` // + IsRemoveBg *int64 `gorm:"default:1;" json:"is_remove_bg"` // 用户上传logo是否去除背景 } type FsUserModel struct { db *gorm.DB diff --git a/model/gmodel/var_gen.go b/model/gmodel/var_gen.go index ad4f5db9..5587685d 100644 --- a/model/gmodel/var_gen.go +++ b/model/gmodel/var_gen.go @@ -9,6 +9,8 @@ type AllModelsGen struct { FsAdminAuthRole *FsAdminAuthRoleModel // fs_admin_auth_role 后台--角色表 FsAdminDepartment *FsAdminDepartmentModel // fs_admin_department 后台--部门表 FsAdminMenu *FsAdminMenuModel // fs_admin_menu 后台--菜单表 + FsAdminRole *FsAdminRoleModel // fs_admin_role 后台--角色表 + FsAdminUser *FsAdminUserModel // fs_admin_user 后台--管理员表 FsAuthAssignment *FsAuthAssignmentModel // fs_auth_assignment 用户角色和权限信息 FsAuthItem *FsAuthItemModel // fs_auth_item 用户角色和权限信息 FsAuthItemChild *FsAuthItemChildModel // fs_auth_item_child 角色和权限关系表 @@ -112,6 +114,8 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen { FsAdminAuthRole: NewFsAdminAuthRoleModel(gdb), FsAdminDepartment: NewFsAdminDepartmentModel(gdb), FsAdminMenu: NewFsAdminMenuModel(gdb), + FsAdminRole: NewFsAdminRoleModel(gdb), + FsAdminUser: NewFsAdminUserModel(gdb), FsAuthAssignment: NewFsAuthAssignmentModel(gdb), FsAuthItem: NewFsAuthItemModel(gdb), FsAuthItemChild: NewFsAuthItemChildModel(gdb), diff --git a/server/product-template-tag/internal/logic/getproducttemplatetagslogic.go b/server/product-template-tag/internal/logic/getproducttemplatetagslogic.go index cf89a9b4..a23581bb 100644 --- a/server/product-template-tag/internal/logic/getproducttemplatetagslogic.go +++ b/server/product-template-tag/internal/logic/getproducttemplatetagslogic.go @@ -53,12 +53,12 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get ai recommend product template tag list") } // 返回固定模板标签列表 - productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetList(l.ctx, 1, req.Limit, "`id` DESC") + productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetList(l.ctx, 1, req.Limit, 0, 1, "`id` DESC") } else { //元数据是空的 if userMaterial.Metadata == nil || *userMaterial.Metadata == "" { // 返回固定模板标签列表 - productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetList(l.ctx, 1, req.Limit, "`id` DESC") + productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetList(l.ctx, 1, req.Limit, 0, 1, "`id` DESC") } else { //解析元数据 var metaData map[string]interface{} @@ -72,7 +72,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu logx.Error(err) return resp.SetStatusWithMessage(basic.CodeJsonErr, "invalid format of metadata`s template_tagid") } - productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, templateTagNameList, req.Limit, "id DESC") + productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, templateTagNameList, req.Limit, 0, 1, "id DESC") } } if err != nil { diff --git a/utils/basic/request_parse.go b/utils/basic/request_parse.go index bff33b39..91473639 100644 --- a/utils/basic/request_parse.go +++ b/utils/basic/request_parse.go @@ -82,7 +82,7 @@ func ParseJwtToken(r *http.Request, svcCtx any) (*auth.UserInfo, error) { if err != nil { // logx.Println("error", info) logx.Error(err, ":", info) - return nil, err + return nil, errors.New("user not found:" + err.Error()) } secret = us.PwdHash // 获取密码的hash做jwt, 便于重置密码的使用