作者 Administrator
提交者 yangfu

ci: 配置修改

@@ -8,7 +8,7 @@ COPY ./go.mod go.mod @@ -8,7 +8,7 @@ COPY ./go.mod go.mod
8 COPY ./main.go main.go 8 COPY ./main.go main.go
9 RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"] 9 RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
10 ENV GO111MODULE on 10 ENV GO111MODULE on
11 -ENV GOPROXY https://goproxy.io 11 +ENV GOPROXY https://goproxy.cn
12 RUN ["go","mod","tidy"] 12 RUN ["go","mod","tidy"]
13 RUN ["ls"] 13 RUN ["ls"]
14 RUN ["go","build"] 14 RUN ["go","build"]
@@ -9,3 +9,10 @@ HTTP_PORT = 8081 @@ -9,3 +9,10 @@ HTTP_PORT = 8081
9 ENABLE_KAFKA_LOG11 = true 9 ENABLE_KAFKA_LOG11 = true
10 HTTPS_PORT = 8143 10 HTTPS_PORT = 8143
11 ALLIED_CREATION_USER_HOST = http://allied-creation-user-dev.fjmaimaimai.com 11 ALLIED_CREATION_USER_HOST = http://allied-creation-user-dev.fjmaimaimai.com
  12 +BYTE_CORE_HOST = http://220.250.41.79:8303
  13 +
  14 +STARROCKS_DB_NAME = character_library
  15 +STARROCKS_USER = root
  16 +STARROCKS_PASSWORD = eagle1010
  17 +STARROCKS_HOST = 220.250.41.79
  18 +STARROCKS_PORT = 9030
