From 33d97034c5eb24385ff65db3935d48f163eb7cd1 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Tue, 17 Oct 2023 22:08:11 +0800 Subject: [PATCH 1/5] chore: update deps --- api/internal/i18n/locale/en.json | 3 +- api/internal/i18n/locale/zh.json | 3 +- .../logic/base/init_job_database_logic.go | 3 + .../logic/base/init_mcms_database_logic.go | 3 + .../logic/emaillog/create_email_log_logic.go | 5 ++ .../logic/emaillog/delete_email_log_logic.go | 5 ++ .../emaillog/get_email_log_by_id_logic.go | 4 ++ .../emaillog/get_email_log_list_logic.go | 4 ++ .../logic/emaillog/update_email_log_logic.go | 5 ++ .../create_email_provider_logic.go | 5 ++ .../delete_email_provider_logic.go | 5 ++ .../get_email_provider_by_id_logic.go | 4 ++ .../get_email_provider_list_logic.go | 4 ++ .../update_email_provider_logic.go | 5 ++ .../logic/messagesender/send_email_logic.go | 5 ++ .../logic/messagesender/send_sms_logic.go | 5 ++ .../logic/smslog/create_sms_log_logic.go | 5 ++ .../logic/smslog/delete_sms_log_logic.go | 5 ++ .../logic/smslog/get_sms_log_by_id_logic.go | 4 ++ .../logic/smslog/get_sms_log_list_logic.go | 4 ++ .../logic/smslog/update_sms_log_logic.go | 5 ++ .../smsprovider/create_sms_provider_logic.go | 5 ++ .../smsprovider/delete_sms_provider_logic.go | 5 ++ .../get_sms_provider_by_id_logic.go | 4 ++ .../get_sms_provider_list_logic.go | 4 ++ .../smsprovider/update_sms_provider_logic.go | 5 ++ api/internal/logic/task/create_task_logic.go | 5 ++ api/internal/logic/task/delete_task_logic.go | 5 ++ .../logic/task/get_task_by_id_logic.go | 4 ++ .../logic/task/get_task_list_logic.go | 4 ++ api/internal/logic/task/update_task_logic.go | 5 ++ .../logic/tasklog/create_task_log_logic.go | 5 ++ .../logic/tasklog/delete_task_log_logic.go | 5 ++ .../logic/tasklog/get_task_log_by_id_logic.go | 4 ++ .../logic/tasklog/get_task_log_list_logic.go | 4 ++ .../logic/tasklog/update_task_log_logic.go | 5 ++ go.mod | 22 +++---- go.sum | 62 +++++++------------ 38 files changed, 192 insertions(+), 52 deletions(-) diff --git a/api/internal/i18n/locale/en.json b/api/internal/i18n/locale/en.json index 7fe9141c..e9fd0a1e 100644 --- a/api/internal/i18n/locale/en.json +++ b/api/internal/i18n/locale/en.json @@ -16,7 +16,8 @@ "permissionDeny": "User does not have permission to access this interface", "constraintError": "Operation failed: Data conflict", "validationError": "Operation failed: Validation failed", - "notSingularError": "Operation failed: Data not unique" + "notSingularError": "Operation failed: Data not unique", + "serviceUnavailable": "Service is unavailable, please check if the service is enabled" }, "apiGroup":{ "cloud_file_tag": "Cloud File's Tag", diff --git a/api/internal/i18n/locale/zh.json b/api/internal/i18n/locale/zh.json index 69d02625..1d997414 100644 --- a/api/internal/i18n/locale/zh.json +++ b/api/internal/i18n/locale/zh.json @@ -16,7 +16,8 @@ "permissionDeny": "用户无权限访问此接口", "constraintError": "操作失败: 数据冲突", "validationError": "操作失败: 校验失败", - "notSingularError": "操作失败: 数据不唯一" + "notSingularError": "操作失败: 数据不唯一", + "serviceUnavailable": "服务不可用,请检查服务是否已启用" }, "apiGroup":{ "cloud_file_tag": "云文件标签管理", diff --git a/api/internal/logic/base/init_job_database_logic.go b/api/internal/logic/base/init_job_database_logic.go index 85ccfdd7..fea6143c 100644 --- a/api/internal/logic/base/init_job_database_logic.go +++ b/api/internal/logic/base/init_job_database_logic.go @@ -28,6 +28,9 @@ func NewInitJobDatabaseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *I } func (l *InitJobDatabaseLogic) InitJobDatabase() (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } result, err := l.svcCtx.JobRpc.InitDatabase(l.ctx, &job.Empty{}) if err != nil { return nil, err diff --git a/api/internal/logic/base/init_mcms_database_logic.go b/api/internal/logic/base/init_mcms_database_logic.go index 9c03ac24..23a8a769 100644 --- a/api/internal/logic/base/init_mcms_database_logic.go +++ b/api/internal/logic/base/init_mcms_database_logic.go @@ -30,6 +30,9 @@ func NewInitMcmsDatabaseLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } func (l *InitMcmsDatabaseLogic) InitMcmsDatabase() (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } check, err := l.svcCtx.CoreRpc.GetApiList(l.ctx, &core.ApiListReq{ Page: 1, PageSize: 10, diff --git a/api/internal/logic/emaillog/create_email_log_logic.go b/api/internal/logic/emaillog/create_email_log_logic.go index 831df2d8..6b098455 100644 --- a/api/internal/logic/emaillog/create_email_log_logic.go +++ b/api/internal/logic/emaillog/create_email_log_logic.go @@ -2,6 +2,8 @@ package emaillog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewCreateEmailLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cr } func (l *CreateEmailLogLogic) CreateEmailLog(req *types.EmailLogInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.CreateEmailLog(l.ctx, &mcms.EmailLogInfo{ Target: req.Target, diff --git a/api/internal/logic/emaillog/delete_email_log_logic.go b/api/internal/logic/emaillog/delete_email_log_logic.go index debd836b..5d3e103f 100644 --- a/api/internal/logic/emaillog/delete_email_log_logic.go +++ b/api/internal/logic/emaillog/delete_email_log_logic.go @@ -2,6 +2,8 @@ package emaillog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewDeleteEmailLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *De } func (l *DeleteEmailLogLogic) DeleteEmailLog(req *types.UUIDsReq) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.DeleteEmailLog(l.ctx, &mcms.UUIDsReq{ Ids: req.Ids, }) diff --git a/api/internal/logic/emaillog/get_email_log_by_id_logic.go b/api/internal/logic/emaillog/get_email_log_by_id_logic.go index 9842e4c3..f407a494 100644 --- a/api/internal/logic/emaillog/get_email_log_by_id_logic.go +++ b/api/internal/logic/emaillog/get_email_log_by_id_logic.go @@ -3,6 +3,7 @@ package emaillog import ( "context" "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetEmailLogByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G } func (l *GetEmailLogByIdLogic) GetEmailLogById(req *types.UUIDReq) (resp *types.EmailLogInfoResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.GetEmailLogById(l.ctx, &mcms.UUIDReq{Id: req.Id}) if err != nil { return nil, err diff --git a/api/internal/logic/emaillog/get_email_log_list_logic.go b/api/internal/logic/emaillog/get_email_log_list_logic.go index 4d357455..34b9cdf9 100644 --- a/api/internal/logic/emaillog/get_email_log_list_logic.go +++ b/api/internal/logic/emaillog/get_email_log_list_logic.go @@ -3,6 +3,7 @@ package emaillog import ( "context" "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetEmailLogListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G } func (l *GetEmailLogListLogic) GetEmailLogList(req *types.EmailLogListReq) (resp *types.EmailLogListResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.GetEmailLogList(l.ctx, &mcms.EmailLogListReq{ Page: req.Page, diff --git a/api/internal/logic/emaillog/update_email_log_logic.go b/api/internal/logic/emaillog/update_email_log_logic.go index afa98add..1a7ed0ac 100644 --- a/api/internal/logic/emaillog/update_email_log_logic.go +++ b/api/internal/logic/emaillog/update_email_log_logic.go @@ -2,6 +2,8 @@ package emaillog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewUpdateEmailLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Up } func (l *UpdateEmailLogLogic) UpdateEmailLog(req *types.EmailLogInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.UpdateEmailLog(l.ctx, &mcms.EmailLogInfo{ Id: req.Id, diff --git a/api/internal/logic/emailprovider/create_email_provider_logic.go b/api/internal/logic/emailprovider/create_email_provider_logic.go index 7ffd4026..777124fc 100644 --- a/api/internal/logic/emailprovider/create_email_provider_logic.go +++ b/api/internal/logic/emailprovider/create_email_provider_logic.go @@ -2,6 +2,8 @@ package emailprovider import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewCreateEmailProviderLogic(ctx context.Context, svcCtx *svc.ServiceContext } func (l *CreateEmailProviderLogic) CreateEmailProvider(req *types.EmailProviderInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.CreateEmailProvider(l.ctx, &mcms.EmailProviderInfo{ Name: req.Name, diff --git a/api/internal/logic/emailprovider/delete_email_provider_logic.go b/api/internal/logic/emailprovider/delete_email_provider_logic.go index 19ef0da2..30827f3c 100644 --- a/api/internal/logic/emailprovider/delete_email_provider_logic.go +++ b/api/internal/logic/emailprovider/delete_email_provider_logic.go @@ -2,6 +2,8 @@ package emailprovider import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewDeleteEmailProviderLogic(ctx context.Context, svcCtx *svc.ServiceContext } func (l *DeleteEmailProviderLogic) DeleteEmailProvider(req *types.IDsReq) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.DeleteEmailProvider(l.ctx, &mcms.IDsReq{ Ids: req.Ids, }) diff --git a/api/internal/logic/emailprovider/get_email_provider_by_id_logic.go b/api/internal/logic/emailprovider/get_email_provider_by_id_logic.go index 77f06cb8..89ba0630 100644 --- a/api/internal/logic/emailprovider/get_email_provider_by_id_logic.go +++ b/api/internal/logic/emailprovider/get_email_provider_by_id_logic.go @@ -3,6 +3,7 @@ package emailprovider import ( "context" "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetEmailProviderByIdLogic(ctx context.Context, svcCtx *svc.ServiceContex } func (l *GetEmailProviderByIdLogic) GetEmailProviderById(req *types.IDReq) (resp *types.EmailProviderInfoResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.GetEmailProviderById(l.ctx, &mcms.IDReq{Id: req.Id}) if err != nil { return nil, err diff --git a/api/internal/logic/emailprovider/get_email_provider_list_logic.go b/api/internal/logic/emailprovider/get_email_provider_list_logic.go index d5743082..a2ab7ebe 100644 --- a/api/internal/logic/emailprovider/get_email_provider_list_logic.go +++ b/api/internal/logic/emailprovider/get_email_provider_list_logic.go @@ -3,6 +3,7 @@ package emailprovider import ( "context" "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetEmailProviderListLogic(ctx context.Context, svcCtx *svc.ServiceContex } func (l *GetEmailProviderListLogic) GetEmailProviderList(req *types.EmailProviderListReq) (resp *types.EmailProviderListResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.GetEmailProviderList(l.ctx, &mcms.EmailProviderListReq{ Page: req.Page, diff --git a/api/internal/logic/emailprovider/update_email_provider_logic.go b/api/internal/logic/emailprovider/update_email_provider_logic.go index a0facd7b..432761bf 100644 --- a/api/internal/logic/emailprovider/update_email_provider_logic.go +++ b/api/internal/logic/emailprovider/update_email_provider_logic.go @@ -2,6 +2,8 @@ package emailprovider import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewUpdateEmailProviderLogic(ctx context.Context, svcCtx *svc.ServiceContext } func (l *UpdateEmailProviderLogic) UpdateEmailProvider(req *types.EmailProviderInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.UpdateEmailProvider(l.ctx, &mcms.EmailProviderInfo{ Id: req.Id, diff --git a/api/internal/logic/messagesender/send_email_logic.go b/api/internal/logic/messagesender/send_email_logic.go index 14d5fe7a..19863bdf 100644 --- a/api/internal/logic/messagesender/send_email_logic.go +++ b/api/internal/logic/messagesender/send_email_logic.go @@ -2,11 +2,13 @@ package messagesender import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" "github.com/suyuan32/simple-admin-message-center/types/mcms" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" + "github.com/zeromicro/go-zero/core/errorx" "github.com/zeromicro/go-zero/core/logx" ) @@ -24,6 +26,9 @@ func NewSendEmailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendEma } func (l *SendEmailLogic) SendEmail(req *types.SendEmailReq) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } result, err := l.svcCtx.McmsRpc.SendEmail(l.ctx, &mcms.EmailInfo{ Target: []string{req.Target}, Subject: req.Subject, diff --git a/api/internal/logic/messagesender/send_sms_logic.go b/api/internal/logic/messagesender/send_sms_logic.go index 870e50a2..991486ab 100644 --- a/api/internal/logic/messagesender/send_sms_logic.go +++ b/api/internal/logic/messagesender/send_sms_logic.go @@ -2,8 +2,10 @@ package messagesender import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" "github.com/suyuan32/simple-admin-common/utils/pointy" "github.com/suyuan32/simple-admin-message-center/types/mcms" + "github.com/zeromicro/go-zero/core/errorx" "strings" "github.com/suyuan32/simple-admin-core/api/internal/svc" @@ -26,6 +28,9 @@ func NewSendSmsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendSmsLo } func (l *SendSmsLogic) SendSms(req *types.SendSmsReq) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } var result *mcms.BaseUUIDResp if req.TemplateId == nil { result, err = l.svcCtx.McmsRpc.SendSms(l.ctx, &mcms.SmsInfo{ diff --git a/api/internal/logic/smslog/create_sms_log_logic.go b/api/internal/logic/smslog/create_sms_log_logic.go index 441c5223..e02fc05f 100644 --- a/api/internal/logic/smslog/create_sms_log_logic.go +++ b/api/internal/logic/smslog/create_sms_log_logic.go @@ -2,6 +2,8 @@ package smslog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewCreateSmsLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Crea } func (l *CreateSmsLogLogic) CreateSmsLog(req *types.SmsLogInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.CreateSmsLog(l.ctx, &mcms.SmsLogInfo{ PhoneNumber: req.PhoneNumber, diff --git a/api/internal/logic/smslog/delete_sms_log_logic.go b/api/internal/logic/smslog/delete_sms_log_logic.go index 6204f941..fcbdc789 100644 --- a/api/internal/logic/smslog/delete_sms_log_logic.go +++ b/api/internal/logic/smslog/delete_sms_log_logic.go @@ -2,6 +2,8 @@ package smslog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewDeleteSmsLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Dele } func (l *DeleteSmsLogLogic) DeleteSmsLog(req *types.UUIDsReq) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.DeleteSmsLog(l.ctx, &mcms.UUIDsReq{ Ids: req.Ids, }) diff --git a/api/internal/logic/smslog/get_sms_log_by_id_logic.go b/api/internal/logic/smslog/get_sms_log_by_id_logic.go index 0696d631..6fb03797 100644 --- a/api/internal/logic/smslog/get_sms_log_by_id_logic.go +++ b/api/internal/logic/smslog/get_sms_log_by_id_logic.go @@ -3,6 +3,7 @@ package smslog import ( "context" "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetSmsLogByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } func (l *GetSmsLogByIdLogic) GetSmsLogById(req *types.UUIDReq) (resp *types.SmsLogInfoResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.GetSmsLogById(l.ctx, &mcms.UUIDReq{Id: req.Id}) if err != nil { return nil, err diff --git a/api/internal/logic/smslog/get_sms_log_list_logic.go b/api/internal/logic/smslog/get_sms_log_list_logic.go index 18570932..111aa6db 100644 --- a/api/internal/logic/smslog/get_sms_log_list_logic.go +++ b/api/internal/logic/smslog/get_sms_log_list_logic.go @@ -3,6 +3,7 @@ package smslog import ( "context" "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetSmsLogListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } func (l *GetSmsLogListLogic) GetSmsLogList(req *types.SmsLogListReq) (resp *types.SmsLogListResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.GetSmsLogList(l.ctx, &mcms.SmsLogListReq{ Page: req.Page, diff --git a/api/internal/logic/smslog/update_sms_log_logic.go b/api/internal/logic/smslog/update_sms_log_logic.go index 6ce18a74..edf40169 100644 --- a/api/internal/logic/smslog/update_sms_log_logic.go +++ b/api/internal/logic/smslog/update_sms_log_logic.go @@ -2,6 +2,8 @@ package smslog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewUpdateSmsLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Upda } func (l *UpdateSmsLogLogic) UpdateSmsLog(req *types.SmsLogInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.UpdateSmsLog(l.ctx, &mcms.SmsLogInfo{ Id: req.Id, diff --git a/api/internal/logic/smsprovider/create_sms_provider_logic.go b/api/internal/logic/smsprovider/create_sms_provider_logic.go index c3f6f489..d09c873a 100644 --- a/api/internal/logic/smsprovider/create_sms_provider_logic.go +++ b/api/internal/logic/smsprovider/create_sms_provider_logic.go @@ -2,6 +2,8 @@ package smsprovider import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewCreateSmsProviderLogic(ctx context.Context, svcCtx *svc.ServiceContext) } func (l *CreateSmsProviderLogic) CreateSmsProvider(req *types.SmsProviderInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.CreateSmsProvider(l.ctx, &mcms.SmsProviderInfo{ Name: req.Name, diff --git a/api/internal/logic/smsprovider/delete_sms_provider_logic.go b/api/internal/logic/smsprovider/delete_sms_provider_logic.go index da215eef..d5d825fb 100644 --- a/api/internal/logic/smsprovider/delete_sms_provider_logic.go +++ b/api/internal/logic/smsprovider/delete_sms_provider_logic.go @@ -2,6 +2,8 @@ package smsprovider import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewDeleteSmsProviderLogic(ctx context.Context, svcCtx *svc.ServiceContext) } func (l *DeleteSmsProviderLogic) DeleteSmsProvider(req *types.IDsReq) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.DeleteSmsProvider(l.ctx, &mcms.IDsReq{ Ids: req.Ids, }) diff --git a/api/internal/logic/smsprovider/get_sms_provider_by_id_logic.go b/api/internal/logic/smsprovider/get_sms_provider_by_id_logic.go index 89e11783..21a50576 100644 --- a/api/internal/logic/smsprovider/get_sms_provider_by_id_logic.go +++ b/api/internal/logic/smsprovider/get_sms_provider_by_id_logic.go @@ -3,6 +3,7 @@ package smsprovider import ( "context" "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetSmsProviderByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) } func (l *GetSmsProviderByIdLogic) GetSmsProviderById(req *types.IDReq) (resp *types.SmsProviderInfoResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.GetSmsProviderById(l.ctx, &mcms.IDReq{Id: req.Id}) if err != nil { return nil, err diff --git a/api/internal/logic/smsprovider/get_sms_provider_list_logic.go b/api/internal/logic/smsprovider/get_sms_provider_list_logic.go index 79a3364f..7e301ca0 100644 --- a/api/internal/logic/smsprovider/get_sms_provider_list_logic.go +++ b/api/internal/logic/smsprovider/get_sms_provider_list_logic.go @@ -3,6 +3,7 @@ package smsprovider import ( "context" "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetSmsProviderListLogic(ctx context.Context, svcCtx *svc.ServiceContext) } func (l *GetSmsProviderListLogic) GetSmsProviderList(req *types.SmsProviderListReq) (resp *types.SmsProviderListResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.GetSmsProviderList(l.ctx, &mcms.SmsProviderListReq{ Page: req.Page, diff --git a/api/internal/logic/smsprovider/update_sms_provider_logic.go b/api/internal/logic/smsprovider/update_sms_provider_logic.go index 09cea07f..a711e08e 100644 --- a/api/internal/logic/smsprovider/update_sms_provider_logic.go +++ b/api/internal/logic/smsprovider/update_sms_provider_logic.go @@ -2,6 +2,8 @@ package smsprovider import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewUpdateSmsProviderLogic(ctx context.Context, svcCtx *svc.ServiceContext) } func (l *UpdateSmsProviderLogic) UpdateSmsProvider(req *types.SmsProviderInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.McmsRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.McmsRpc.UpdateSmsProvider(l.ctx, &mcms.SmsProviderInfo{ Id: req.Id, diff --git a/api/internal/logic/task/create_task_logic.go b/api/internal/logic/task/create_task_logic.go index 37dbc180..4f813d11 100644 --- a/api/internal/logic/task/create_task_logic.go +++ b/api/internal/logic/task/create_task_logic.go @@ -2,6 +2,8 @@ package task import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-job/types/job" @@ -26,6 +28,9 @@ func NewCreateTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create } func (l *CreateTaskLogic) CreateTask(req *types.TaskInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.JobRpc.CreateTask(l.ctx, &job.TaskInfo{ Status: req.Status, diff --git a/api/internal/logic/task/delete_task_logic.go b/api/internal/logic/task/delete_task_logic.go index 06de2aac..fa2a7455 100644 --- a/api/internal/logic/task/delete_task_logic.go +++ b/api/internal/logic/task/delete_task_logic.go @@ -2,6 +2,8 @@ package task import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-job/types/job" @@ -26,6 +28,9 @@ func NewDeleteTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete } func (l *DeleteTaskLogic) DeleteTask(req *types.IDsReq) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } result, err := l.svcCtx.JobRpc.DeleteTask(l.ctx, &job.IDsReq{ Ids: req.Ids, }) diff --git a/api/internal/logic/task/get_task_by_id_logic.go b/api/internal/logic/task/get_task_by_id_logic.go index 91606c54..f1a28a4c 100644 --- a/api/internal/logic/task/get_task_by_id_logic.go +++ b/api/internal/logic/task/get_task_by_id_logic.go @@ -2,6 +2,7 @@ package task import ( "context" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-job/types/job" @@ -27,6 +28,9 @@ func NewGetTaskByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTa } func (l *GetTaskByIdLogic) GetTaskById(req *types.IDReq) (resp *types.TaskInfoResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.JobRpc.GetTaskById(l.ctx, &job.IDReq{Id: req.Id}) if err != nil { return nil, err diff --git a/api/internal/logic/task/get_task_list_logic.go b/api/internal/logic/task/get_task_list_logic.go index a278bf1e..42d9e87d 100644 --- a/api/internal/logic/task/get_task_list_logic.go +++ b/api/internal/logic/task/get_task_list_logic.go @@ -2,6 +2,7 @@ package task import ( "context" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-job/types/job" @@ -27,6 +28,9 @@ func NewGetTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTa } func (l *GetTaskListLogic) GetTaskList(req *types.TaskListReq) (resp *types.TaskListResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.JobRpc.GetTaskList(l.ctx, &job.TaskListReq{ Page: req.Page, diff --git a/api/internal/logic/task/update_task_logic.go b/api/internal/logic/task/update_task_logic.go index b329b969..4442e7cb 100644 --- a/api/internal/logic/task/update_task_logic.go +++ b/api/internal/logic/task/update_task_logic.go @@ -2,6 +2,8 @@ package task import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-job/types/job" @@ -26,6 +28,9 @@ func NewUpdateTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Update } func (l *UpdateTaskLogic) UpdateTask(req *types.TaskInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.JobRpc.UpdateTask(l.ctx, &job.TaskInfo{ Id: req.Id, diff --git a/api/internal/logic/tasklog/create_task_log_logic.go b/api/internal/logic/tasklog/create_task_log_logic.go index cebdfae3..eb1a3f27 100644 --- a/api/internal/logic/tasklog/create_task_log_logic.go +++ b/api/internal/logic/tasklog/create_task_log_logic.go @@ -2,6 +2,8 @@ package tasklog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-job/types/job" @@ -26,6 +28,9 @@ func NewCreateTaskLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cre } func (l *CreateTaskLogLogic) CreateTaskLog(req *types.TaskLogInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.JobRpc.CreateTaskLog(l.ctx, &job.TaskLogInfo{ StartedAt: req.StartedAt, diff --git a/api/internal/logic/tasklog/delete_task_log_logic.go b/api/internal/logic/tasklog/delete_task_log_logic.go index e6961f99..7a8807f1 100644 --- a/api/internal/logic/tasklog/delete_task_log_logic.go +++ b/api/internal/logic/tasklog/delete_task_log_logic.go @@ -2,6 +2,8 @@ package tasklog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewDeleteTaskLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Del } func (l *DeleteTaskLogLogic) DeleteTaskLog(req *types.IDsReq) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } result, err := l.svcCtx.JobRpc.DeleteTaskLog(l.ctx, &job.IDsReq{ Ids: req.Ids, }) diff --git a/api/internal/logic/tasklog/get_task_log_by_id_logic.go b/api/internal/logic/tasklog/get_task_log_by_id_logic.go index cc58eac4..8ed76d38 100644 --- a/api/internal/logic/tasklog/get_task_log_by_id_logic.go +++ b/api/internal/logic/tasklog/get_task_log_by_id_logic.go @@ -2,6 +2,7 @@ package tasklog import ( "context" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -26,6 +27,9 @@ func NewGetTaskLogByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } func (l *GetTaskLogByIdLogic) GetTaskLogById(req *types.IDReq) (resp *types.TaskLogInfoResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.JobRpc.GetTaskLogById(l.ctx, &job.IDReq{Id: req.Id}) if err != nil { return nil, err diff --git a/api/internal/logic/tasklog/get_task_log_list_logic.go b/api/internal/logic/tasklog/get_task_log_list_logic.go index 830d557e..fa3f6437 100644 --- a/api/internal/logic/tasklog/get_task_log_list_logic.go +++ b/api/internal/logic/tasklog/get_task_log_list_logic.go @@ -2,6 +2,7 @@ package tasklog import ( "context" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-job/types/job" @@ -27,6 +28,9 @@ func NewGetTaskLogListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } func (l *GetTaskLogListLogic) GetTaskLogList(req *types.TaskLogListReq) (resp *types.TaskLogListResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.JobRpc.GetTaskLogList(l.ctx, &job.TaskLogListReq{ Page: req.Page, diff --git a/api/internal/logic/tasklog/update_task_log_logic.go b/api/internal/logic/tasklog/update_task_log_logic.go index 4e25d9f7..af5f8854 100644 --- a/api/internal/logic/tasklog/update_task_log_logic.go +++ b/api/internal/logic/tasklog/update_task_log_logic.go @@ -2,6 +2,8 @@ package tasklog import ( "context" + "github.com/suyuan32/simple-admin-common/i18n" + "github.com/zeromicro/go-zero/core/errorx" "github.com/suyuan32/simple-admin-core/api/internal/svc" "github.com/suyuan32/simple-admin-core/api/internal/types" @@ -25,6 +27,9 @@ func NewUpdateTaskLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Upd } func (l *UpdateTaskLogLogic) UpdateTaskLog(req *types.TaskLogInfo) (resp *types.BaseMsgResp, err error) { + if !l.svcCtx.Config.JobRpc.Enabled { + return nil, errorx.NewCodeUnavailableError(i18n.ServiceUnavailable) + } data, err := l.svcCtx.JobRpc.UpdateTaskLog(l.ctx, &job.TaskLogInfo{ Id: req.Id, diff --git a/go.mod b/go.mod index 911adf3d..5eecc8be 100644 --- a/go.mod +++ b/go.mod @@ -5,15 +5,15 @@ go 1.20 require ( entgo.io/ent v0.12.4 github.com/casbin/casbin/v2 v2.77.2 - github.com/duke-git/lancet/v2 v2.2.6 + github.com/duke-git/lancet/v2 v2.2.7 github.com/gofrs/uuid/v5 v5.0.0 github.com/mojocn/base64Captcha v1.3.5 - github.com/suyuan32/simple-admin-common v1.1.5 - github.com/suyuan32/simple-admin-job v1.1.5 - github.com/suyuan32/simple-admin-message-center v1.1.5 + github.com/suyuan32/simple-admin-common v1.1.6 + github.com/suyuan32/simple-admin-job v1.1.6 + github.com/suyuan32/simple-admin-message-center v1.1.6 github.com/zeromicro/go-zero v1.5.6 golang.org/x/oauth2 v0.13.0 - google.golang.org/grpc v1.58.2 + google.golang.org/grpc v1.58.3 google.golang.org/protobuf v1.31.0 ) @@ -43,7 +43,7 @@ require ( github.com/go-openapi/swag v0.22.3 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.15.4 // indirect + github.com/go-playground/validator/v10 v10.15.5 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -114,15 +114,15 @@ require ( golang.org/x/crypto v0.14.0 // indirect golang.org/x/image v0.5.0 // indirect golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.16.0 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230920183334-c177e329c48b // indirect + google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -137,4 +137,4 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/zeromicro/go-zero v1.5.6 => github.com/suyuan32/simple-admin-tools v1.5.17 +replace github.com/zeromicro/go-zero v1.5.6 => github.com/suyuan32/simple-admin-tools v1.5.18 diff --git a/go.sum b/go.sum index 765535d5..16ce7470 100644 --- a/go.sum +++ b/go.sum @@ -34,9 +34,8 @@ github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= -github.com/alicebob/miniredis/v2 v2.30.5 h1:3r6kTHdKnuP4fkS8k2IrvSfxpxUTcW1SOL0wN7b7Dt0= +github.com/alicebob/miniredis/v2 v2.31.0 h1:ObEFUNlJwoIiyjxdrYF0QIDE7qXcLc7D3WpSH4c22PU= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -93,8 +92,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/duke-git/lancet/v2 v2.2.6 h1:i0p8J85ujU1OslVIeEn+006OqVMdR7C+O7CHnMML+qI= -github.com/duke-git/lancet/v2 v2.2.6/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc= +github.com/duke-git/lancet/v2 v2.2.7 h1:u9zr6HR+MDUvZEtTlAFtSTIgZfEFsN7cKi27n5weZsw= +github.com/duke-git/lancet/v2 v2.2.7/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc= github.com/emicklei/go-restful/v3 v3.10.2 h1:hIovbnmBTLjHXkqEBUz3HGpXZdM7ZrE9fJIZIqlJLqE= github.com/emicklei/go-restful/v3 v3.10.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -109,7 +108,6 @@ github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBD github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -120,7 +118,6 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= @@ -140,8 +137,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= -github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= +github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-redis/redismock/v8 v8.0.6 h1:rtuijPgGynsRB2Y7KDACm09WvjHWS4RaG44Nm7rcj4Y= @@ -151,7 +148,6 @@ github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -304,7 +300,6 @@ github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -312,7 +307,6 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -330,7 +324,6 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -388,11 +381,9 @@ github.com/mojocn/base64Captcha v1.3.5/go.mod h1:/tTTXn4WTpX9CfrmipqRytCpJ27Uw3G github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nicksnyder/go-i18n/v2 v2.2.1 h1:aOzRCdwsJuoExfZhoiXHy4bjruwCMdt5otbYojM/PaA= github.com/nicksnyder/go-i18n/v2 v2.2.1/go.mod h1:fF2++lPHlo+/kPaj3nB0uxtPwzlPm+BlgwGX7MkeGj0= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -444,7 +435,6 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -485,14 +475,14 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/suyuan32/simple-admin-common v1.1.5 h1:6Idz+J/PHU2GEMANOaZLjI3FVuprmbEYAnid03mhIbs= -github.com/suyuan32/simple-admin-common v1.1.5/go.mod h1:kpddAckXrIQB2kjewRTSQSzTqDrECmxFAW3s4gsFhW8= -github.com/suyuan32/simple-admin-job v1.1.5 h1:V6sZ9MEqcDxHI2WcgZCEvnrTKKbf3X7u69JrL98TyJI= -github.com/suyuan32/simple-admin-job v1.1.5/go.mod h1:D3aa7wrH3eHIrb4nX/RDRaIfWGjBwCzi9h0+o6lKTEQ= -github.com/suyuan32/simple-admin-message-center v1.1.5 h1:ZtQOe5wBpUYaWSZ1cTeGpXXvkcJc7Yzc7jaC3a98+H4= -github.com/suyuan32/simple-admin-message-center v1.1.5/go.mod h1:ld9EDyLY9RNyMD4Nvs1JHyn0JVwd9r6CmbQeGaPn4Ws= -github.com/suyuan32/simple-admin-tools v1.5.17 h1:bp0ELzmKKDYbY/yASAaGsyQD4HrKHd81DpwBeW17614= -github.com/suyuan32/simple-admin-tools v1.5.17/go.mod h1:OkQG0gamNDdJOMnSK7uQDLb8SCyRgww7v7+/UQCo3rg= +github.com/suyuan32/simple-admin-common v1.1.6 h1:e7ADZ1aRFoOBe9WnewxUCLKlHsaU1XnFuLe+4tWmK3k= +github.com/suyuan32/simple-admin-common v1.1.6/go.mod h1:IqivjRysqPNeJMX4Jxq1sjqE6eTPMBCBt6fO2mGNjXk= +github.com/suyuan32/simple-admin-job v1.1.6 h1:8B9vttbPARjviOZkhJA2XgZNIUhfgEKDnYtrzXthHBo= +github.com/suyuan32/simple-admin-job v1.1.6/go.mod h1:BjeCHSoQevVS2u2mABgeftx2zpcaGVl/5EWbPE9qkN8= +github.com/suyuan32/simple-admin-message-center v1.1.6 h1:Il9CeyqZG9j63bQLBZckb0qn9JC1nBBotPQ+E8WQtzg= +github.com/suyuan32/simple-admin-message-center v1.1.6/go.mod h1:BV/igrWRloOVAG8dc2ItHtv5+bNkv2ek6YAQgvG86F4= +github.com/suyuan32/simple-admin-tools v1.5.18 h1:Qr4JF6Qt4dliwO42uVMOGZ4kIsQdpnqqCQ/gUk2ex0w= +github.com/suyuan32/simple-admin-tools v1.5.18/go.mod h1:WFG+5h9IJUJY5gvgzz6FD6xW5g6b2xDjM6xwtIRyCNI= github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= @@ -511,7 +501,6 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs= @@ -632,16 +621,12 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= -golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -771,12 +756,12 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 h1:U7+wNaVuSTaUqNvK2+osJ9ejEZxbjHHk8F2b6Hpx0AE= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920183334-c177e329c48b h1:tdhlmiMZNpc5p2W5qqKgRrOubaMZ3c85uG/GJtGgL98= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920183334-c177e329c48b/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -787,8 +772,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= -google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -817,7 +802,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From c51b86528994ef88950771d12185641b3b1a5848 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Tue, 17 Oct 2023 22:12:45 +0800 Subject: [PATCH 2/5] fix: makefile --- Makefile | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 5734d186..81a73119 100644 --- a/Makefile +++ b/Makefile @@ -87,35 +87,23 @@ gen-rpc-ent-logic: # Generate logic code from Ent, need model and group params | goctls rpc ent --schema=./rpc/ent/schema --style=$(PROJECT_STYLE) --import_prefix=/rpc --service_name=$(SERVICE) --project_name=$(SERVICE_STYLE) -o=./rpc --model=$(model) --group=$(group) --i18n=$(PROJECT_I18N) --proto_out=./rpc/desc/$(shell echo $(model) | tr A-Z a-z).proto --overwrite=true @echo "Generate logic codes from Ent successfully" -.PHONY: build-win-rpc +.PHONY: build-win build-win-rpc: # Build RPC project for Windows | 构建Windows下的RPC可执行文件 env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc.exe ./rpc/$(SERVICE_STYLE).go - @echo "Build RPC project for Windows successfully" + env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api.exe ./api/$(SERVICE_STYLE).go + @echo "Build project for Windows successfully" -.PHONY: build-mac-rpc +.PHONY: build-mac build-mac-rpc: # Build RPC project for MacOS | 构建MacOS下的RPC可执行文件 env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc ./rpc/$(SERVICE_STYLE).go - @echo "Build RPC project for MacOS successfully" + env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api ./api/$(SERVICE_STYLE).go + @echo "Build project for MacOS successfully" -.PHONY: build-linux-rpc +.PHONY: build-linux build-linux-rpc: # Build RPC project for Linux | 构建Linux下的RPC可执行文件 env CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc ./rpc/$(SERVICE_STYLE).go - @echo "Build RPC project for Linux successfully" - -.PHONY: build-win-api -build-win-api: # Build API project for Windows | 构建Windows下的API可执行文件 - env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api.exe ./api/$(SERVICE_STYLE).go - @echo "Build API project for windows successfully" - -.PHONY: build-mac-api -build-mac-api: # Build API project for MacOS | 构建MacOS下的API可执行文件 - env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api ./api/$(SERVICE_STYLE).go - @echo "Build API project for MacOS successfully" - -.PHONY: build-linux-api -build-linux-api: # Build API project for Linux | 构建Linux下的API可执行文件 env CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api ./api/$(SERVICE_STYLE).go - @echo "Build API project for Linux successfully" + @echo "Build project for Linux successfully" .PHONY: gen-swagger gen-swagger: # Generate swagger file | 生成 swagger 文件 From 534c1dd3e80d67b697ecdaa6d04e012fc5bc7045 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Tue, 17 Oct 2023 22:18:44 +0800 Subject: [PATCH 3/5] fix: optimize makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 81a73119..dd020192 100644 --- a/Makefile +++ b/Makefile @@ -88,19 +88,19 @@ gen-rpc-ent-logic: # Generate logic code from Ent, need model and group params | @echo "Generate logic codes from Ent successfully" .PHONY: build-win -build-win-rpc: # Build RPC project for Windows | 构建Windows下的RPC可执行文件 +build-win: # Build project for Windows | 构建Windows下的可执行文件 env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc.exe ./rpc/$(SERVICE_STYLE).go env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api.exe ./api/$(SERVICE_STYLE).go @echo "Build project for Windows successfully" .PHONY: build-mac -build-mac-rpc: # Build RPC project for MacOS | 构建MacOS下的RPC可执行文件 +build-mac: # Build project for MacOS | 构建MacOS下的可执行文件 env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc ./rpc/$(SERVICE_STYLE).go env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api ./api/$(SERVICE_STYLE).go @echo "Build project for MacOS successfully" .PHONY: build-linux -build-linux-rpc: # Build RPC project for Linux | 构建Linux下的RPC可执行文件 +build-linux: # Build project for Linux | 构建Linux下的可执行文件 env CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc ./rpc/$(SERVICE_STYLE).go env CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api ./api/$(SERVICE_STYLE).go @echo "Build project for Linux successfully" From 225b85735b28e9d253f8c0eef6859adb8a7af3f1 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Tue, 17 Oct 2023 22:33:05 +0800 Subject: [PATCH 4/5] chore: update system version in swagger --- api/core.go | 2 +- core.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core.go b/api/core.go index b194219d..8336d4d0 100644 --- a/api/core.go +++ b/api/core.go @@ -5,7 +5,7 @@ // Schemes: http, https // Host: localhost:9100 // BasePath: / -// Version: 1.1.5 +// Version: 1.1.6 // Contact: yuansu.china.work@gmail.com // SecurityDefinitions: // Token: diff --git a/core.json b/core.json index bd55bf80..b405761f 100644 --- a/core.json +++ b/core.json @@ -16,7 +16,7 @@ "contact": { "email": "yuansu.china.work@gmail.com" }, - "version": "1.1.5" + "version": "1.1.6" }, "host": "localhost:9100", "basePath": "/", From f0a5aef21d2b1eb8ad57413598b749db904b3cfc Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Tue, 17 Oct 2023 22:41:47 +0800 Subject: [PATCH 5/5] chore: update all in one --- .../all_in_one/mysql/docker-compose.yaml | 22 ++++++----------- .../all_in_one/postgresql/docker-compose.yaml | 24 +++++-------------- 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/deploy/docker-compose/all_in_one/mysql/docker-compose.yaml b/deploy/docker-compose/all_in_one/mysql/docker-compose.yaml index 7f661562..adc15648 100644 --- a/deploy/docker-compose/all_in_one/mysql/docker-compose.yaml +++ b/deploy/docker-compose/all_in_one/mysql/docker-compose.yaml @@ -8,10 +8,6 @@ volumes: networks: simple-admin: driver: bridge - ipam: - driver: default - config: - - subnet: 10.5.0.0/16 services: mysql: @@ -30,7 +26,6 @@ services: simple-admin: aliases: - mysql-server - ipv4_address: 10.5.0.2 deploy: resources: limits: @@ -52,7 +47,6 @@ services: simple-admin: aliases: - redis-server - ipv4_address: 10.5.0.3 deploy: resources: limits: @@ -63,7 +57,7 @@ services: memory: 200M core-rpc: - image: ryanpower/core-rpc-docker:v1.1.5 + image: ryanpower/core-rpc-docker:v1.1.6 container_name: core-rpc restart: always ports: @@ -77,7 +71,6 @@ services: simple-admin: aliases: - core-rpc - ipv4_address: 10.5.0.4 deploy: resources: limits: @@ -88,7 +81,7 @@ services: memory: 200M job-rpc: - image: ryanpower/job-rpc-docker:v1.1.5 + image: ryanpower/job-rpc-docker:v1.1.6 container_name: job-rpc restart: always ports: @@ -102,7 +95,6 @@ services: simple-admin: aliases: - job-rpc - ipv4_address: 10.5.0.7 deploy: resources: limits: @@ -113,12 +105,13 @@ services: memory: 200M core-api: - image: ryanpower/core-api-docker:v1.1.5 + image: ryanpower/core-api-docker:v1.1.6 container_name: core-api restart: always environment: I18N_DIR: '/app/etc/' DATABASE_TYPE: 'mysql' + DATABASE_HOST: 'mysql-server' DATABASE_USERNAME: 'root' DATABASE_PASSWORD: 'simple-admin.' DATABASE_PORT: 3306 @@ -129,7 +122,6 @@ services: simple-admin: aliases: - core-api - ipv4_address: 10.5.0.5 deploy: resources: limits: @@ -140,7 +132,7 @@ services: memory: 200M backend-ui: - image: ryanpower/backend-ui-docker:v1.1.5 + image: ryanpower/backend-ui-docker:v1.1.6 container_name: backend-ui restart: always ports: @@ -160,7 +152,7 @@ services: memory: 200M fms-api: - image: ryanpower/fms-api-docker:v1.1.5 + image: ryanpower/fms-api-docker:v1.1.6 container_name: fms-api restart: always # environment: @@ -191,7 +183,7 @@ services: memory: 200M mcms-rpc: - image: ryanpower/mcms-rpc-docker:v1.1.5 + image: ryanpower/mcms-rpc-docker:v1.1.6 container_name: mcms-rpc restart: always environment: diff --git a/deploy/docker-compose/all_in_one/postgresql/docker-compose.yaml b/deploy/docker-compose/all_in_one/postgresql/docker-compose.yaml index 1de6316f..ceda88ec 100644 --- a/deploy/docker-compose/all_in_one/postgresql/docker-compose.yaml +++ b/deploy/docker-compose/all_in_one/postgresql/docker-compose.yaml @@ -8,10 +8,6 @@ volumes: networks: simple-admin: driver: bridge - ipam: - driver: default - config: - - subnet: 10.5.0.0/16 services: postgresql: @@ -29,7 +25,6 @@ services: simple-admin: aliases: - postgresql-server - ipv4_address: 10.5.0.2 deploy: resources: limits: @@ -51,7 +46,6 @@ services: simple-admin: aliases: - redis-server - ipv4_address: 10.5.0.3 deploy: resources: limits: @@ -62,7 +56,7 @@ services: memory: 200M core-rpc: - image: ryanpower/core-rpc-docker:v1.1.5 + image: ryanpower/core-rpc-docker:v1.1.6 container_name: core-rpc restart: always # ports: @@ -71,7 +65,6 @@ services: simple-admin: aliases: - core-rpc - ipv4_address: 10.5.0.4 deploy: resources: limits: @@ -82,7 +75,7 @@ services: memory: 200M job-rpc: - image: ryanpower/job-rpc-docker:v1.1.5 + image: ryanpower/job-rpc-docker:v1.1.6 container_name: job-rpc restart: always # ports: @@ -91,7 +84,6 @@ services: simple-admin: aliases: - job-rpc - ipv4_address: 10.5.0.7 deploy: resources: limits: @@ -102,7 +94,7 @@ services: memory: 200M core-api: - image: ryanpower/core-api-docker:v1.1.5 + image: ryanpower/core-api-docker:v1.1.6 container_name: core-api restart: always environment: @@ -114,7 +106,6 @@ services: simple-admin: aliases: - core-api - ipv4_address: 10.5.0.5 deploy: resources: limits: @@ -125,7 +116,7 @@ services: memory: 200M backend-ui: - image: ryanpower/backend-ui-docker:v1.1.5 + image: ryanpower/backend-ui-docker:v1.1.6 container_name: backend-ui restart: always ports: @@ -134,7 +125,6 @@ services: simple-admin: aliases: - backend-ui - ipv4_address: 10.5.0.6 deploy: resources: limits: @@ -145,7 +135,7 @@ services: memory: 200M fms-api: - image: ryanpower/fms-api-docker:v1.1.5 + image: ryanpower/fms-api-docker:v1.1.6 container_name: fms-api restart: always # environment: @@ -160,7 +150,6 @@ services: simple-admin: aliases: - fms-api - ipv4_address: 10.5.0.8 deploy: resources: limits: @@ -171,7 +160,7 @@ services: memory: 200M mcms-rpc: - image: ryanpower/mcms-rpc-docker:v1.1.5 + image: ryanpower/mcms-rpc-docker:v1.1.6 container_name: mcms-rpc restart: always # environment: @@ -182,7 +171,6 @@ services: simple-admin: aliases: - mcms-rpc - ipv4_address: 10.5.0.9 deploy: resources: limits: