add
add get product list from grpc
| | |
| | | "github.com/spf13/cast" |
| | | "go.uber.org/zap" |
| | | "google.golang.org/grpc" |
| | | "google.golang.org/grpc/credentials/insecure" |
| | | "srm/global" |
| | | "srm/model/common/request" |
| | | "srm/model/common/response" |
| | |
| | | productServiceConn *grpc.ClientConn |
| | | ) |
| | | |
| | | //func InitProductServiceConn() { |
| | | // var err error |
| | | // productServiceConn, err = grpc.Dial(conf.Conf.GrpcServiceAddr.Aps, grpc.WithTransportCredentials(insecure.NewCredentials())) |
| | | // if err != nil { |
| | | // logx.Errorf("grpc dial product service error: %v", err.Error()) |
| | | // return |
| | | // } |
| | | //} |
| | | func InitProductServiceConn() { |
| | | var err error |
| | | productServiceConn, err = grpc.Dial(global.GVA_CONFIG.System.GrpcUrl, grpc.WithTransportCredentials(insecure.NewCredentials())) |
| | | if err != nil { |
| | | //logx.Errorf("grpc dial product service error: %v", err.Error()) |
| | | return |
| | | } |
| | | } |
| | | |
| | | func CloseProductServiceConn() { |
| | | if productServiceConn != nil { |
| | |
| | | |
| | | response.OkWithDetailed(response.PageResult{ |
| | | List: productList, |
| | | Total: 0, |
| | | Total: int64(len(productList)), |
| | | Page: pageInfo.Page, |
| | | PageSize: pageInfo.PageSize, |
| | | }, "获取成功", c) |
| | |
| | | aliyun-oss: |
| | | endpoint: yourEndpoint |
| | | access-key-id: yourAccessKeyId |
| | | access-key-secret: yourAccessKeySecret |
| | | bucket-name: yourBucketName |
| | | bucket-url: yourBucketUrl |
| | | base-path: yourBasePath |
| | | endpoint: yourEndpoint |
| | | access-key-id: yourAccessKeyId |
| | | access-key-secret: yourAccessKeySecret |
| | | bucket-name: yourBucketName |
| | | bucket-url: yourBucketUrl |
| | | base-path: yourBasePath |
| | | autocode: |
| | | server-model: /model/%s |
| | | server-router: /router/%s |
| | | server: /server |
| | | server-api: /api/v1/%s |
| | | server-plug: /plugin/%s |
| | | server-initialize: /initialize |
| | | root: D:\basic.com\gin-vue-admin |
| | | web-table: /view |
| | | web: /web/src |
| | | server-service: /service/%s |
| | | server-request: /model/%s/request/ |
| | | web-api: /api |
| | | web-form: /view |
| | | transfer-restart: true |
| | | server-model: /model/%s |
| | | server-router: /router/%s |
| | | server: /server |
| | | server-api: /api/v1/%s |
| | | server-plug: /plugin/%s |
| | | server-initialize: /initialize |
| | | root: D:\basic.com\gin-vue-admin |
| | | web-table: /view |
| | | web: /web/src |
| | | server-service: /service/%s |
| | | server-request: /model/%s/request/ |
| | | web-api: /api |
| | | web-form: /view |
| | | transfer-restart: true |
| | | aws-s3: |
| | | bucket: xxxxx-10005608 |
| | | region: ap-shanghai |
| | | endpoint: "" |
| | | secret-id: your-secret-id |
| | | secret-key: your-secret-key |
| | | base-url: https://gin.vue.admin |
| | | path-prefix: srm |
| | | s3-force-path-style: false |
| | | disable-ssl: false |
| | | bucket: xxxxx-10005608 |
| | | region: ap-shanghai |
| | | endpoint: "" |
| | | secret-id: your-secret-id |
| | | secret-key: your-secret-key |
| | | base-url: https://gin.vue.admin |
| | | path-prefix: srm |
| | | s3-force-path-style: false |
| | | disable-ssl: false |
| | | captcha: |
| | | key-long: 6 |
| | | img-width: 240 |
| | | img-height: 80 |
| | | open-captcha: 0 |
| | | open-captcha-timeout: 3600 |
| | | key-long: 6 |
| | | img-width: 240 |
| | | img-height: 80 |
| | | open-captcha: 0 |
| | | open-captcha-timeout: 3600 |
| | | cors: |
| | | mode: strict-whitelist |
| | | whitelist: |
| | | - allow-origin: example1.com |
| | | allow-methods: POST, GET |
| | | allow-headers: Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id |
| | | expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type |
| | | allow-credentials: true |
| | | - allow-origin: example2.com |
| | | allow-methods: GET, POST |
| | | allow-headers: content-type |
| | | expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type |
| | | allow-credentials: true |
| | | mode: strict-whitelist |
| | | whitelist: |
| | | - allow-origin: example1.com |
| | | allow-methods: POST, GET |
| | | allow-headers: Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id |
| | | expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type |
| | | allow-credentials: true |
| | | - allow-origin: example2.com |
| | | allow-methods: GET, POST |
| | | allow-headers: content-type |
| | | expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type |
| | | allow-credentials: true |
| | | db-list: |
| | | - type: "" |
| | | alias-name: "" |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | disable: true |
| | | - type: "" |
| | | alias-name: "" |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | disable: true |
| | | email: |
| | | to: xxx@qq.com |
| | | from: xxx@163.com |
| | | host: smtp.163.com |
| | | secret: xxx |
| | | nickname: test |
| | | port: 465 |
| | | is-ssl: true |
| | | to: xxx@qq.com |
| | | from: xxx@163.com |
| | | host: smtp.163.com |
| | | secret: xxx |
| | | nickname: test |
| | | port: 465 |
| | | is-ssl: true |
| | | excel: |
| | | dir: ./resource/excel/ |
| | | dir: ./resource/excel/ |
| | | hua-wei-obs: |
| | | path: you-path |
| | | bucket: you-bucket |
| | | endpoint: you-endpoint |
| | | access-key: you-access-key |
| | | secret-key: you-secret-key |
| | | path: you-path |
| | | bucket: you-bucket |
| | | endpoint: you-endpoint |
| | | access-key: you-access-key |
| | | secret-key: you-secret-key |
| | | jwt: |
| | | signing-key: 3791a68f-f9e6-40db-8095-31877f22c9c7 |
| | | expires-time: 7d |
| | | buffer-time: 1d |
| | | issuer: qmPlus |
| | | signing-key: 3791a68f-f9e6-40db-8095-31877f22c9c7 |
| | | expires-time: 7d |
| | | buffer-time: 1d |
| | | issuer: qmPlus |
| | | local: |
| | | path: uploads/file |
| | | store-path: uploads/file |
| | | path: uploads/file |
| | | store-path: uploads/file |
| | | mssql: |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | mysql: |
| | | prefix: "" |
| | | port: "3306" |
| | | config: charset=utf8mb4&parseTime=True&loc=Local |
| | | db-name: aps_srm |
| | | username: root |
| | | password: c++java123 |
| | | path: 192.168.20.119 |
| | | engine: "" |
| | | log-mode: error |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | prefix: "" |
| | | port: "3306" |
| | | config: charset=utf8mb4&parseTime=True&loc=Local |
| | | db-name: aps_srm |
| | | username: root |
| | | password: c++java123 |
| | | path: 192.168.20.119 |
| | | engine: "" |
| | | log-mode: error |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | oracle: |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | pgsql: |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | qiniu: |
| | | zone: ZoneHuaDong |
| | | bucket: "" |
| | | img-path: "" |
| | | access-key: "" |
| | | secret-key: "" |
| | | use-https: false |
| | | use-cdn-domains: false |
| | | zone: ZoneHuaDong |
| | | bucket: "" |
| | | img-path: "" |
| | | access-key: "" |
| | | secret-key: "" |
| | | use-https: false |
| | | use-cdn-domains: false |
| | | redis: |
| | | addr: 127.0.0.1:6379 |
| | | password: "" |
| | | db: 0 |
| | | addr: 127.0.0.1:6379 |
| | | password: "" |
| | | db: 0 |
| | | sqlite: |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | prefix: "" |
| | | port: "" |
| | | config: "" |
| | | db-name: "" |
| | | username: "" |
| | | password: "" |
| | | path: "" |
| | | engine: "" |
| | | log-mode: "" |
| | | max-idle-conns: 10 |
| | | max-open-conns: 100 |
| | | singular: false |
| | | log-zap: false |
| | | system: |
| | | env: public |
| | | db-type: mysql |
| | | oss-type: local |
| | | router-prefix: "/api" |
| | | addr: 8889 |
| | | iplimit-count: 15000 |
| | | iplimit-time: 3600 |
| | | use-multipoint: false |
| | | use-redis: false |
| | | env: public |
| | | db-type: mysql |
| | | oss-type: local |
| | | router-prefix: "/api" |
| | | addr: 8889 |
| | | iplimit-count: 15000 |
| | | iplimit-time: 3600 |
| | | use-multipoint: false |
| | | use-redis: false |
| | | grpc-url: 192.168.20.119:9091 |
| | | tencent-cos: |
| | | bucket: xxxxx-10005608 |
| | | region: ap-shanghai |
| | | secret-id: your-secret-id |
| | | secret-key: your-secret-key |
| | | base-url: https://gin.vue.admin |
| | | path-prefix: srm |
| | | bucket: xxxxx-10005608 |
| | | region: ap-shanghai |
| | | secret-id: your-secret-id |
| | | secret-key: your-secret-key |
| | | base-url: https://gin.vue.admin |
| | | path-prefix: srm |
| | | timer: |
| | | spec: '@daily' |
| | | detail: |
| | | - tableName: sys_operation_records |
| | | compareField: created_at |
| | | interval: 2160h |
| | | - tableName: jwt_blacklists |
| | | compareField: created_at |
| | | interval: 168h |
| | | start: true |
| | | with_seconds: false |
| | | spec: '@daily' |
| | | detail: |
| | | - tableName: sys_operation_records |
| | | compareField: created_at |
| | | interval: 2160h |
| | | - tableName: jwt_blacklists |
| | | compareField: created_at |
| | | interval: 168h |
| | | start: true |
| | | with_seconds: false |
| | | zap: |
| | | level: info |
| | | prefix: '[srm]' |
| | | format: console |
| | | director: log |
| | | encode-level: LowercaseColorLevelEncoder |
| | | stacktrace-key: stacktrace |
| | | max-age: 0 |
| | | show-line: true |
| | | log-in-console: true |
| | | level: info |
| | | prefix: '[srm]' |
| | | format: console |
| | | director: log |
| | | encode-level: LowercaseColorLevelEncoder |
| | | stacktrace-key: stacktrace |
| | | max-age: 0 |
| | | show-line: true |
| | | log-in-console: true |
| | |
| | | LimitTimeIP int `mapstructure:"iplimit-time" json:"iplimit-time" yaml:"iplimit-time"` |
| | | UseMultipoint bool `mapstructure:"use-multipoint" json:"use-multipoint" yaml:"use-multipoint"` // 多点登录拦截 |
| | | UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis"` // 使用redis |
| | | GrpcUrl string `mapstructure:"grpc-url" json:"grpc-url" yaml:"grpc-url"` // grpc服务地址 |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/p/getProductListFromGrpc": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Product" |
| | | ], |
| | | "summary": "分页获取Product列表", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | | "name": "deliveryTime", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "endCreatedAt", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "关键字", |
| | | "name": "keyword", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "maximumStock", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "minimumStock", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "name", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "number", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "每页大小", |
| | | "name": "pageSize", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "productType", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "number", |
| | | "name": "purchasePrice", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "remark", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "shippingDuration", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "startCreatedAt", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "unit", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/p/updateProduct": { |
| | | "put": { |
| | | "security": [ |
| | |
| | | "description": "环境值", |
| | | "type": "string" |
| | | }, |
| | | "grpc-url": { |
| | | "description": "grpc服务地址", |
| | | "type": "string" |
| | | }, |
| | | "iplimit-count": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/p/getProductListFromGrpc": { |
| | | "get": { |
| | | "security": [ |
| | | { |
| | | "ApiKeyAuth": [] |
| | | } |
| | | ], |
| | | "consumes": [ |
| | | "application/json" |
| | | ], |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Product" |
| | | ], |
| | | "summary": "分页获取Product列表", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | | "name": "deliveryTime", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "endCreatedAt", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "主键ID", |
| | | "name": "id", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "关键字", |
| | | "name": "keyword", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "maximumStock", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "minimumStock", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "name", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "number", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "每页大小", |
| | | "name": "pageSize", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "productType", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "number", |
| | | "name": "purchasePrice", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "remark", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "name": "shippingDuration", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "startCreatedAt", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "unit", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", |
| | | "schema": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/p/updateProduct": { |
| | | "put": { |
| | | "security": [ |
| | |
| | | "description": "环境值", |
| | | "type": "string" |
| | | }, |
| | | "grpc-url": { |
| | | "description": "grpc服务地址", |
| | | "type": "string" |
| | | }, |
| | | "iplimit-count": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | env: |
| | | description: 环境值 |
| | | type: string |
| | | grpc-url: |
| | | description: grpc服务地址 |
| | | type: string |
| | | iplimit-count: |
| | | type: integer |
| | | iplimit-time: |
| | |
| | | summary: 分页获取Product列表 |
| | | tags: |
| | | - Product |
| | | /p/getProductListFromGrpc: |
| | | get: |
| | | consumes: |
| | | - application/json |
| | | parameters: |
| | | - in: query |
| | | name: deliveryTime |
| | | type: integer |
| | | - in: query |
| | | name: endCreatedAt |
| | | type: string |
| | | - description: 主键ID |
| | | in: query |
| | | name: id |
| | | type: integer |
| | | - description: 关键字 |
| | | in: query |
| | | name: keyword |
| | | type: string |
| | | - in: query |
| | | name: maximumStock |
| | | type: integer |
| | | - in: query |
| | | name: minimumStock |
| | | type: integer |
| | | - in: query |
| | | name: name |
| | | type: string |
| | | - in: query |
| | | name: number |
| | | type: string |
| | | - description: 页码 |
| | | in: query |
| | | name: page |
| | | type: integer |
| | | - description: 每页大小 |
| | | in: query |
| | | name: pageSize |
| | | type: integer |
| | | - in: query |
| | | name: productType |
| | | type: string |
| | | - in: query |
| | | name: purchasePrice |
| | | type: number |
| | | - in: query |
| | | name: remark |
| | | type: string |
| | | - in: query |
| | | name: shippingDuration |
| | | type: integer |
| | | - in: query |
| | | name: startCreatedAt |
| | | type: string |
| | | - in: query |
| | | name: unit |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: '{"success":true,"data":{},"msg":"获取成功"}' |
| | | schema: |
| | | type: string |
| | | security: |
| | | - ApiKeyAuth: [] |
| | | summary: 分页获取Product列表 |
| | | tags: |
| | | - Product |
| | | /p/updateProduct: |
| | | put: |
| | | consumes: |
| | |
| | | [srm]2023/08/26 - 13:44:25.708 [34minfo[0m D:/basic.com/srm/initialize/router.go:37 register swagger handler |
| | | [srm]2023/08/26 - 13:44:25.729 [34minfo[0m D:/basic.com/srm/initialize/router.go:83 router register success |
| | | [srm]2023/08/26 - 13:44:25.742 [34minfo[0m D:/basic.com/srm/core/server.go:36 server run success on {"address": ":8889"} |
| | | [srm]2023/08/26 - 15:04:13.291 [34minfo[0m D:/basic.com/srm/initialize/gorm.go:60 register table success |
| | | [srm]2023/08/26 - 15:04:13.295 [34minfo[0m D:/basic.com/srm/initialize/router.go:37 register swagger handler |
| | | [srm]2023/08/26 - 15:04:13.312 [34minfo[0m D:/basic.com/srm/initialize/router.go:83 router register success |
| | | [srm]2023/08/26 - 15:04:13.324 [34minfo[0m D:/basic.com/srm/core/server.go:36 server run success on {"address": ":8889"} |
| | |
| | | |
| | | import ( |
| | | "go.uber.org/zap" |
| | | "srm/api/v1/test" |
| | | |
| | | "srm/core" |
| | | "srm/global" |
| | |
| | | db, _ := global.GVA_DB.DB() |
| | | defer db.Close() |
| | | } |
| | | |
| | | go test.InitProductServiceConn() |
| | | |
| | | core.RunWindowsServer() |
| | | } |
| | |
| | | pRouter.PUT("updateProduct", pApi.UpdateProduct) // 更新Product |
| | | } |
| | | { |
| | | pRouterWithoutRecord.GET("findProduct", pApi.FindProduct) // 根据ID获取Product |
| | | pRouterWithoutRecord.GET("getProductList", pApi.GetProductList) // 获取Product列表 |
| | | pRouterWithoutRecord.GET("findProduct", pApi.FindProduct) // 根据ID获取Product |
| | | pRouterWithoutRecord.GET("getProductList", pApi.GetProductList) // 获取Product列表 |
| | | pRouterWithoutRecord.GET("getProductListFromGrpc", pApi.GetProductListFromGrpc) // 通过grpc获取Product列表 |
| | | } |
| | | } |