@@ -104,9 +104,9 @@ spec: @@ -104,9 +104,9 @@ spec:
104 - name: METADATA_BASTION_HOST 104 - name: METADATA_BASTION_HOST
105 value: "http://character-library-metadata-bastion-dev.fjmaimaimai.com" 105 value: "http://character-library-metadata-bastion-dev.fjmaimaimai.com"
106 - name: BYTE_CORE_HOST 106 - name: BYTE_CORE_HOST
107 - value: "http://192.168.100.34:8303" 107 + value: "http://47.97.5.102:8303"
108 - name: STARROCKS_HOST 108 - name: STARROCKS_HOST
109 - value: "118.178.239.45" 109 + value: "220.250.41.79"
110 - name: STARROCKS_PORT 110 - name: STARROCKS_PORT
111 value: "9030" 111 value: "9030"
112 - name: STARROCKS_DB_NAME 112 - name: STARROCKS_DB_NAME
  1 +apiVersion: v1
  2 +kind: Service
  3 +metadata:
  4 + name: character-library-metadata-bastion
  5 + namespace: mmm-suplus-test
  6 + labels:
  7 + k8s-app: character-library-metadata-bastion
  8 +spec:
  9 + ports:
  10 + - name: "http"
  11 + port: 80
  12 + targetPort: 8082
  13 + selector:
  14 + k8s-app: character-library-metadata-bastion
  15 +---
  16 +apiVersion: extensions/v1beta1
  17 +kind: Deployment
  18 +metadata:
  19 + name: character-library-metadata-bastion
  20 + namespace: mmm-suplus-test
  21 + labels:
  22 + k8s-app: character-library-metadata-bastion
  23 +spec:
  24 + replicas: 1
  25 + template:
  26 + metadata:
  27 + labels:
  28 + k8s-app: character-library-metadata-bastion
  29 + spec:
  30 + affinity:
  31 + nodeAffinity:
  32 + preferredDuringSchedulingIgnoredDuringExecution:
  33 + - preference: {}
  34 + weight: 100
  35 + requiredDuringSchedulingIgnoredDuringExecution:
  36 + nodeSelectorTerms:
  37 + - matchExpressions:
  38 + - key: kubernetes.io/hostname
  39 + operator: In
  40 + values:
  41 + - cn-hangzhou.i-bp1djh1xn7taumbue1ze
  42 + - cn-hangzhou.i-bp1djh1xn7taumbue1zd
  43 + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
  44 + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
  45 + containers:
  46 + - name: character-library-metadata-bastion
  47 + image: 192.168.0.243:5000/mmm/character-library-metadata-bastion:dev
  48 + imagePullPolicy: Always
  49 + ports:
  50 + - containerPort: 8082
  51 + volumeMounts:
  52 + - mountPath: /opt/logs
  53 + name: accesslogs
  54 + env:
  55 + - name: POSTGRESQL_DB_NAME
  56 + valueFrom:
  57 + configMapKeyRef:
  58 + name: suplus-config
  59 + key: postgresqlalliedcreation.dbname
  60 + - name: POSTGRESQL_USER
  61 + valueFrom:
  62 + configMapKeyRef:
  63 + name: suplus-config
  64 + key: postgresql.user
  65 + - name: POSTGRESQL_PASSWORD
  66 + valueFrom:
  67 + configMapKeyRef:
  68 + name: suplus-config
  69 + key: postgresql.password
  70 + - name: POSTGRESQL_HOST
  71 + valueFrom:
  72 + configMapKeyRef:
  73 + name: suplus-config
  74 + key: postgresql.host
  75 + - name: POSTGRESQL_PORT
  76 + valueFrom:
  77 + configMapKeyRef:
  78 + name: suplus-config
  79 + key: postgresql.port
  80 + - name: REDIS_HOST
  81 + valueFrom:
  82 + configMapKeyRef:
  83 + name: suplus-config
  84 + key: redis.ip
  85 + - name: REDIS_PORT
  86 + valueFrom:
  87 + configMapKeyRef:
  88 + name: suplus-config
  89 + key: redis.port
  90 + - name: REDIS_AUTH
  91 + value: ""
  92 + - name: LOG_LEVEL
  93 + value: "debug"
  94 + - name: ERROR_BASE_CODE
  95 + value: "1"
  96 + - name: ERROR_BASE_CODE_MULTIPLE
  97 + value: "2000"
  98 + - name: ENABLE_KAFKA_LOG
  99 + value: "true"
  100 + - name: HTTP_PORT
  101 + value: "8082"
  102 + - name: SERVICE_ENV
  103 + value: "test"
  104 + - name: METADATA_BASTION_HOST
  105 + value: "http://character-library-metadata-bastion-test.fjmaimaimai.com"
  106 + - name: BYTE_CORE_HOST
  107 + value: "http://47.97.5.102:8303"
  108 + - name: STARROCKS_HOST
  109 + value: "220.250.41.79"
  110 + - name: STARROCKS_PORT
  111 + value: "9030"
  112 + - name: STARROCKS_DB_NAME
  113 + value: "character_library"
  114 + - name: STARROCKS_USER
  115 + value: "root"
  116 + - name: STARROCKS_PASSWORD
  117 + value: "eagle1010"
  118 + volumes:
  119 + - name: accesslogs
  120 + emptyDir: {}
  1 +#!/bin/bash
  2 +export PATH=/root/local/bin:$PATH
  3 +kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
  4 +if [ "$?" == "1" ];then
  5 + kubectl create -f /tmp/test/character-library-metadata-bastion/character-library-metadata-bastion.yaml --record
  6 + kubectl -n mmm-suplus-test get svc | grep -q character-library-metadata-bastion
  7 + if [ "$?" == "0" ];then
  8 + echo "character-library-metadata-bastion service install success!"
  9 + else
  10 + echo "character-library-metadata-bastion service install fail!"
  11 + fi
  12 + kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
  13 + if [ "$?" == "0" ];then
  14 + echo "character-library-metadata-bastion deployment install success!"
  15 + else
  16 + echo "character-library-metadata-bastion deployment install fail!"
  17 + fi
  18 +else
  19 + kubectl delete -f /tmp/test/character-library-metadata-bastion/character-library-metadata-bastion.yaml
  20 + kubectl -n mmm-suplus-test get svc | grep -q character-library-metadata-bastion
  21 + while [ "$?" == "0" ]
  22 + do
  23 + kubectl -n mmm-suplus-test get svc | grep -q character-library-metadata-bastion
  24 + done
  25 + kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
  26 + while [ "$?" == "0" ]
  27 + do
  28 + kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
  29 + done
  30 + kubectl create -f /tmp/test/character-library-metadata-bastion/character-library-metadata-bastion.yaml --record
  31 + kubectl -n mmm-suplus-test get svc | grep -q character-library-metadata-bastion
  32 + if [ "$?" == "0" ];then
  33 + echo "character-library-metadata-bastion service update success!"
  34 + else
  35 + echo "character-library-metadata-bastion service update fail!"
  36 + fi
  37 + kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
  38 + if [ "$?" == "0" ];then
  39 + echo "character-library-metadata-bastion deployment update success!"
  40 + else
  41 + echo "character-library-metadata-bastion deployment update fail!"
  42 + fi
  43 +fi
