feat: add tenant entry application pages
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// Package imtenantapplication
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package imtenantapplication
|
||||
|
||||
import (
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ListReq 查询企业注册申请列表
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/imTenantApplication/list" method:"get" tags:"企业注册申请" summary:"获取企业注册申请列表"`
|
||||
sysin.ImTenantApplicationListInp
|
||||
}
|
||||
|
||||
type ListRes struct {
|
||||
form.PageRes
|
||||
List []*sysin.ImTenantApplicationListModel `json:"list" dc:"数据列表"`
|
||||
}
|
||||
|
||||
// ViewReq 获取企业注册申请指定信息
|
||||
type ViewReq struct {
|
||||
g.Meta `path:"/imTenantApplication/view" method:"get" tags:"企业注册申请" summary:"获取企业注册申请指定信息"`
|
||||
sysin.ImTenantApplicationViewInp
|
||||
}
|
||||
|
||||
type ViewRes struct {
|
||||
*sysin.ImTenantApplicationViewModel
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Package imtenantentryfeedback
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package imtenantentryfeedback
|
||||
|
||||
import (
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ListReq 查询企业入口反馈列表
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/imTenantEntryFeedback/list" method:"get" tags:"企业入口反馈" summary:"获取企业入口反馈列表"`
|
||||
sysin.ImTenantEntryFeedbackListInp
|
||||
}
|
||||
|
||||
type ListRes struct {
|
||||
form.PageRes
|
||||
List []*sysin.ImTenantEntryFeedbackListModel `json:"list" dc:"数据列表"`
|
||||
}
|
||||
|
||||
// ViewReq 获取企业入口反馈指定信息
|
||||
type ViewReq struct {
|
||||
g.Meta `path:"/imTenantEntryFeedback/view" method:"get" tags:"企业入口反馈" summary:"获取企业入口反馈指定信息"`
|
||||
sysin.ImTenantEntryFeedbackViewInp
|
||||
}
|
||||
|
||||
type ViewRes struct {
|
||||
*sysin.ImTenantEntryFeedbackViewModel
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// Package sys
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/imtenantapplication"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
ImTenantApplication = cImTenantApplication{}
|
||||
)
|
||||
|
||||
type cImTenantApplication struct{}
|
||||
|
||||
// List 查看企业注册申请列表
|
||||
func (c *cImTenantApplication) List(ctx context.Context, req *imtenantapplication.ListReq) (res *imtenantapplication.ListRes, err error) {
|
||||
list, totalCount, err := service.SysImTenantApplication().List(ctx, &req.ImTenantApplicationListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*sysin.ImTenantApplicationListModel{}
|
||||
}
|
||||
|
||||
res = new(imtenantapplication.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定企业注册申请信息
|
||||
func (c *cImTenantApplication) View(ctx context.Context, req *imtenantapplication.ViewReq) (res *imtenantapplication.ViewRes, err error) {
|
||||
data, err := service.SysImTenantApplication().View(ctx, &req.ImTenantApplicationViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(imtenantapplication.ViewRes)
|
||||
res.ImTenantApplicationViewModel = data
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// Package sys
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/imtenantentryfeedback"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
ImTenantEntryFeedback = cImTenantEntryFeedback{}
|
||||
)
|
||||
|
||||
type cImTenantEntryFeedback struct{}
|
||||
|
||||
// List 查看企业入口反馈列表
|
||||
func (c *cImTenantEntryFeedback) List(ctx context.Context, req *imtenantentryfeedback.ListReq) (res *imtenantentryfeedback.ListRes, err error) {
|
||||
list, totalCount, err := service.SysImTenantEntryFeedback().List(ctx, &req.ImTenantEntryFeedbackListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*sysin.ImTenantEntryFeedbackListModel{}
|
||||
}
|
||||
|
||||
res = new(imtenantentryfeedback.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定企业入口反馈信息
|
||||
func (c *cImTenantEntryFeedback) View(ctx context.Context, req *imtenantentryfeedback.ViewReq) (res *imtenantentryfeedback.ViewRes, err error) {
|
||||
data, err := service.SysImTenantEntryFeedback().View(ctx, &req.ImTenantEntryFeedbackViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(imtenantentryfeedback.ViewRes)
|
||||
res.ImTenantEntryFeedbackViewModel = data
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// Package sys
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/library/storager"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
func loadImPublicUploads(ctx context.Context, fileIds []string) (files []*sysin.ImPublicUploadModel, err error) {
|
||||
fileIds = compactStringSlice(fileIds)
|
||||
if len(fileIds) == 0 {
|
||||
return []*sysin.ImPublicUploadModel{}, nil
|
||||
}
|
||||
if err = g.DB().Model("im_public_uploads").Safe().Ctx(ctx).
|
||||
Fields(
|
||||
"id",
|
||||
"file_id",
|
||||
"purpose",
|
||||
"mime_type",
|
||||
"size",
|
||||
"etag",
|
||||
"location",
|
||||
"expires_at",
|
||||
"created_at",
|
||||
"uploaded_at",
|
||||
).
|
||||
WhereIn("file_id", fileIds).
|
||||
OrderAsc("id").
|
||||
Scan(&files); err != nil {
|
||||
return nil, gerror.Wrap(err, "获取公共上传文件信息失败,请稍后重试!")
|
||||
}
|
||||
|
||||
drive := ""
|
||||
if conf, confErr := service.SysConfig().GetUpload(ctx); confErr == nil && conf != nil {
|
||||
drive = conf.Drive
|
||||
}
|
||||
for _, file := range files {
|
||||
file.Url = storager.LastUrl(ctx, file.Location, drive)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func firstImPublicUpload(ctx context.Context, fileId string) (file *sysin.ImPublicUploadModel, err error) {
|
||||
files, err := loadImPublicUploads(ctx, []string{fileId})
|
||||
if err != nil || len(files) == 0 {
|
||||
return
|
||||
}
|
||||
return files[0], nil
|
||||
}
|
||||
|
||||
func parseJSONStringSlice(raw string) []string {
|
||||
raw = strings.TrimSpace(raw)
|
||||
if raw == "" || raw == "null" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var ids []string
|
||||
if err := gjson.DecodeTo([]byte(raw), &ids); err == nil && len(ids) > 0 {
|
||||
return compactStringSlice(ids)
|
||||
}
|
||||
return compactStringSlice([]string{raw})
|
||||
}
|
||||
|
||||
func compactStringSlice(values []string) []string {
|
||||
res := make([]string, 0, len(values))
|
||||
seen := make(map[string]struct{}, len(values))
|
||||
for _, value := range values {
|
||||
value = strings.TrimSpace(value)
|
||||
if value == "" {
|
||||
continue
|
||||
}
|
||||
if _, ok := seen[value]; ok {
|
||||
continue
|
||||
}
|
||||
seen[value] = struct{}{}
|
||||
res = append(res, value)
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
// Package sys
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type sSysImTenantApplication struct{}
|
||||
|
||||
func NewSysImTenantApplication() *sSysImTenantApplication {
|
||||
return &sSysImTenantApplication{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
service.RegisterSysImTenantApplication(NewSysImTenantApplication())
|
||||
}
|
||||
|
||||
// List 获取企业注册申请列表
|
||||
func (s *sSysImTenantApplication) List(ctx context.Context, in *sysin.ImTenantApplicationListInp) (list []*sysin.ImTenantApplicationListModel, totalCount int, err error) {
|
||||
if err = in.Filter(ctx); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
mod := s.listModel(ctx)
|
||||
mod = s.applyWhere(mod, in)
|
||||
mod = mod.Page(in.Page, in.PerPage).OrderDesc("created_at").OrderDesc("id")
|
||||
|
||||
if err = mod.ScanAndCount(&list, &totalCount, false); err != nil {
|
||||
return nil, 0, gerror.Wrap(err, "获取企业注册申请列表失败,请稍后重试!")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysImTenantApplication) listModel(ctx context.Context) *gdb.Model {
|
||||
return g.DB().Model("im_tenant_applications").Safe().Ctx(ctx).Fields(
|
||||
"id",
|
||||
"application_id",
|
||||
"credit_code",
|
||||
"enterprise_email",
|
||||
"license_file_id",
|
||||
"tenant_code_hint",
|
||||
"status",
|
||||
"estimated_review_hour",
|
||||
"submitted_at",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
}
|
||||
|
||||
func (s *sSysImTenantApplication) applyWhere(mod *gdb.Model, in *sysin.ImTenantApplicationListInp) *gdb.Model {
|
||||
if in.ApplicationId != "" {
|
||||
mod = mod.WhereLike("application_id", "%"+in.ApplicationId+"%")
|
||||
}
|
||||
if in.CreditCode != "" {
|
||||
mod = mod.WhereLike("credit_code", "%"+in.CreditCode+"%")
|
||||
}
|
||||
if in.EnterpriseEmail != "" {
|
||||
mod = mod.WhereLike("enterprise_email", "%"+in.EnterpriseEmail+"%")
|
||||
}
|
||||
if in.TenantCodeHint != "" {
|
||||
mod = mod.WhereLike("tenant_code_hint", "%"+in.TenantCodeHint+"%")
|
||||
}
|
||||
if in.Status != "" {
|
||||
mod = mod.Where("status", in.Status)
|
||||
}
|
||||
if in.Keyword != "" {
|
||||
like := "%" + in.Keyword + "%"
|
||||
mod = mod.Where("(application_id LIKE ? OR credit_code LIKE ? OR enterprise_email LIKE ? OR tenant_code_hint LIKE ?)", like, like, like, like)
|
||||
}
|
||||
if len(in.CreatedAt) == 2 {
|
||||
mod = mod.WhereBetween("created_at", in.CreatedAt[0], in.CreatedAt[1])
|
||||
}
|
||||
return mod
|
||||
}
|
||||
|
||||
// View 获取企业注册申请指定信息
|
||||
func (s *sSysImTenantApplication) View(ctx context.Context, in *sysin.ImTenantApplicationViewInp) (res *sysin.ImTenantApplicationViewModel, err error) {
|
||||
if err = in.Filter(ctx); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = g.DB().Model("im_tenant_applications").Safe().Ctx(ctx).
|
||||
Fields(
|
||||
"id",
|
||||
"application_id",
|
||||
"credit_code",
|
||||
"enterprise_email",
|
||||
"license_file_id",
|
||||
"tenant_code_hint",
|
||||
"CAST(client_context AS CHAR) client_context",
|
||||
"idempotency_key",
|
||||
"status",
|
||||
"estimated_review_hour",
|
||||
"submitted_at",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
).
|
||||
Where("id", in.Id).
|
||||
Scan(&res); err != nil {
|
||||
return nil, gerror.Wrap(err, "获取企业注册申请信息失败,请稍后重试!")
|
||||
}
|
||||
if res == nil {
|
||||
return
|
||||
}
|
||||
res.LicenseFile, err = firstImPublicUpload(ctx, res.LicenseFileId)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
// Package sys
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type sSysImTenantEntryFeedback struct{}
|
||||
|
||||
func NewSysImTenantEntryFeedback() *sSysImTenantEntryFeedback {
|
||||
return &sSysImTenantEntryFeedback{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
service.RegisterSysImTenantEntryFeedback(NewSysImTenantEntryFeedback())
|
||||
}
|
||||
|
||||
// List 获取企业入口反馈列表
|
||||
func (s *sSysImTenantEntryFeedback) List(ctx context.Context, in *sysin.ImTenantEntryFeedbackListInp) (list []*sysin.ImTenantEntryFeedbackListModel, totalCount int, err error) {
|
||||
if err = in.Filter(ctx); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
mod := s.listModel(ctx)
|
||||
mod = s.applyWhere(mod, in)
|
||||
mod = mod.Page(in.Page, in.PerPage).OrderDesc("created_at").OrderDesc("id")
|
||||
|
||||
if err = mod.ScanAndCount(&list, &totalCount, false); err != nil {
|
||||
return nil, 0, gerror.Wrap(err, "获取企业入口反馈列表失败,请稍后重试!")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysImTenantEntryFeedback) listModel(ctx context.Context) *gdb.Model {
|
||||
return g.DB().Model("im_tenant_entry_feedbacks").Safe().Ctx(ctx).Fields(
|
||||
"id",
|
||||
"feedback_id",
|
||||
"description",
|
||||
"contact",
|
||||
"tenant_code_hint",
|
||||
"status",
|
||||
"submitted_at",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
}
|
||||
|
||||
func (s *sSysImTenantEntryFeedback) applyWhere(mod *gdb.Model, in *sysin.ImTenantEntryFeedbackListInp) *gdb.Model {
|
||||
if in.FeedbackId != "" {
|
||||
mod = mod.WhereLike("feedback_id", "%"+in.FeedbackId+"%")
|
||||
}
|
||||
if in.Contact != "" {
|
||||
mod = mod.WhereLike("contact", "%"+in.Contact+"%")
|
||||
}
|
||||
if in.TenantCodeHint != "" {
|
||||
mod = mod.WhereLike("tenant_code_hint", "%"+in.TenantCodeHint+"%")
|
||||
}
|
||||
if in.Status != "" {
|
||||
mod = mod.Where("status", in.Status)
|
||||
}
|
||||
if in.Keyword != "" {
|
||||
like := "%" + in.Keyword + "%"
|
||||
mod = mod.Where("(feedback_id LIKE ? OR description LIKE ? OR contact LIKE ? OR tenant_code_hint LIKE ?)", like, like, like, like)
|
||||
}
|
||||
if len(in.CreatedAt) == 2 {
|
||||
mod = mod.WhereBetween("created_at", in.CreatedAt[0], in.CreatedAt[1])
|
||||
}
|
||||
return mod
|
||||
}
|
||||
|
||||
// View 获取企业入口反馈指定信息
|
||||
func (s *sSysImTenantEntryFeedback) View(ctx context.Context, in *sysin.ImTenantEntryFeedbackViewInp) (res *sysin.ImTenantEntryFeedbackViewModel, err error) {
|
||||
if err = in.Filter(ctx); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = g.DB().Model("im_tenant_entry_feedbacks").Safe().Ctx(ctx).
|
||||
Fields(
|
||||
"id",
|
||||
"feedback_id",
|
||||
"description",
|
||||
"contact",
|
||||
"tenant_code_hint",
|
||||
"CAST(screenshot_file_ids AS CHAR) screenshot_file_ids",
|
||||
"CAST(client_context AS CHAR) client_context",
|
||||
"idempotency_key",
|
||||
"status",
|
||||
"submitted_at",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
).
|
||||
Where("id", in.Id).
|
||||
Scan(&res); err != nil {
|
||||
return nil, gerror.Wrap(err, "获取企业入口反馈信息失败,请稍后重试!")
|
||||
}
|
||||
if res == nil {
|
||||
return
|
||||
}
|
||||
res.ScreenshotFiles, err = loadImPublicUploads(ctx, parseJSONStringSlice(res.ScreenshotFileIds))
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import "github.com/gogf/gf/v2/os/gtime"
|
||||
|
||||
// ImPublicUploadModel 企业注册入口公共上传文件
|
||||
type ImPublicUploadModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
FileId string `json:"fileId" dc:"文件ID"`
|
||||
Purpose string `json:"purpose" dc:"用途"`
|
||||
MimeType string `json:"mimeType" dc:"MIME类型"`
|
||||
Size int64 `json:"size" dc:"文件大小"`
|
||||
Etag string `json:"etag" dc:"ETag"`
|
||||
Location string `json:"location" dc:"存储位置"`
|
||||
Url string `json:"url" dc:"访问地址"`
|
||||
ExpiresAt *gtime.Time `json:"expiresAt" dc:"过期时间"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UploadedAt *gtime.Time `json:"uploadedAt" dc:"上传完成时间"`
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// ImTenantApplicationListInp 获取企业注册申请列表
|
||||
type ImTenantApplicationListInp struct {
|
||||
form.PageReq
|
||||
ApplicationId string `json:"applicationId" dc:"申请ID"`
|
||||
CreditCode string `json:"creditCode" dc:"统一社会信用代码"`
|
||||
EnterpriseEmail string `json:"enterpriseEmail" dc:"企业邮箱"`
|
||||
TenantCodeHint string `json:"tenantCodeHint" dc:"商户编码线索"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *ImTenantApplicationListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type ImTenantApplicationListModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
ApplicationId string `json:"applicationId" dc:"申请ID"`
|
||||
CreditCode string `json:"creditCode" dc:"统一社会信用代码"`
|
||||
EnterpriseEmail string `json:"enterpriseEmail" dc:"企业邮箱"`
|
||||
LicenseFileId string `json:"licenseFileId" dc:"营业执照文件ID"`
|
||||
TenantCodeHint string `json:"tenantCodeHint" dc:"商户编码线索"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
EstimatedReviewHour int `json:"estimatedReviewHour" dc:"预计审核小时"`
|
||||
SubmittedAt *gtime.Time `json:"submittedAt" dc:"提交时间"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
}
|
||||
|
||||
// ImTenantApplicationViewInp 获取企业注册申请详情
|
||||
type ImTenantApplicationViewInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *ImTenantApplicationViewInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
return gerror.New("ID不能为空")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ImTenantApplicationViewModel struct {
|
||||
ImTenantApplicationListModel
|
||||
ClientContext string `json:"clientContext" dc:"客户端上下文"`
|
||||
IdempotencyKey string `json:"idempotencyKey" dc:"幂等键"`
|
||||
LicenseFile *ImPublicUploadModel `json:"licenseFile" dc:"营业执照文件"`
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// ImTenantEntryFeedbackListInp 获取企业入口反馈列表
|
||||
type ImTenantEntryFeedbackListInp struct {
|
||||
form.PageReq
|
||||
FeedbackId string `json:"feedbackId" dc:"反馈ID"`
|
||||
Contact string `json:"contact" dc:"联系方式"`
|
||||
TenantCodeHint string `json:"tenantCodeHint" dc:"商户编码线索"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *ImTenantEntryFeedbackListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type ImTenantEntryFeedbackListModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
FeedbackId string `json:"feedbackId" dc:"反馈ID"`
|
||||
Description string `json:"description" dc:"问题描述"`
|
||||
Contact string `json:"contact" dc:"联系方式"`
|
||||
TenantCodeHint string `json:"tenantCodeHint" dc:"商户编码线索"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
SubmittedAt *gtime.Time `json:"submittedAt" dc:"提交时间"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
}
|
||||
|
||||
// ImTenantEntryFeedbackViewInp 获取企业入口反馈详情
|
||||
type ImTenantEntryFeedbackViewInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *ImTenantEntryFeedbackViewInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
return gerror.New("ID不能为空")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ImTenantEntryFeedbackViewModel struct {
|
||||
ImTenantEntryFeedbackListModel
|
||||
ScreenshotFileIds string `json:"screenshotFileIds" dc:"截图文件ID JSON"`
|
||||
ClientContext string `json:"clientContext" dc:"客户端上下文"`
|
||||
IdempotencyKey string `json:"idempotencyKey" dc:"幂等键"`
|
||||
ScreenshotFiles []*ImPublicUploadModel `json:"screenshotFiles" dc:"截图文件"`
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package genrouter
|
||||
|
||||
import "hotgo/internal/controller/admin/sys"
|
||||
|
||||
func init() {
|
||||
LoginRequiredRouter = append(LoginRequiredRouter, sys.ImTenantApplication) // 企业注册申请
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package genrouter
|
||||
|
||||
import "hotgo/internal/controller/admin/sys"
|
||||
|
||||
func init() {
|
||||
LoginRequiredRouter = append(LoginRequiredRouter, sys.ImTenantEntryFeedback) // 企业入口反馈
|
||||
}
|
||||
@@ -350,6 +350,18 @@ type (
|
||||
// Status 更新IM举报反馈工单状态
|
||||
Status(ctx context.Context, in *sysin.ImWorkOrderStatusInp) (err error)
|
||||
}
|
||||
ISysImTenantApplication interface {
|
||||
// List 获取企业注册申请列表
|
||||
List(ctx context.Context, in *sysin.ImTenantApplicationListInp) (list []*sysin.ImTenantApplicationListModel, totalCount int, err error)
|
||||
// View 获取企业注册申请指定信息
|
||||
View(ctx context.Context, in *sysin.ImTenantApplicationViewInp) (res *sysin.ImTenantApplicationViewModel, err error)
|
||||
}
|
||||
ISysImTenantEntryFeedback interface {
|
||||
// List 获取企业入口反馈列表
|
||||
List(ctx context.Context, in *sysin.ImTenantEntryFeedbackListInp) (list []*sysin.ImTenantEntryFeedbackListModel, totalCount int, err error)
|
||||
// View 获取企业入口反馈指定信息
|
||||
View(ctx context.Context, in *sysin.ImTenantEntryFeedbackViewInp) (res *sysin.ImTenantEntryFeedbackViewModel, err error)
|
||||
}
|
||||
ISysImOutbox interface {
|
||||
// List 获取IM Outbox列表
|
||||
List(ctx context.Context, in *sysin.ImOutboxListInp) (list []*sysin.ImOutboxListModel, totalCount int, err error)
|
||||
@@ -788,61 +800,63 @@ type (
|
||||
)
|
||||
|
||||
var (
|
||||
localSysAddons ISysAddons
|
||||
localSysAddonsConfig ISysAddonsConfig
|
||||
localSysAttachment ISysAttachment
|
||||
localSysBlacklist ISysBlacklist
|
||||
localSysConfig ISysConfig
|
||||
localSysCron ISysCron
|
||||
localSysCronGroup ISysCronGroup
|
||||
localSysCurdDemo ISysCurdDemo
|
||||
localSysCultivateFlower ISysCultivateFlower
|
||||
localSysCultivateContent ISysCultivateContent
|
||||
localSysImTenant ISysImTenant
|
||||
localSysImMessageEncryption ISysImMessageEncryption
|
||||
localSysImRegistration ISysImRegistration
|
||||
localSysImInvite ISysImInvite
|
||||
localSysImUser ISysImUser
|
||||
localSysImGroup ISysImGroup
|
||||
localSysImRealname ISysImRealname
|
||||
localSysImWorkOrder ISysImWorkOrder
|
||||
localSysImOutbox ISysImOutbox
|
||||
localSysImOrg ISysImOrg
|
||||
localSysImFile ISysImFile
|
||||
localSysImFilePolicy ISysImFilePolicy
|
||||
localSysImUserPolicyGroup ISysImUserPolicyGroup
|
||||
localSysImSensitiveWord ISysImSensitiveWord
|
||||
localSysImSecurityPolicy ISysImSecurityPolicy
|
||||
localSysImDashboard ISysImDashboard
|
||||
localSysImPrivateMessage ISysImPrivateMessage
|
||||
localSysImGroupMessage ISysImGroupMessage
|
||||
localSysImUserLoginHistory ISysImUserLoginHistory
|
||||
localSysImLoginFailureLog ISysImLoginFailureLog
|
||||
localSysImExternalConfig ISysImExternalConfig
|
||||
localSysImNotification ISysImNotification
|
||||
localSysImAppRelease ISysImAppRelease
|
||||
localSysImAbuseReason ISysImAbuseReason
|
||||
localSysImMailboxConfig ISysImMailboxConfig
|
||||
localSysImFeedbackConfig ISysImFeedbackConfig
|
||||
localSysImWorkbench ISysImWorkbench
|
||||
localSysImTaskDashboard ISysImTaskDashboard
|
||||
localSysImAuditLog ISysImAuditLog
|
||||
localSysImKafkaAudit ISysImKafkaAudit
|
||||
localSysImKafkaCommand ISysImKafkaCommand
|
||||
localSysImDeadLetter ISysImDeadLetter
|
||||
localSysDictData ISysDictData
|
||||
localSysDictType ISysDictType
|
||||
localSysEmsLog ISysEmsLog
|
||||
localSysGenCodes ISysGenCodes
|
||||
localSysLog ISysLog
|
||||
localSysLoginLog ISysLoginLog
|
||||
localSysNormalTreeDemo ISysNormalTreeDemo
|
||||
localSysOptionTreeDemo ISysOptionTreeDemo
|
||||
localSysProvinces ISysProvinces
|
||||
localSysServeLicense ISysServeLicense
|
||||
localSysServeLog ISysServeLog
|
||||
localSysSmsLog ISysSmsLog
|
||||
localSysTestCategory ISysTestCategory
|
||||
localSysAddons ISysAddons
|
||||
localSysAddonsConfig ISysAddonsConfig
|
||||
localSysAttachment ISysAttachment
|
||||
localSysBlacklist ISysBlacklist
|
||||
localSysConfig ISysConfig
|
||||
localSysCron ISysCron
|
||||
localSysCronGroup ISysCronGroup
|
||||
localSysCurdDemo ISysCurdDemo
|
||||
localSysCultivateFlower ISysCultivateFlower
|
||||
localSysCultivateContent ISysCultivateContent
|
||||
localSysImTenant ISysImTenant
|
||||
localSysImMessageEncryption ISysImMessageEncryption
|
||||
localSysImRegistration ISysImRegistration
|
||||
localSysImInvite ISysImInvite
|
||||
localSysImUser ISysImUser
|
||||
localSysImGroup ISysImGroup
|
||||
localSysImRealname ISysImRealname
|
||||
localSysImWorkOrder ISysImWorkOrder
|
||||
localSysImTenantApplication ISysImTenantApplication
|
||||
localSysImTenantEntryFeedback ISysImTenantEntryFeedback
|
||||
localSysImOutbox ISysImOutbox
|
||||
localSysImOrg ISysImOrg
|
||||
localSysImFile ISysImFile
|
||||
localSysImFilePolicy ISysImFilePolicy
|
||||
localSysImUserPolicyGroup ISysImUserPolicyGroup
|
||||
localSysImSensitiveWord ISysImSensitiveWord
|
||||
localSysImSecurityPolicy ISysImSecurityPolicy
|
||||
localSysImDashboard ISysImDashboard
|
||||
localSysImPrivateMessage ISysImPrivateMessage
|
||||
localSysImGroupMessage ISysImGroupMessage
|
||||
localSysImUserLoginHistory ISysImUserLoginHistory
|
||||
localSysImLoginFailureLog ISysImLoginFailureLog
|
||||
localSysImExternalConfig ISysImExternalConfig
|
||||
localSysImNotification ISysImNotification
|
||||
localSysImAppRelease ISysImAppRelease
|
||||
localSysImAbuseReason ISysImAbuseReason
|
||||
localSysImMailboxConfig ISysImMailboxConfig
|
||||
localSysImFeedbackConfig ISysImFeedbackConfig
|
||||
localSysImWorkbench ISysImWorkbench
|
||||
localSysImTaskDashboard ISysImTaskDashboard
|
||||
localSysImAuditLog ISysImAuditLog
|
||||
localSysImKafkaAudit ISysImKafkaAudit
|
||||
localSysImKafkaCommand ISysImKafkaCommand
|
||||
localSysImDeadLetter ISysImDeadLetter
|
||||
localSysDictData ISysDictData
|
||||
localSysDictType ISysDictType
|
||||
localSysEmsLog ISysEmsLog
|
||||
localSysGenCodes ISysGenCodes
|
||||
localSysLog ISysLog
|
||||
localSysLoginLog ISysLoginLog
|
||||
localSysNormalTreeDemo ISysNormalTreeDemo
|
||||
localSysOptionTreeDemo ISysOptionTreeDemo
|
||||
localSysProvinces ISysProvinces
|
||||
localSysServeLicense ISysServeLicense
|
||||
localSysServeLog ISysServeLog
|
||||
localSysSmsLog ISysSmsLog
|
||||
localSysTestCategory ISysTestCategory
|
||||
)
|
||||
|
||||
func SysAddons() ISysAddons {
|
||||
@@ -1041,6 +1055,28 @@ func RegisterSysImWorkOrder(i ISysImWorkOrder) {
|
||||
localSysImWorkOrder = i
|
||||
}
|
||||
|
||||
func SysImTenantApplication() ISysImTenantApplication {
|
||||
if localSysImTenantApplication == nil {
|
||||
panic("implement not found for interface ISysImTenantApplication, forgot register?")
|
||||
}
|
||||
return localSysImTenantApplication
|
||||
}
|
||||
|
||||
func RegisterSysImTenantApplication(i ISysImTenantApplication) {
|
||||
localSysImTenantApplication = i
|
||||
}
|
||||
|
||||
func SysImTenantEntryFeedback() ISysImTenantEntryFeedback {
|
||||
if localSysImTenantEntryFeedback == nil {
|
||||
panic("implement not found for interface ISysImTenantEntryFeedback, forgot register?")
|
||||
}
|
||||
return localSysImTenantEntryFeedback
|
||||
}
|
||||
|
||||
func RegisterSysImTenantEntryFeedback(i ISysImTenantEntryFeedback) {
|
||||
localSysImTenantEntryFeedback = i
|
||||
}
|
||||
|
||||
func SysImOutbox() ISysImOutbox {
|
||||
if localSysImOutbox == nil {
|
||||
panic("implement not found for interface ISysImOutbox, forgot register?")
|
||||
|
||||
@@ -90,6 +90,38 @@ LEFT JOIN `hg_admin_role_menu` existing ON existing.`role_id` = rm.`role_id` AND
|
||||
WHERE btn.`name` IN ('imSecurityPolicyView','imSecurityPolicySave','imSecurityPolicyPublish','imSecurityPolicyRestoreDefault','imSecurityPolicyLoginLockoutConfig')
|
||||
AND existing.`menu_id` IS NULL;
|
||||
|
||||
INSERT INTO `hg_admin_menu` (`pid`, `title`, `name`, `path`, `icon`, `type`, `redirect`, `permissions`, `permission_name`, `component`, `always_show`, `active_menu`, `is_root`, `is_frame`, `frame_src`, `keep_alive`, `hidden`, `affix`, `level`, `tree`, `sort`, `remark`, `status`, `created_at`, `updated_at`)
|
||||
SELECT @settingsId, '企业注册', 'imTenantApplicationIndex', 'tenant-application/index', '', 2, '', '/imTenantApplication/list', '', '/imTenantApplication/index', 1, 'imSystemSettings', 0, 0, '', 0, 0, 0, 3, CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' '), 80, '', 1, @now, @now
|
||||
WHERE @settingsId IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `hg_admin_menu` WHERE `name`='imTenantApplicationIndex');
|
||||
|
||||
INSERT INTO `hg_admin_menu` (`pid`, `title`, `name`, `path`, `icon`, `type`, `redirect`, `permissions`, `permission_name`, `component`, `always_show`, `active_menu`, `is_root`, `is_frame`, `frame_src`, `keep_alive`, `hidden`, `affix`, `level`, `tree`, `sort`, `remark`, `status`, `created_at`, `updated_at`)
|
||||
SELECT @settingsId, '企业反馈', 'imTenantEntryFeedbackIndex', 'tenant-entry-feedback/index', '', 2, '', '/imTenantEntryFeedback/list', '', '/imTenantEntryFeedback/index', 1, 'imSystemSettings', 0, 0, '', 0, 0, 0, 3, CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' '), 90, '', 1, @now, @now
|
||||
WHERE @settingsId IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `hg_admin_menu` WHERE `name`='imTenantEntryFeedbackIndex');
|
||||
|
||||
SET @tenantApplicationId := (SELECT `id` FROM `hg_admin_menu` WHERE `name`='imTenantApplicationIndex' LIMIT 1);
|
||||
SET @tenantEntryFeedbackId := (SELECT `id` FROM `hg_admin_menu` WHERE `name`='imTenantEntryFeedbackIndex' LIMIT 1);
|
||||
|
||||
UPDATE `hg_admin_menu` SET `pid`=@settingsId, `title`='企业注册', `path`='tenant-application/index', `permissions`='/imTenantApplication/list', `component`='/imTenantApplication/index', `active_menu`='imSystemSettings', `type`=2, `level`=3, `tree`=CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' '), `sort`=80, `hidden`=0, `status`=1, `updated_at`=@now WHERE `id`=@tenantApplicationId;
|
||||
UPDATE `hg_admin_menu` SET `pid`=@settingsId, `title`='企业反馈', `path`='tenant-entry-feedback/index', `permissions`='/imTenantEntryFeedback/list', `component`='/imTenantEntryFeedback/index', `active_menu`='imSystemSettings', `type`=2, `level`=3, `tree`=CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' '), `sort`=90, `hidden`=0, `status`=1, `updated_at`=@now WHERE `id`=@tenantEntryFeedbackId;
|
||||
|
||||
INSERT INTO `hg_admin_menu` (`pid`, `title`, `name`, `path`, `icon`, `type`, `redirect`, `permissions`, `permission_name`, `component`, `always_show`, `active_menu`, `is_root`, `is_frame`, `frame_src`, `keep_alive`, `hidden`, `affix`, `level`, `tree`, `sort`, `remark`, `status`, `created_at`, `updated_at`)
|
||||
SELECT @tenantApplicationId, '企业注册详情', 'imTenantApplicationView', '', '', 3, '', '/imTenantApplication/view', '', '', 1, '', 0, 0, '', 0, 1, 0, 4, CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' tr_', @tenantApplicationId, ' '), 10, '', 1, @now, @now
|
||||
WHERE @tenantApplicationId IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `hg_admin_menu` WHERE `name`='imTenantApplicationView');
|
||||
|
||||
INSERT INTO `hg_admin_menu` (`pid`, `title`, `name`, `path`, `icon`, `type`, `redirect`, `permissions`, `permission_name`, `component`, `always_show`, `active_menu`, `is_root`, `is_frame`, `frame_src`, `keep_alive`, `hidden`, `affix`, `level`, `tree`, `sort`, `remark`, `status`, `created_at`, `updated_at`)
|
||||
SELECT @tenantEntryFeedbackId, '企业反馈详情', 'imTenantEntryFeedbackView', '', '', 3, '', '/imTenantEntryFeedback/view', '', '', 1, '', 0, 0, '', 0, 1, 0, 4, CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' tr_', @tenantEntryFeedbackId, ' '), 10, '', 1, @now, @now
|
||||
WHERE @tenantEntryFeedbackId IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `hg_admin_menu` WHERE `name`='imTenantEntryFeedbackView');
|
||||
|
||||
UPDATE `hg_admin_menu` SET `pid`=@tenantApplicationId, `title`='企业注册详情', `permissions`='/imTenantApplication/view', `type`=3, `level`=4, `tree`=CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' tr_', @tenantApplicationId, ' '), `hidden`=1, `status`=1, `updated_at`=@now WHERE `name`='imTenantApplicationView';
|
||||
UPDATE `hg_admin_menu` SET `pid`=@tenantEntryFeedbackId, `title`='企业反馈详情', `permissions`='/imTenantEntryFeedback/view', `type`=3, `level`=4, `tree`=CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' tr_', @tenantEntryFeedbackId, ' '), `hidden`=1, `status`=1, `updated_at`=@now WHERE `name`='imTenantEntryFeedbackView';
|
||||
|
||||
INSERT INTO `hg_admin_role_menu` (`role_id`, `menu_id`)
|
||||
SELECT DISTINCT rm.`role_id`, menu.`id`
|
||||
FROM `hg_admin_role_menu` rm
|
||||
JOIN `hg_admin_menu` menu ON menu.`name` IN ('imTenantApplicationIndex', 'imTenantApplicationView', 'imTenantEntryFeedbackIndex', 'imTenantEntryFeedbackView')
|
||||
LEFT JOIN `hg_admin_role_menu` existing ON existing.`role_id`=rm.`role_id` AND existing.`menu_id`=menu.`id`
|
||||
WHERE rm.`menu_id`=@settingsId AND existing.`menu_id` IS NULL;
|
||||
|
||||
-- Remove one-page wrapper directories after their page has been moved.
|
||||
UPDATE `hg_admin_menu` SET `status`=2, `hidden`=1, `updated_at`=@now
|
||||
WHERE `name` IN ('imUser', 'imGroup', 'imTenant', 'imRealname', 'imWorkOrder', 'imAuditLog', 'imOutbox');
|
||||
|
||||
Reference in New Issue
Block a user