This commit is contained in:
workabee 2024-02-19 14:37:59 +08:00
parent 90e942e61f
commit 640f303aec
5 changed files with 122 additions and 16 deletions

35
conf/config.yaml Normal file
View File

@ -0,0 +1,35 @@
system:
domain: exhibitiontest
mode: dev
node_num: 3
port: 8086
key:
cert:
is_https: false
cron: false
key_path: ""
cert_path: ""
redis:
db: 1
addr: 127.0.0.1:6379
password:
jaeger:
addr: 127.0.0.1:6831
open: true
zapLog:
level: "info"
filename: "logs/exhibition-main.log"
max_size: 5
max_age: 30
max_backups: 30
jwt:
key: "3Ei*^!a6^6$w^wgK"
expire: 24
bos:
AccessKeyId: "ALTAKxrqOQHnAN525Tb2GX4Bhe"
AccessKeySecret: "d2ecaa9d75114d3b9f42b99014198306"
BucketName: "dci-file-new"
Endpoint: ".bj.bcebos.com"
BosBaseDir: "exhibition"
Host: "https://bj.bcebos.com"
CdnHost: "https://cdns.fontree.cn"

68
conf/dubbogo.yaml Normal file
View File

@ -0,0 +1,68 @@
dubbo:
registries:
demoZK:
protocol: zookeeper
timeout: 30s
address: 127.0.0.1:2181
consumer:
filter: tracing
request-timeout: 30s
params:
max-call-send-msg-size: 8000000
max-call-recv-msg-size: 8000000
references:
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.Account
filter: cshutdown,sign
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
ExhibitionClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Exhibition
ArtistClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artist
logger:
zap-config:
level: error # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoderConfig:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
lineEnding: ""
levelEncoder: "capitalColor"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "logs/runtime/exhibition-main.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 5
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 30
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 30
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false

View File

@ -55,7 +55,7 @@ type AppConfig struct {
func GetConf() (iniConf string, err error) {
if os.Getenv(model.MODE_ENV) != "" {
if err = os.Setenv(constant.ConfigFileEnvKey, fmt.Sprintf("./conf/%s%s", os.Getenv(model.MODE_ENV), model.SERVER_DUBBOGO_CONFIG)); err != nil {
if err = os.Setenv(constant.ConfigFileEnvKey, fmt.Sprintf("./conf/%s/%s", os.Getenv(model.MODE_ENV), model.SERVER_DUBBOGO_CONFIG)); err != nil {
return
}
}

View File

@ -100,6 +100,7 @@ func OcrGetIdCard(image string, side string) (*OrcRes, error) {
return nil, err
}
fmt.Printf("%+v\n", res)
switch res.ImageStatus {
case "normal":
@ -120,6 +121,7 @@ func OcrGetIdCard(image string, side string) (*OrcRes, error) {
default:
return nil, errors.New("未知状态")
}
if side == "front" {
switch res.IdcardNumberType {
case -1:
return nil, errors.New("身份证正面所有字段全为空")
@ -135,6 +137,7 @@ func OcrGetIdCard(image string, side string) (*OrcRes, error) {
default:
return nil, errors.New("未知状态")
}
}
var result OrcRes
fmt.Println(res.WordsResult.Name.Words)
if side == "front" {

View File

@ -14,10 +14,10 @@ var AccountProvider = new(account.AccountClientImpl)
var GrpcArtistImpl = new(artist.ArtistClientImpl)
func init() {
appConfig.GetOptions()
config.SetConsumerService(GrpcArtistImpl)
config.SetConsumerService(AccountProvider)
config.SetConsumerService(GrpcExhibitionClientImpl)
appConfig.GetOptions()
if err := config.Load(); err != nil {
panic(err)
}