@@ -14,6 +14,8 @@ type FileDto struct { @@ -14,6 +14,8 @@ type FileDto struct {
14 Url string `json:"url"` 14 Url string `json:"url"`
15 // 文件类型 15 // 文件类型
16 FileType string `json:"fileType"` 16 FileType string `json:"fileType"`
  17 + // 后缀扩展
  18 + Ext string `json:"ext"`
17 // 创建时间 19 // 创建时间
18 Time string `json:"time"` 20 Time string `json:"time"`
19 } 21 }
@@ -23,5 +25,6 @@ func (d *FileDto) Load(f *domain.File) { @@ -23,5 +25,6 @@ func (d *FileDto) Load(f *domain.File) {
23 d.Name = f.FileInfo.Name 25 d.Name = f.FileInfo.Name
24 d.Url = f.FileInfo.Url 26 d.Url = f.FileInfo.Url
25 d.FileType = f.FileType 27 d.FileType = f.FileType
  28 + d.Ext = f.FileInfo.Ext
26 d.Time = xtime.New(f.CreatedAt).Local().Format("2006-01-02 15:04:05") 29 d.Time = xtime.New(f.CreatedAt).Local().Format("2006-01-02 15:04:05")
27 } 30 }
@@ -181,7 +181,7 @@ func (fileService *FileService) SearchFile(listFileQuery *query.SearchFileQuery) @@ -181,7 +181,7 @@ func (fileService *FileService) SearchFile(listFileQuery *query.SearchFileQuery)
181 } 181 }
182 182
183 // 移除文件服务 183 // 移除文件服务
184 -func (fileService *FileService) RemoveFile(removeFileCommand *command.RemoveFileCommand) (interface{}, error) { 184 +func (fileService *FileService) RemoveFile(ctx *domain.Context, removeFileCommand *command.RemoveFileCommand) (interface{}, error) {
185 if err := removeFileCommand.ValidateCommand(); err != nil { 185 if err := removeFileCommand.ValidateCommand(); err != nil {
186 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 186 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
187 } 187 }
@@ -211,7 +211,7 @@ func (fileService *FileService) RemoveFile(removeFileCommand *command.RemoveFile @@ -211,7 +211,7 @@ func (fileService *FileService) RemoveFile(removeFileCommand *command.RemoveFile
211 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeFileCommand.FileId))) 211 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeFileCommand.FileId)))
212 } 212 }
213 deleteFileService, _ := factory.CreateDeleteFileService(transactionContext) 213 deleteFileService, _ := factory.CreateDeleteFileService(transactionContext)
214 - err = deleteFileService.DeleteFiles(nil, file) 214 + err = deleteFileService.DeleteFiles(ctx, file)
215 if err != nil { 215 if err != nil {
216 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 216 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
217 } 217 }
@@ -39,6 +39,7 @@ func init() { @@ -39,6 +39,7 @@ func init() {
39 //ALLIED_CREATION_BASIC_HOST = Configurator.DefaultString("ALLIED_CREATION_BASIC_HOST", ALLIED_CREATION_BASIC_HOST) 39 //ALLIED_CREATION_BASIC_HOST = Configurator.DefaultString("ALLIED_CREATION_BASIC_HOST", ALLIED_CREATION_BASIC_HOST)
40 ALLIED_CREATION_USER_HOST = Configurator.DefaultString("ALLIED_CREATION_USER_HOST", ALLIED_CREATION_USER_HOST) 40 ALLIED_CREATION_USER_HOST = Configurator.DefaultString("ALLIED_CREATION_USER_HOST", ALLIED_CREATION_USER_HOST)
41 MMM_BYTE_BANK_HOST = Configurator.DefaultString("MMM_BYTE_BANK_HOST", MMM_BYTE_BANK_HOST) 41 MMM_BYTE_BANK_HOST = Configurator.DefaultString("MMM_BYTE_BANK_HOST", MMM_BYTE_BANK_HOST)
  42 + METADATA_BASTION_HOST = Configurator.DefaultString("METADATA_BASTION_HOST", METADATA_BASTION_HOST)
42 BYTE_CORE_HOST = Configurator.DefaultString("BYTE_CORE_HOST", BYTE_CORE_HOST) 43 BYTE_CORE_HOST = Configurator.DefaultString("BYTE_CORE_HOST", BYTE_CORE_HOST)
43 SERVICE_ENV = Configurator.DefaultString("SERVICE_ENV", SERVICE_ENV) 44 SERVICE_ENV = Configurator.DefaultString("SERVICE_ENV", SERVICE_ENV)
44 HTTP_PORT = Configurator.DefaultInt("HTTP_PORT", HTTP_PORT) 45 HTTP_PORT = Configurator.DefaultInt("HTTP_PORT", HTTP_PORT)
@@ -10,7 +10,7 @@ type FileInfo struct { @@ -10,7 +10,7 @@ type FileInfo struct {
10 FileSize int `json:"fileSize"` 10 FileSize int `json:"fileSize"`
11 // 文件编号,以固定字符“F”+4位年+2位月+2位日+三位流水,每天编号从001开始 11 // 文件编号,以固定字符“F”+4位年+2位月+2位日+三位流水,每天编号从001开始
12 // FileCode string `json:"fileCode"` 12 // FileCode string `json:"fileCode"`
13 - // 13 + // 后缀扩展
14 Ext string `json:"ext"` 14 Ext string `json:"ext"`
15 // 记录数 15 // 记录数
16 RowCount int `json:"rowCount"` 16 RowCount int `json:"rowCount"`
@@ -46,7 +46,7 @@ func (controller *FileController) RemoveFile() { @@ -46,7 +46,7 @@ func (controller *FileController) RemoveFile() {
46 controller.Unmarshal(removeFileCommand) 46 controller.Unmarshal(removeFileCommand)
47 fileId, _ := controller.GetInt(":fileId") 47 fileId, _ := controller.GetInt(":fileId")
48 removeFileCommand.FileId = fileId 48 removeFileCommand.FileId = fileId
49 - data, err := fileService.RemoveFile(removeFileCommand) 49 + data, err := fileService.RemoveFile(ParseContext(controller.BaseController), removeFileCommand)
50 controller.Response(data, err) 50 controller.Response(data, err)
51 } 51 }
52 52