Browse Source

Merge branch 'feature/group_list' of xuyiping/kpt-tmr-group into release/v1.0.2

xuyiping 1 year ago
parent
commit
4dab699e4a
5 changed files with 96 additions and 15 deletions
  1. 89 12
      .drone.yml
  2. 1 1
      go.mod
  3. 2 0
      go.sum
  4. 1 1
      module/backend/pasture_service.go
  5. 3 1
      module/backend/statistic_service.go

+ 89 - 12
.drone.yml

@@ -1,16 +1,8 @@
 kind: pipeline
 type: docker
-name: kptTmrGroup
+name: test
 
-clone:
-  depth: 1
-  disable: true
 steps:
-  - name: clone
-    image: alpine/git
-    commands:
-      - git clone -b develop http://192.168.1.8:3000/xuyiping/kpt-tmr-group.git
-      - cp -R kpt-tmr-group/* ./
   - name: build
     image: plugins/docker:20.14.2
     volumes:
@@ -28,16 +20,101 @@ steps:
         from_secret: aliyuncs_password
       repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-tmr-group
       registry: registry.cn-hangzhou.aliyuncs.com
-      tags: [ 1.0.3,latest ]
-
+      tags: [ test ]
+  - name: ssh commands
+    image: appleboy/drone-ssh
+    settings:
+      host: 192.168.1.70
+      username: tmrwatch
+      password:
+        from_secret: ssh_password
+      port: 22
+      script:
+        - cd /data/docker-compose/kpt-tmr-group/
+        - echo "123456" | ./restart.sh
 trigger:
   branch:
     include:
-    - develop
+    - feature/*
   event:
     include:
     - push
+volumes:
+  - name: docker-ca
+    host:
+      path: /etc/docker
+  - name: docker-sock
+    host:
+      path: /var/run/docker.sock
+---
+kind: pipeline
+type: docker
+name: product
+steps:
+  - name: build
+    image: plugins/docker:20.14.2
+    volumes:
+      - name: hosts
+        path: /etc/hosts
+      - name: docker-ca
+        path: /etc/docker
+      - name: docker-sock
+        path: /var/run/docker.sock
+    settings:
+      username:
+        from_secret: aliyuncs_username
+      password:
+        from_secret: aliyuncs_password
+      repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-tmr-group
+      registry: registry.cn-hangzhou.aliyuncs.com
+      tag:
+        - latest
+        - ${DRONE_BRANCH##release/}
+trigger:
+  branch:
+    include:
+      - release/*
+  event:
+    include:
+      - push
+volumes:
+  - name: docker-ca
+    host:
+      path: /etc/docker
+  - name: docker-sock
+    host:
+      path: /var/run/docker.sock
+---
+kind: pipeline
+type: docker
+name: fix
 
+steps:
+  - name: build
+    image: plugins/docker:20.14.2
+    volumes:
+      - name: hosts
+        path: /etc/hosts
+      - name: docker-ca
+        path: /etc/docker
+      - name: docker-sock
+        path: /var/run/docker.sock
+    settings:
+      username:
+        from_secret: aliyuncs_username
+      password:
+        from_secret: aliyuncs_password
+      repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-tmr-group
+      registry: registry.cn-hangzhou.aliyuncs.com
+      tag:
+        - latest
+trigger:
+  branch:
+    include:
+      - fix/*
+  event:
+    include:
+      - push
 volumes:
   - name: docker-ca
     host:

+ 1 - 1
go.mod

@@ -3,7 +3,7 @@ module kpt-tmr-group
 go 1.17
 
 require (
-	gitee.com/xuyiping_admin/go_proto v0.0.0-20230823061528-20b02d357f02
+	gitee.com/xuyiping_admin/go_proto v0.0.0-20231114030613-89ef68ca6bfa
 	gitee.com/xuyiping_admin/pkg v0.0.0-20230822102440-0e489dd5d75a
 	github.com/dgrijalva/jwt-go v3.2.0+incompatible
 	github.com/getsentry/sentry-go v0.23.0

+ 2 - 0
go.sum

@@ -48,6 +48,8 @@ gitee.com/xuyiping_admin/go_proto v0.0.0-20230823060841-fecf079818d5 h1:5wvuR14m
 gitee.com/xuyiping_admin/go_proto v0.0.0-20230823060841-fecf079818d5/go.mod h1:x47UOU+lOkZnrtAENAsOGd7mZ5I8D2JRkMKMqLLRlVw=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20230823061528-20b02d357f02 h1:e4BzweXQdP/RdWBeqk1sshUuxBI/jcLUCNDtv/G1mXg=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20230823061528-20b02d357f02/go.mod h1:x47UOU+lOkZnrtAENAsOGd7mZ5I8D2JRkMKMqLLRlVw=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20231114030613-89ef68ca6bfa h1:fSUSfuSn6BQB3Yqo52MnT2GPntd5NGXkBVsT0RmQAlo=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20231114030613-89ef68ca6bfa/go.mod h1:x47UOU+lOkZnrtAENAsOGd7mZ5I8D2JRkMKMqLLRlVw=
 gitee.com/xuyiping_admin/pkg v0.0.0-20230822102440-0e489dd5d75a h1:+SSGto+q5BKy6r9FLFQXooTNqZs4tALceFpoo2jef8w=
 gitee.com/xuyiping_admin/pkg v0.0.0-20230822102440-0e489dd5d75a/go.mod h1:vK5K2LnhWZnvZlEY9gmT6GFdq/5Y0mtxuKLNJHFJkE4=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=

+ 1 - 1
module/backend/pasture_service.go

@@ -770,7 +770,7 @@ func (s *StoreEntry) ForageEnumList(ctx context.Context) *operationPb.ForageEnum
 	res.Data.CattleParentCategory = append(res.Data.CattleParentCategory,
 		&operationPb.CattleParentCategoryEnum{
 			Value: operationPb.CattleCategoryParent_INVALID,
-			Label: "畜牧类别",
+			Label: "所有类别",
 		},
 		&operationPb.CattleParentCategoryEnum{
 			Value: operationPb.CattleCategoryParent_LACTATION_CAW,

+ 3 - 1
module/backend/statistic_service.go

@@ -707,7 +707,9 @@ func (s *StoreEntry) GetDataByName(ctx context.Context, req *operationPb.GetData
 	}
 
 	body := &model.PastureCommonRequest{
-		Name: req.ApiName,
+		Name:   req.ApiName,
+		Page:   req.Page,
+		Offset: req.Offset,
 		ParamMaps: &model.GetDataByNameParams{
 			PastureId: fmt.Sprintf("%d", pastureId),
 			StartTime: req.StartTime,