Skip to content

Commit 57225cb

Browse files
committed
打包客户端
1 parent 5a2b94e commit 57225cb

File tree

6 files changed

+35
-25
lines changed

6 files changed

+35
-25
lines changed

internal/pkg/config/model.go

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
type Config struct {
99
MaxSize int64 `mapstructure:"max-size" json:"burst" yaml:"max-size"`
1010
System System `mapstructure:"system" json:"system" yaml:"system"`
11+
Mail Mail `mapstructure:"mail" json:"mail" yaml:"mail"`
1112
Limit Limit `mapstructure:"limit" json:"limit" yaml:"limit"`
1213
Zap myZap.Zap `mapstructure:"zap" json:"zap" yaml:"zap"`
1314
Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"`
@@ -34,6 +35,13 @@ type System struct {
3435
TimeFormat string `mapstructure:"time-format" json:"timeFormat" yaml:"time-format"`
3536
}
3637

38+
type Mail struct {
39+
SmtpAddress string `mapstructure:"smtpAddress" json:"smtpAddress" yaml:"smtpAddress"`
40+
SmtpPort int `mapstructure:"smtpPort" json:"smtpPort" yaml:"smtpPort"`
41+
Account string `mapstructure:"account" json:"account" yaml:"account"`
42+
Password string `mapstructure:"password" json:"password" yaml:"password"`
43+
}
44+
3745
type Limit struct {
3846
Disable bool `mapstructure:"disable" json:"disable" yaml:"disable"`
3947
Limit float64 `mapstructure:"limit" json:"limit" yaml:"limit"`

internal/pkg/consts/consts.go

-5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ const (
4141
ExtractorErr = "extractor_err"
4242
ContentErr = "content_err"
4343

44-
EmailSmtpAddress = "smtp.exmail.qq.com"
45-
EmailSmtpPort = 465
46-
EmailAccount = "chenqi@deeptest.com"
47-
EmailPassword = ""
48-
4944
HttpRequestTimeout = 60 * time.Second
5045
DeepestKey = "com_deeptest_prop_for_selection"
5146
KEY_BASE_URL = "_base_url_"

internal/server/modules/service/account.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ func (s *AccountService) Register(tenantId consts.TenantId, req v1.RegisterReq)
110110

111111
s.UserRepo.Register(tenantId, &user)
112112

113-
//mp := map[string]string{
114-
// "name": user.Name,
115-
// "sys": consts.Sys,
116-
// "url": consts.Url,
117-
//}
118-
//_mailUtils.Send(user.Email, _i118Utils.Sprintf("register_success"), "register-success", mp)
113+
if config.CONFIG.System.Name == "deeptest" {
114+
mp := map[string]string{
115+
"name": user.Name,
116+
"sys": consts.Sys,
117+
"url": consts.Url,
118+
}
119+
_mailUtils.Send(user.Email, _i118Utils.Sprintf("register_success"), "register-success", mp)
120+
}
119121

120122
return
121123
}

pkg/lib/mail/mail.go

+6-10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"bytes"
66
"fmt"
77
"github.com/aaronchen2k/deeptest"
8+
"github.com/aaronchen2k/deeptest/internal/pkg/config"
89
"github.com/aaronchen2k/deeptest/internal/pkg/consts"
910
"github.com/aaronchen2k/deeptest/pkg/lib/comm"
1011
"github.com/aaronchen2k/deeptest/pkg/lib/i118"
@@ -20,18 +21,13 @@ import (
2021
"strings"
2122
)
2223

23-
// name
24-
// inviter
25-
// sys
26-
// url
27-
// vcode
28-
2924
func Send(to, subject, tmpl string, mp map[string]string) (err error) {
3025
d := gomail.NewDialer(
31-
consts.EmailSmtpAddress,
32-
consts.EmailSmtpPort,
33-
consts.EmailAccount,
34-
consts.EmailPassword)
26+
config.CONFIG.Mail.SmtpAddress,
27+
config.CONFIG.Mail.SmtpPort,
28+
config.CONFIG.Mail.Account,
29+
config.CONFIG.Mail.Password)
30+
3531
s, err := d.Dial()
3632
if err != nil {
3733
return

res/server.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ limit:
99
disable: true
1010
limit: 0
1111
burst: 5
12+
13+
mail:
14+
smtpAddress: smtp.exmail.qq.com
15+
smtpPort: 465
16+
account: mail@deeptest.com
17+
password:
18+
1219
max-size: 1024
1320
maxsize: 1024
1421
mcs:
@@ -44,7 +51,7 @@ saas:
4451
appSecret: ""
4552
host: ""
4653
system:
47-
name: ""
54+
name: "deeptest"
4855
sysEnv: ""
4956
level: debug
5057
serverAddress: 0.0.0.0:8085
@@ -54,6 +61,7 @@ system:
5461
db-type: mysql
5562
cache-type: redis
5663
time-format: "2006-01-02 15:04:05"
64+
5765
thirdparty:
5866
username: ""
5967
password: ""

xdoc/notes.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ npm config set ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/
6868
scp -r ~/work/qiniu/deeptest/* lighthouse@111.231.16.35:~/work/qiniu/deeptest
6969
nohup light-server -s ~/work/qiniu/deeptest > ~/light-server.log 2>&1 &
7070

71-
git push -f github dt:main
72-
git push -f github feature/chenqi99/var_in_params:feature/chenqi99/var_in_params
73-
7471
测试:
7572
基本Websocket
7673
ws://111.231.16.35:9090/ws
@@ -87,6 +84,10 @@ gRPC
8784
${_do_something('test ' + g_var1 + ' ' + escape('https://baidu.com'))}
8885
int2=='101' && function(x) {return x + 100} (6) == 106
8986

87+
# 版本库
88+
git push -f github dt:main
89+
git push -f github feature/chenqi99/var_in_params:feature/chenqi99/var_in_params
90+
9091
# 打包命令
9192
ENV=dp rm -rf bin && make default
9293

0 commit comments

Comments
 (0)