diff --git a/.gitignore b/.gitignore index 5b97400..cf862d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig -# Created by https://www.toptal.com/developers/gitignore/api/go,macos,visualstudiocode -# Edit at https://www.toptal.com/developers/gitignore?templates=go,macos,visualstudiocode +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,linux,go,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,linux,go,macos ### Go ### # If you prefer the allow list template instead of the deny list, see community template: @@ -25,6 +25,21 @@ # Go workspace file go.work +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + ### macOS ### # General .DS_Store @@ -77,16 +92,9 @@ Temporary Items .history .ionide -# End of https://www.toptal.com/developers/gitignore/api/go,macos,visualstudiocode +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,linux,go,macos # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) -# MySQL data directory (contains binaries, certs, and runtime state) +# Local runtime data and certificates data/ - -# Environment and secrets -.env -.env.* -*.pem -deploy/bin/ -worker/graphsync/go.sum diff --git a/deploy/Dockerfile.gateway b/deploy/Dockerfile.gateway index 22aae9e..d2f88be 100644 --- a/deploy/Dockerfile.gateway +++ b/deploy/Dockerfile.gateway @@ -11,5 +11,6 @@ RUN apk add --no-cache ca-certificates tzdata WORKDIR /app COPY --from=builder /server ./gateway COPY deploy/etc/gateway.yaml etc/gateway.yaml +COPY deploy/tools/ tools/ EXPOSE 8888 CMD ["./gateway", "-f", "etc/gateway.yaml"] diff --git a/deploy/docker-compose.yaml b/deploy/docker-compose.yaml index 33d00c1..894cc70 100644 --- a/deploy/docker-compose.yaml +++ b/deploy/docker-compose.yaml @@ -62,10 +62,10 @@ services: - --name=default - --data-dir=/etcd-data - --listen-client-urls=http://0.0.0.0:2379 - - --advertise-client-urls=http://etcd:2379 + - --advertise-client-urls=http://127.0.0.1:2379 - --listen-peer-urls=http://0.0.0.0:2380 - - --initial-advertise-peer-urls=http://etcd:2380 - - --initial-cluster=default=http://etcd:2380 + - --initial-advertise-peer-urls=http://127.0.0.1:2380 + - --initial-cluster=default=http://127.0.0.1:2380 - --initial-cluster-state=new ports: - "2379:2379" diff --git a/deploy/etc/gateway.yaml b/deploy/etc/gateway.yaml index 4f4565f..ae837a0 100644 --- a/deploy/etc/gateway.yaml +++ b/deploy/etc/gateway.yaml @@ -1,6 +1,7 @@ Name: gateway-api Host: 0.0.0.0 Port: 8888 +Timeout: 120000 Auth: AccessSecret: muyu-wms-jwt-secret-key-2026 @@ -23,6 +24,7 @@ InventoryRpc: - etcd:2379 Key: inventory.rpc NonBlock: true + Timeout: 60000 Log: ServiceName: gateway-api diff --git a/deploy/mysql/init.sql b/deploy/mysql/init.sql index 5ff5118..1274625 100644 --- a/deploy/mysql/init.sql +++ b/deploy/mysql/init.sql @@ -334,27 +334,27 @@ CREATE TABLE `casbin_rule` ( -- ==================== Initial Data ==================== -- Default admin user (password: admin123, bcrypt hashed) -INSERT INTO `sys_user` (`user_id`, `username`, `password`, `salt`, `real_name`, `status`) +INSERT IGNORE INTO `sys_user` (`user_id`, `username`, `password`, `salt`, `real_name`, `status`) VALUES ('u_admin_001', 'admin', '$2a$10$S5XPWRXUnexAt9KJw2CefeHMa6aude7j5dm5qgWM1YMQAAwRgsGXa', 'bcrypt', 'System Admin', 1); -- Default tenant and mapping -INSERT INTO `crm_tenant` (`tenant_id`, `tenant_name`, `tenant_code`, `status`) +INSERT IGNORE INTO `crm_tenant` (`tenant_id`, `tenant_name`, `tenant_code`, `status`) VALUES ('t_default_001', '默认租户', 'DEFAULT', 1); -INSERT INTO `crm_tenant_user` (`tenant_user_id`, `tenant_id`, `user_id`, `is_primary`, `status`) +INSERT IGNORE INTO `crm_tenant_user` (`tenant_user_id`, `tenant_id`, `user_id`, `is_primary`, `status`) VALUES ('tu_001', 't_default_001', 'u_admin_001', 1, 1); -- Default roles -INSERT INTO `sys_role` (`role_id`, `role_name`, `role_key`, `role_desc`, `sort_order`, `status`) VALUES +INSERT IGNORE INTO `sys_role` (`role_id`, `role_name`, `role_key`, `role_desc`, `sort_order`, `status`) VALUES ('r_001', '系统管理员', 'admin', 'Full system access', 1, 1), ('r_002', '仓库管理员', 'warehouse', 'Warehouse management access', 2, 1), ('r_003', '普通用户', 'user', 'Basic read access', 3, 1); -- Assign admin role to admin user -INSERT INTO `sys_user_role` (`user_id`, `role_id`) VALUES ('u_admin_001', 'r_001'); +INSERT IGNORE INTO `sys_user_role` (`user_id`, `role_id`) VALUES ('u_admin_001', 'r_001'); -- Default menus -INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `menu_name`, `menu_type`, `path`, `component`, `permission`, `icon`, `sort_order`, `visible`, `status`) VALUES +INSERT IGNORE INTO `sys_menu` (`menu_id`, `parent_id`, `menu_name`, `menu_type`, `path`, `component`, `permission`, `icon`, `sort_order`, `visible`, `status`) VALUES -- Dashboard ('m_001', '', '首页', 1, '/dashboard', './Dashboard', '', 'DashboardOutlined', 1, 1, 1), -- System Management @@ -374,26 +374,26 @@ INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `menu_name`, `menu_type`, `path` ('m_206', 'm_200', 'Excel导入', 2, '/inventory/import', './Inventory/Import', 'inventory:import:exec', 'ImportOutlined', 6, 1, 1); -- CRM menus -INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `menu_name`, `menu_type`, `path`, `component`, `permission`, `icon`, `sort_order`, `visible`, `status`) VALUES +INSERT IGNORE INTO `sys_menu` (`menu_id`, `parent_id`, `menu_name`, `menu_type`, `path`, `component`, `permission`, `icon`, `sort_order`, `visible`, `status`) VALUES ('m_300', '', '客户关系', 1, '/crm', '', '', 'NodeIndexOutlined', 300, 1, 1), ('m_301', 'm_300', '上下游关系', 2, '/crm/relations', './CRM/Relations', 'crm:relation:list', 'ApartmentOutlined', 1, 1, 1); -- Assign all menus to admin role -INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) +INSERT IGNORE INTO `sys_role_menu` (`role_id`, `menu_id`) SELECT 'r_001', `menu_id` FROM `sys_menu`; -- Assign inventory menus to warehouse role -INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES +INSERT IGNORE INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES ('r_002', 'm_001'), ('r_002', 'm_200'), ('r_002', 'm_201'), ('r_002', 'm_202'), ('r_002', 'm_203'), ('r_002', 'm_204'), ('r_002', 'm_205'), ('r_002', 'm_206'); -- Assign CRM menus to admin role -INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES +INSERT IGNORE INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES ('r_001', 'm_300'), ('r_001', 'm_301'); -- Default Casbin policies -INSERT INTO `casbin_rule` (`ptype`, `v0`, `v1`, `v2`) VALUES +INSERT IGNORE INTO `casbin_rule` (`ptype`, `v0`, `v1`, `v2`) VALUES ('p', 'admin', '/api/v1/*', '*'), ('p', 'warehouse', '/api/v1/auth/*', '*'), ('p', 'warehouse', '/api/v1/inventory/*', '*'), @@ -404,7 +404,7 @@ INSERT INTO `casbin_rule` (`ptype`, `v0`, `v1`, `v2`) VALUES ('p', 'user', '/api/v1/inventory/stocks/*', 'GET'); -- Default system configs -INSERT INTO `sys_config` (`config_id`, `config_key`, `config_value`, `config_name`, `config_group`, `remark`) VALUES +INSERT IGNORE INTO `sys_config` (`config_id`, `config_key`, `config_value`, `config_name`, `config_group`, `remark`) VALUES ('c_001', 'sys_name', 'muyuqingfeng仓储管理系统', 'System Name', 'basic', 'System display name'), ('c_002', 'sys_logo', '', 'System Logo', 'basic', 'System logo URL'), ('c_003', 'upload_max_size', '10', 'Upload Max Size (MB)', 'upload', 'Maximum file upload size'), diff --git a/deploy/mysql/migrations/20260403_add_pan_and_bolt.sql b/deploy/mysql/migrations/20260403_add_pan_and_bolt.sql new file mode 100644 index 0000000..c7be9a1 --- /dev/null +++ b/deploy/mysql/migrations/20260403_add_pan_and_bolt.sql @@ -0,0 +1,44 @@ +-- Three-layer inventory model: Product -> Pan(盘) -> Bolt(匹) + +-- Pan table: each row = one physical pan/roll, belongs to a product +CREATE TABLE IF NOT EXISTS `inv_product_pan` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `pan_id` VARCHAR(32) NOT NULL, + `product_id` VARCHAR(32) NOT NULL, + `name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT 'pan label: A, B, C...', + `position` VARCHAR(100) NOT NULL DEFAULT '' COMMENT 'physical location: Shanghai, Nanjing...', + `sort_order` INT NOT NULL DEFAULT 0, + `tenant_id` VARCHAR(32) NOT NULL DEFAULT '', + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_pan_id` (`pan_id`), + KEY `idx_product_id` (`product_id`), + KEY `idx_tenant_id` (`tenant_id`), + KEY `idx_position` (`position`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- Bolt table: each row = one physical bolt/piece, belongs to a pan +CREATE TABLE IF NOT EXISTS `inv_product_bolt` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `bolt_id` VARCHAR(32) NOT NULL, + `pan_id` VARCHAR(32) NOT NULL COMMENT 'FK to inv_product_pan', + `length_m` DECIMAL(10,2) NOT NULL DEFAULT 0.00 COMMENT 'length in meters', + `sort_order` INT NOT NULL DEFAULT 0, + `tenant_id` VARCHAR(32) NOT NULL DEFAULT '', + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_bolt_id` (`bolt_id`), + KEY `idx_pan_id` (`pan_id`), + KEY `idx_tenant_id` (`tenant_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- Add composite index for product summary aggregation (panel 1) +-- Use PREPARE/EXECUTE to skip if index already exists (MySQL has no CREATE INDEX IF NOT EXISTS). +SET @ix = (SELECT COUNT(*) FROM information_schema.STATISTICS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'inv_product' AND INDEX_NAME = 'idx_product_name_tenant'); +SET @s = IF(@ix = 0, + 'ALTER TABLE `inv_product` ADD KEY `idx_product_name_tenant` (`product_name`, `tenant_id`)', + 'SELECT 1'); +PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; diff --git a/deploy/mysql/migrations/20260403_data_migration.sql b/deploy/mysql/migrations/20260403_data_migration.sql new file mode 100644 index 0000000..2ea4d51 --- /dev/null +++ b/deploy/mysql/migrations/20260403_data_migration.sql @@ -0,0 +1,65 @@ +-- Data migration: split existing inv_product flat data into pan + bolt records. +-- Run AFTER 20260403_add_pan_and_bolt.sql but BEFORE 20260403_drop_legacy_columns.sql. +-- Wrapped in a stored procedure so re-runs on an already-migrated database +-- (where `location` was already dropped) silently succeed rather than error. +-- MySQL validates column names at call time, not at CREATE PROCEDURE time, +-- so the IF guard prevents the INSERTs from running when the column is absent. + +DROP PROCEDURE IF EXISTS _migrate_inv_pan_bolt; + +DELIMITER $$ +CREATE PROCEDURE _migrate_inv_pan_bolt() +BEGIN + DECLARE v_has_location TINYINT DEFAULT 0; + SELECT COUNT(*) INTO v_has_location + FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = 'inv_product' + AND COLUMN_NAME = 'location'; + + IF v_has_location = 1 THEN + -- Step 1: one default pan per product, position taken from legacy `location` + INSERT INTO inv_product_pan (pan_id, product_id, name, position, sort_order, tenant_id) + SELECT + CONCAT('pan_mig_', product_id), + product_id, + 'A', + COALESCE(location, ''), + 1, + COALESCE(tenant_id, '') + FROM inv_product + WHERE deleted_at IS NULL + AND product_id NOT IN (SELECT DISTINCT product_id FROM inv_product_pan); + + -- Step 2: bolt records, one per unit_piece (or one if unit_pieces = 0) + INSERT INTO inv_product_bolt (bolt_id, pan_id, length_m, sort_order, tenant_id) + SELECT + CONCAT('bolt_mig_', product_id, '_', seq.n), + CONCAT('pan_mig_', product_id), + CASE + WHEN unit_pieces > 0 THEN ROUND(stock_quantity / unit_pieces, 2) + ELSE stock_quantity + END, + seq.n, + COALESCE(tenant_id, '') + FROM inv_product + CROSS JOIN ( + SELECT 1 AS n UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 + UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 + UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15 + UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL SELECT 19 UNION ALL SELECT 20 + ) seq + WHERE deleted_at IS NULL + AND stock_quantity > 0 + AND seq.n <= GREATEST(unit_pieces, 1) + AND CONCAT('pan_mig_', product_id) IN (SELECT pan_id FROM inv_product_pan); + END IF; +END$$ +DELIMITER ; + +CALL _migrate_inv_pan_bolt(); +DROP PROCEDURE IF EXISTS _migrate_inv_pan_bolt; + +-- Verification queries (run manually to check) +-- SELECT COUNT(*) AS pan_count FROM inv_product_pan WHERE pan_id LIKE 'pan_mig_%'; +-- SELECT COUNT(*) AS bolt_count FROM inv_product_bolt WHERE bolt_id LIKE 'bolt_mig_%'; diff --git a/deploy/mysql/migrations/20260403_drop_legacy_columns.sql b/deploy/mysql/migrations/20260403_drop_legacy_columns.sql new file mode 100644 index 0000000..ad9b87b --- /dev/null +++ b/deploy/mysql/migrations/20260403_drop_legacy_columns.sql @@ -0,0 +1,26 @@ +-- Remove deprecated flat columns from inv_product. +-- Must run AFTER 20260403_data_migration.sql has migrated existing rows. +-- Uses PREPARE/EXECUTE to skip each column that was already dropped +-- (MySQL has no DROP COLUMN IF EXISTS; that is a MariaDB-only extension). + +SET @db = DATABASE(); + +SET @c = (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=@db AND TABLE_NAME='inv_product' AND COLUMN_NAME='unit_pieces'); +SET @s = IF(@c=1, 'ALTER TABLE `inv_product` DROP COLUMN `unit_pieces`', 'SELECT 1'); +PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; + +SET @c = (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=@db AND TABLE_NAME='inv_product' AND COLUMN_NAME='unit_rolls'); +SET @s = IF(@c=1, 'ALTER TABLE `inv_product` DROP COLUMN `unit_rolls`', 'SELECT 1'); +PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; + +SET @c = (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=@db AND TABLE_NAME='inv_product' AND COLUMN_NAME='stock_quantity'); +SET @s = IF(@c=1, 'ALTER TABLE `inv_product` DROP COLUMN `stock_quantity`', 'SELECT 1'); +PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; + +SET @c = (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=@db AND TABLE_NAME='inv_product' AND COLUMN_NAME='location'); +SET @s = IF(@c=1, 'ALTER TABLE `inv_product` DROP COLUMN `location`', 'SELECT 1'); +PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; + +SET @c = (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=@db AND TABLE_NAME='inv_product' AND COLUMN_NAME='cost_price'); +SET @s = IF(@c=1, 'ALTER TABLE `inv_product` DROP COLUMN `cost_price`', 'SELECT 1'); +PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; diff --git a/deploy/mysql/migrations/20260407_fix_menu_mojibake.sql b/deploy/mysql/migrations/20260407_fix_menu_mojibake.sql new file mode 100644 index 0000000..500e52a --- /dev/null +++ b/deploy/mysql/migrations/20260407_fix_menu_mojibake.sql @@ -0,0 +1,9 @@ +-- Fix double-encoded (CP1252→UTF-8) menu_name for pans/bolts entries +-- Root cause: these records were inserted through a connection that +-- misinterpreted UTF-8 bytes as CP1252, causing mojibake. + +SET NAMES utf8mb4; +USE `muyu_wms`; + +UPDATE `sys_menu` SET `menu_name` = '盘库存' WHERE `menu_id` = 'm_207' AND `path` = '/inventory/pans'; +UPDATE `sys_menu` SET `menu_name` = '匹库存' WHERE `menu_id` = 'm_208' AND `path` = '/inventory/bolts'; diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf index 0382cb5..64b90eb 100644 --- a/deploy/nginx/nginx.conf +++ b/deploy/nginx/nginx.conf @@ -11,6 +11,9 @@ server { try_files $uri $uri/ /index.html; } + # Allow large file uploads (e.g. Excel imports up to 100MB) + client_max_body_size 100m; + # API proxy location /api/ { # Use Docker DNS dynamic resolution to avoid stale container IP after recreate. @@ -29,7 +32,15 @@ server { add_header Cache-Control "public, immutable"; } - # Static assets cache + # Do not aggressively cache entry bundles because file names are stable + # (for example umi.js / umi.css) and stale cache can cause a blank page + # after deployment updates. + location ~* ^/(umi\.js|umi\.css|preload_helper\.js)$ { + expires -1; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + } + + # Cache other static assets that are typically fingerprinted/chunked. location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 30d; add_header Cache-Control "public, immutable"; diff --git a/deploy/tools/package-lock.json b/deploy/tools/package-lock.json new file mode 100644 index 0000000..f65c7f2 --- /dev/null +++ b/deploy/tools/package-lock.json @@ -0,0 +1,119 @@ +{ + "name": "tools", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "tools", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "xlsx": "^0.18.5" + } + }, + "node_modules/adler-32": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", + "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cfb": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz", + "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", + "license": "Apache-2.0", + "dependencies": { + "adler-32": "~1.3.0", + "crc-32": "~1.2.0" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/codepage": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz", + "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/frac": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", + "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ssf": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz", + "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", + "license": "Apache-2.0", + "dependencies": { + "frac": "~1.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/wmf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", + "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/word": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz", + "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/xlsx": { + "version": "0.18.5", + "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz", + "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", + "license": "Apache-2.0", + "dependencies": { + "adler-32": "~1.3.0", + "cfb": "~1.2.1", + "codepage": "~1.15.0", + "crc-32": "~1.2.1", + "ssf": "~0.11.2", + "wmf": "~1.0.1", + "word": "~0.3.0" + }, + "bin": { + "xlsx": "bin/xlsx.njs" + }, + "engines": { + "node": ">=0.8" + } + } + } +} diff --git a/deploy/tools/package.json b/deploy/tools/package.json new file mode 100644 index 0000000..306a7d6 --- /dev/null +++ b/deploy/tools/package.json @@ -0,0 +1,15 @@ +{ + "name": "tools", + "version": "1.0.0", + "main": "xls2json.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "xlsx": "^0.18.5" + } +} diff --git a/deploy/tools/xls2json.js b/deploy/tools/xls2json.js new file mode 100644 index 0000000..ee58308 --- /dev/null +++ b/deploy/tools/xls2json.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +// Converts .xls/.xlsx to JSON on stdout. +// Usage: node xls2json.js +const XLSX = require(__dirname + '/node_modules/xlsx'); +const path = require('path'); + +const file = process.argv[2]; +if (!file) { + process.stderr.write('usage: xls2json.js \n'); + process.exit(1); +} + +try { + const wb = XLSX.readFile(file); + const ws = wb.Sheets[wb.SheetNames[0]]; + const rows = XLSX.utils.sheet_to_json(ws, { header: 1, defval: '' }); + process.stdout.write(JSON.stringify(rows)); +} catch (e) { + process.stderr.write('xls2json error: ' + e.message + '\n'); + process.exit(2); +} diff --git a/gateway/etc/gateway-api.yaml b/gateway/etc/gateway-api.yaml index 2f154e5..ac9decd 100644 --- a/gateway/etc/gateway-api.yaml +++ b/gateway/etc/gateway-api.yaml @@ -8,3 +8,23 @@ Auth: DefaultTenantId: t_default_001 DataSource: root:muyu2026@tcp(127.0.0.1:3306)/muyu_wms?charset=utf8mb4&parseTime=true&loc=Asia%2FShanghai +PostgresDataSource: "postgres://muyu:muyu2026@127.0.0.1:5432/muyu_crm?sslmode=disable" + +SystemRpc: + Etcd: + Hosts: + - 127.0.0.1:2379 + Key: system.rpc + NonBlock: true + +InventoryRpc: + Etcd: + Hosts: + - 127.0.0.1:2379 + Key: inventory.rpc + NonBlock: true + +Log: + ServiceName: gateway-api + Mode: console + Level: info diff --git a/gateway/gateway.api b/gateway/gateway.api index 1ad15af..9084e0a 100644 --- a/gateway/gateway.api +++ b/gateway/gateway.api @@ -219,47 +219,33 @@ type ( // ==================== Product Types ==================== type ( ProductInfo { - ProductId string `json:"productId"` - ProductName string `json:"productName"` - ImageUrl string `json:"imageUrl"` - Spec string `json:"spec"` - Color string `json:"color"` - UnitPieces int64 `json:"unitPieces"` - UnitRolls int64 `json:"unitRolls"` - StockQuantity string `json:"stockQuantity"` - Location string `json:"location"` - CostPrice string `json:"costPrice"` - SalesPrice string `json:"salesPrice"` - Remark string `json:"remark"` - Status int64 `json:"status"` - CreatedAt string `json:"createdAt"` - UpdatedAt string `json:"updatedAt"` + ProductId string `json:"productId"` + ProductName string `json:"productName"` + ImageUrl string `json:"imageUrl"` + Spec string `json:"spec"` + Color string `json:"color"` + SalesPrice string `json:"salesPrice"` + Remark string `json:"remark"` + Status int64 `json:"status"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` } CreateProductReq { - ProductName string `json:"productName"` - ImageUrl string `json:"imageUrl,optional"` - Spec string `json:"spec,optional"` - Color string `json:"color,optional"` - UnitPieces int64 `json:"unitPieces,optional"` - UnitRolls int64 `json:"unitRolls,optional"` - StockQuantity string `json:"stockQuantity,optional"` - Location string `json:"location,optional"` - CostPrice string `json:"costPrice,optional"` - SalesPrice string `json:"salesPrice,optional"` - Remark string `json:"remark,optional"` + ProductName string `json:"productName"` + ImageUrl string `json:"imageUrl,optional"` + Spec string `json:"spec,optional"` + Color string `json:"color,optional"` + SalesPrice string `json:"salesPrice,optional"` + Remark string `json:"remark,optional"` + Pans []PanInput `json:"pans,optional"` } UpdateProductReq { - ProductName string `json:"productName,optional"` - ImageUrl string `json:"imageUrl,optional"` - Spec string `json:"spec,optional"` - Color string `json:"color,optional"` - UnitPieces int64 `json:"unitPieces,optional"` - UnitRolls int64 `json:"unitRolls,optional"` - StockQuantity string `json:"stockQuantity,optional"` - Location string `json:"location,optional"` - CostPrice string `json:"costPrice,optional"` - SalesPrice string `json:"salesPrice,optional"` - Remark string `json:"remark,optional"` + ProductName string `json:"productName,optional"` + ImageUrl string `json:"imageUrl,optional"` + Spec string `json:"spec,optional"` + Color string `json:"color,optional"` + SalesPrice string `json:"salesPrice,optional"` + Remark string `json:"remark,optional"` } ListProductReq { Page int64 `form:"page,default=1"` @@ -267,7 +253,6 @@ type ( ProductName string `form:"productName,optional"` Spec string `form:"spec,optional"` Color string `form:"color,optional"` - Location string `form:"location,optional"` Status int64 `form:"status,optional,default=-1"` } ListProductResp { @@ -283,13 +268,92 @@ type ( } ) +// ==================== Pan / Bolt Types ==================== +type ( + BoltInfo { + BoltId string `json:"boltId"` + PanId string `json:"panId"` + LengthM string `json:"lengthM"` + SortOrder int64 `json:"sortOrder"` + } + PanInfo { + PanId string `json:"panId"` + ProductId string `json:"productId"` + Name string `json:"name"` + Position string `json:"position"` + SortOrder int64 `json:"sortOrder"` + Bolts []BoltInfo `json:"bolts"` + BoltCount int64 `json:"boltCount"` + TotalLength string `json:"totalLength"` + } + PanInput { + Name string `json:"name"` + Position string `json:"position,optional"` + BoltLengths []string `json:"boltLengths,optional"` + } + ListPanResp { + List []PanInfo `json:"list"` + } + SavePansReq { + Pans []PanInput `json:"pans"` + } + ListBoltResp { + List []BoltInfo `json:"list"` + } + SaveBoltsReq { + Lengths []string `json:"lengths"` + } + ProductTreeResp { + Product ProductInfo `json:"product"` + Pans []PanInfo `json:"pans"` + TotalPanCount int64 `json:"totalPanCount"` + TotalBoltCount int64 `json:"totalBoltCount"` + TotalLengthM string `json:"totalLengthM"` + } +) + +// ==================== Panel Types ==================== +type ( + ProductSummaryItem { + ProductName string `json:"productName"` + Spec string `json:"spec"` + ColorCount int64 `json:"colorCount"` + TotalPanCount int64 `json:"totalPanCount"` + TotalBoltCount int64 `json:"totalBoltCount"` + TotalLengthM string `json:"totalLengthM"` + Colors string `json:"colors"` + Locations string `json:"locations"` + } + ProductSummaryResp { + List []ProductSummaryItem `json:"list"` + } + ColorDetailItem { + ProductId string `json:"productId"` + ProductName string `json:"productName"` + Color string `json:"color"` + Spec string `json:"spec"` + ImageUrl string `json:"imageUrl"` + PanCount int64 `json:"panCount"` + BoltCount int64 `json:"boltCount"` + TotalLengthM string `json:"totalLengthM"` + Locations string `json:"locations"` + SalesPrice string `json:"salesPrice"` + } + ListColorDetailReq { + ProductName string `form:"productName"` + } + ColorDetailResp { + List []ColorDetailItem `json:"list"` + } +) + // ==================== Stock Statistics Types ==================== type ( StockSummaryResp { ProductCount int64 `json:"productCount"` TotalPieces int64 `json:"totalPieces"` - TotalRolls int64 `json:"totalRolls"` - TotalCostValue string `json:"totalCostValue"` + TotalPans int64 `json:"totalPans"` + TotalLengthM string `json:"totalLengthM"` TotalSalesValue string `json:"totalSalesValue"` } StockGroupItem { @@ -644,6 +708,36 @@ service gateway-api { @handler ExportProductHandler get /products/export + + @handler GetProductSummaryHandler + get /products/summary returns (ProductSummaryResp) + + @handler GetColorDetailHandler + get /products/colors (ListColorDetailReq) returns (ColorDetailResp) + + @handler GetProductTreeHandler + get /products/:id/tree returns (ProductTreeResp) + + @handler ListPansHandler + get /products/:id/pans returns (ListPanResp) + + @handler SavePansHandler + put /products/:id/pans (SavePansReq) returns (IdResp) +} + +// Inventory - Pan/Bolt Management +@server ( + prefix: /api/v1/inventory + group: inventory/panbolt + jwt: Auth + middleware: AuthorityMiddleware +) +service gateway-api { + @handler ListBoltsHandler + get /pans/:id/bolts returns (ListBoltResp) + + @handler SaveBoltsHandler + put /pans/:id/bolts (SaveBoltsReq) returns (IdResp) } // Inventory - Stock Query & Statistics diff --git a/gateway/gateway.go b/gateway/gateway.go index 07b6af0..4079aed 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -50,7 +50,7 @@ func main() { if ok { return http.StatusOK, &Response{Code: int(s.Code()), Msg: s.Message()} } - return http.StatusOK, &Response{Code: 1001, Msg: err.Error()} + return http.StatusBadRequest, &Response{Code: 1001, Msg: err.Error()} }) httpx.SetOkHandler(func(ctx context.Context, a interface{}) interface{} { diff --git a/gateway/internal/handler/crm/relation/searchTenantsHandler.go b/gateway/internal/handler/crm/relation/searchTenantsHandler.go new file mode 100644 index 0000000..083f086 --- /dev/null +++ b/gateway/internal/handler/crm/relation/searchTenantsHandler.go @@ -0,0 +1,29 @@ +package relation + +import ( + "net/http" + "strconv" + + "muyu-apiserver/gateway/internal/svc" + + "github.com/zeromicro/go-zero/rest/httpx" +) + +func SearchTenantsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + keyword := r.URL.Query().Get("keyword") + limit, _ := strconv.Atoi(r.URL.Query().Get("limit")) + if limit <= 0 { + limit = 20 + } + + tenants, err := svcCtx.CrmRepo.SearchTenants(r.Context(), keyword, limit) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + httpx.OkJsonCtx(r.Context(), w, map[string]interface{}{ + "list": tenants, + }) + } +} diff --git a/gateway/internal/handler/inventory/panbolt/listBoltViewHandler.go b/gateway/internal/handler/inventory/panbolt/listBoltViewHandler.go new file mode 100644 index 0000000..c5ba416 --- /dev/null +++ b/gateway/internal/handler/inventory/panbolt/listBoltViewHandler.go @@ -0,0 +1,27 @@ +package panbolt + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + logic "muyu-apiserver/gateway/internal/logic/inventory/panbolt" + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" +) + +func ListBoltViewHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListBoltViewReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + l := logic.NewListBoltViewLogic(r.Context(), svcCtx) + resp, err := l.ListBoltView(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/inventory/panbolt/listBoltsHandler.go b/gateway/internal/handler/inventory/panbolt/listBoltsHandler.go new file mode 100644 index 0000000..9bb6cbc --- /dev/null +++ b/gateway/internal/handler/inventory/panbolt/listBoltsHandler.go @@ -0,0 +1,24 @@ +package panbolt + +import ( + "context" + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "github.com/zeromicro/go-zero/rest/pathvar" + logic "muyu-apiserver/gateway/internal/logic/inventory/panbolt" + "muyu-apiserver/gateway/internal/svc" +) + +func ListBoltsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), "pathId", pathvar.Vars(r)["id"]) + l := logic.NewListBoltsLogic(ctx, svcCtx) + resp, err := l.ListBolts() + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/inventory/panbolt/listPanViewHandler.go b/gateway/internal/handler/inventory/panbolt/listPanViewHandler.go new file mode 100644 index 0000000..3b2fcbd --- /dev/null +++ b/gateway/internal/handler/inventory/panbolt/listPanViewHandler.go @@ -0,0 +1,27 @@ +package panbolt + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + logic "muyu-apiserver/gateway/internal/logic/inventory/panbolt" + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" +) + +func ListPanViewHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListPanViewReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + l := logic.NewListPanViewLogic(r.Context(), svcCtx) + resp, err := l.ListPanView(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/inventory/panbolt/saveBoltsHandler.go b/gateway/internal/handler/inventory/panbolt/saveBoltsHandler.go new file mode 100644 index 0000000..f7ef6da --- /dev/null +++ b/gateway/internal/handler/inventory/panbolt/saveBoltsHandler.go @@ -0,0 +1,30 @@ +package panbolt + +import ( + "context" + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "github.com/zeromicro/go-zero/rest/pathvar" + logic "muyu-apiserver/gateway/internal/logic/inventory/panbolt" + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" +) + +func SaveBoltsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.SaveBoltsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + ctx := context.WithValue(r.Context(), "pathId", pathvar.Vars(r)["id"]) + l := logic.NewSaveBoltsLogic(ctx, svcCtx) + resp, err := l.SaveBolts(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/inventory/product/getColorDetailHandler.go b/gateway/internal/handler/inventory/product/getColorDetailHandler.go new file mode 100644 index 0000000..b37523f --- /dev/null +++ b/gateway/internal/handler/inventory/product/getColorDetailHandler.go @@ -0,0 +1,27 @@ +package product + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + logic "muyu-apiserver/gateway/internal/logic/inventory/product" + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" +) + +func GetColorDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListColorDetailReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + l := logic.NewGetColorDetailLogic(r.Context(), svcCtx) + resp, err := l.GetColorDetail(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/inventory/product/getProductSummaryHandler.go b/gateway/internal/handler/inventory/product/getProductSummaryHandler.go new file mode 100644 index 0000000..3b060fd --- /dev/null +++ b/gateway/internal/handler/inventory/product/getProductSummaryHandler.go @@ -0,0 +1,21 @@ +package product + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + logic "muyu-apiserver/gateway/internal/logic/inventory/product" + "muyu-apiserver/gateway/internal/svc" +) + +func GetProductSummaryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := logic.NewGetProductSummaryLogic(r.Context(), svcCtx) + resp, err := l.GetProductSummary() + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/inventory/product/getProductTreeHandler.go b/gateway/internal/handler/inventory/product/getProductTreeHandler.go new file mode 100644 index 0000000..2479e5c --- /dev/null +++ b/gateway/internal/handler/inventory/product/getProductTreeHandler.go @@ -0,0 +1,24 @@ +package product + +import ( + "context" + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "github.com/zeromicro/go-zero/rest/pathvar" + logic "muyu-apiserver/gateway/internal/logic/inventory/product" + "muyu-apiserver/gateway/internal/svc" +) + +func GetProductTreeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), "pathId", pathvar.Vars(r)["id"]) + l := logic.NewGetProductTreeLogic(ctx, svcCtx) + resp, err := l.GetProductTree() + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/inventory/product/importProductHandler.go b/gateway/internal/handler/inventory/product/importProductHandler.go index 812f99a..ae13e35 100644 --- a/gateway/internal/handler/inventory/product/importProductHandler.go +++ b/gateway/internal/handler/inventory/product/importProductHandler.go @@ -1,20 +1,46 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.9.2 - package product import ( + "io" "net/http" + "os" + "path/filepath" "github.com/zeromicro/go-zero/rest/httpx" "muyu-apiserver/gateway/internal/logic/inventory/product" "muyu-apiserver/gateway/internal/svc" ) +const maxUploadSize = 50 << 20 // 50 MB + func ImportProductHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { + r.Body = http.MaxBytesReader(w, r.Body, maxUploadSize) + + file, header, err := r.FormFile("file") + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + defer file.Close() + + ext := filepath.Ext(header.Filename) + tmpFile, err := os.CreateTemp("", "import-*"+ext) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + defer os.Remove(tmpFile.Name()) + defer tmpFile.Close() + + if _, err = io.Copy(tmpFile, file); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + tmpFile.Close() + l := product.NewImportProductLogic(r.Context(), svcCtx) - resp, err := l.ImportProduct() + resp, err := l.ImportProduct(tmpFile.Name(), header.Filename) if err != nil { httpx.ErrorCtx(r.Context(), w, err) } else { diff --git a/gateway/internal/handler/inventory/product/listPansHandler.go b/gateway/internal/handler/inventory/product/listPansHandler.go new file mode 100644 index 0000000..42b2132 --- /dev/null +++ b/gateway/internal/handler/inventory/product/listPansHandler.go @@ -0,0 +1,24 @@ +package product + +import ( + "context" + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "github.com/zeromicro/go-zero/rest/pathvar" + logic "muyu-apiserver/gateway/internal/logic/inventory/product" + "muyu-apiserver/gateway/internal/svc" +) + +func ListPansHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), "pathId", pathvar.Vars(r)["id"]) + l := logic.NewListPansLogic(ctx, svcCtx) + resp, err := l.ListPans() + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/inventory/product/savePansHandler.go b/gateway/internal/handler/inventory/product/savePansHandler.go new file mode 100644 index 0000000..bcd51fa --- /dev/null +++ b/gateway/internal/handler/inventory/product/savePansHandler.go @@ -0,0 +1,30 @@ +package product + +import ( + "context" + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "github.com/zeromicro/go-zero/rest/pathvar" + logic "muyu-apiserver/gateway/internal/logic/inventory/product" + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" +) + +func SavePansHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.SavePansReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + ctx := context.WithValue(r.Context(), "pathId", pathvar.Vars(r)["id"]) + l := logic.NewSavePansLogic(ctx, svcCtx) + resp, err := l.SavePans(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/gateway/internal/handler/routes.go b/gateway/internal/handler/routes.go index 2a2f0c8..68ac1b9 100644 --- a/gateway/internal/handler/routes.go +++ b/gateway/internal/handler/routes.go @@ -10,6 +10,7 @@ import ( crmrelation "muyu-apiserver/gateway/internal/handler/crm/relation" inventoryadjust "muyu-apiserver/gateway/internal/handler/inventory/adjust" inventorycheck "muyu-apiserver/gateway/internal/handler/inventory/check" + inventorypanbolt "muyu-apiserver/gateway/internal/handler/inventory/panbolt" inventoryproduct "muyu-apiserver/gateway/internal/handler/inventory/product" inventorystock "muyu-apiserver/gateway/internal/handler/inventory/stock" systemconfig "muyu-apiserver/gateway/internal/handler/system/config" @@ -34,6 +35,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { rest.WithPrefix("/api/v1/auth"), ) + server.AddRoutes( + []rest.Route{ + { + Method: http.MethodGet, + Path: "/tenants/search", + Handler: crmrelation.SearchTenantsHandler(serverCtx), + }, + }, + rest.WithPrefix("/api/v1/public"), + ) + server.AddRoutes( []rest.Route{ { @@ -175,6 +187,21 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/products", Handler: inventoryproduct.CreateProductHandler(serverCtx), }, + { + Method: http.MethodGet, + Path: "/products/summary", + Handler: inventoryproduct.GetProductSummaryHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/products/colors", + Handler: inventoryproduct.GetColorDetailHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/products/export", + Handler: inventoryproduct.ExportProductHandler(serverCtx), + }, { Method: http.MethodGet, Path: "/products/:id", @@ -192,9 +219,29 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { Method: http.MethodGet, - Path: "/products/export", - Handler: inventoryproduct.ExportProductHandler(serverCtx), + Path: "/products/:id/tree", + Handler: inventoryproduct.GetProductTreeHandler(serverCtx), }, + { + Method: http.MethodGet, + Path: "/products/:id/pans", + Handler: inventoryproduct.ListPansHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/products/:id/pans", + Handler: inventoryproduct.SavePansHandler(serverCtx), + }, + }..., + ), + rest.WithJwt(serverCtx.Config.Auth.AccessSecret), + rest.WithPrefix("/api/v1/inventory"), + ) + + server.AddRoutes( + rest.WithMiddlewares( + []rest.Middleware{serverCtx.AuthorityMiddleware}, + []rest.Route{ { Method: http.MethodPost, Path: "/products/import", @@ -204,6 +251,37 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { ), rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1/inventory"), + rest.WithMaxBytes(50<<20), + ) + + server.AddRoutes( + rest.WithMiddlewares( + []rest.Middleware{serverCtx.AuthorityMiddleware}, + []rest.Route{ + { + Method: http.MethodGet, + Path: "/pans", + Handler: inventorypanbolt.ListPanViewHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/bolts", + Handler: inventorypanbolt.ListBoltViewHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/pans/:id/bolts", + Handler: inventorypanbolt.ListBoltsHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/pans/:id/bolts", + Handler: inventorypanbolt.SaveBoltsHandler(serverCtx), + }, + }..., + ), + rest.WithJwt(serverCtx.Config.Auth.AccessSecret), + rest.WithPrefix("/api/v1/inventory"), ) server.AddRoutes( diff --git a/gateway/internal/logic/inventory/panbolt/listBoltViewLogic.go b/gateway/internal/logic/inventory/panbolt/listBoltViewLogic.go new file mode 100644 index 0000000..9bc9256 --- /dev/null +++ b/gateway/internal/logic/inventory/panbolt/listBoltViewLogic.go @@ -0,0 +1,53 @@ +package panbolt + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListBoltViewLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListBoltViewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListBoltViewLogic { + return &ListBoltViewLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListBoltViewLogic) ListBoltView(req *types.ListBoltViewReq) (resp *types.ListBoltViewResp, err error) { + rpcResp, err := l.svcCtx.InventoryRpc.ListBoltView(l.ctx, &pb.ListBoltViewReq{ + Page: req.Page, + PageSize: req.PageSize, + ProductName: req.ProductName, + Position: req.Position, + }) + if err != nil { + return nil, err + } + + list := make([]types.BoltListItem, 0, len(rpcResp.List)) + for _, item := range rpcResp.List { + list = append(list, types.BoltListItem{ + BoltId: item.BoltId, + PanId: item.PanId, + LengthM: item.LengthM, + Color: item.Color, + SortOrder: item.SortOrder, + PanName: item.PanName, + Position: item.Position, + ProductId: item.ProductId, + ProductName: item.ProductName, + }) + } + return &types.ListBoltViewResp{Total: rpcResp.Total, List: list}, nil +} diff --git a/gateway/internal/logic/inventory/panbolt/listBoltsLogic.go b/gateway/internal/logic/inventory/panbolt/listBoltsLogic.go new file mode 100644 index 0000000..7fb42ba --- /dev/null +++ b/gateway/internal/logic/inventory/panbolt/listBoltsLogic.go @@ -0,0 +1,44 @@ +package panbolt + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/pkg/ctxdata" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListBoltsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListBoltsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListBoltsLogic { + return &ListBoltsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListBoltsLogic) ListBolts() (resp *types.ListBoltResp, err error) { + panId := ctxdata.GetPathId(l.ctx) + rpcResp, err := l.svcCtx.InventoryRpc.ListBolts(l.ctx, &pb.ListBoltReq{PanId: panId}) + if err != nil { + return nil, err + } + list := make([]types.BoltInfo, 0, len(rpcResp.List)) + for _, b := range rpcResp.List { + list = append(list, types.BoltInfo{ + BoltId: b.BoltId, + PanId: b.PanId, + LengthM: b.LengthM, + SortOrder: b.SortOrder, + }) + } + return &types.ListBoltResp{List: list}, nil +} diff --git a/gateway/internal/logic/inventory/panbolt/listPanViewLogic.go b/gateway/internal/logic/inventory/panbolt/listPanViewLogic.go new file mode 100644 index 0000000..71cec33 --- /dev/null +++ b/gateway/internal/logic/inventory/panbolt/listPanViewLogic.go @@ -0,0 +1,52 @@ +package panbolt + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListPanViewLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListPanViewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListPanViewLogic { + return &ListPanViewLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListPanViewLogic) ListPanView(req *types.ListPanViewReq) (resp *types.ListPanViewResp, err error) { + rpcResp, err := l.svcCtx.InventoryRpc.ListPanView(l.ctx, &pb.ListPanViewReq{ + Page: req.Page, + PageSize: req.PageSize, + ProductName: req.ProductName, + Position: req.Position, + }) + if err != nil { + return nil, err + } + + list := make([]types.PanListItem, 0, len(rpcResp.List)) + for _, item := range rpcResp.List { + list = append(list, types.PanListItem{ + PanId: item.PanId, + ProductId: item.ProductId, + Name: item.Name, + Position: item.Position, + ProductName: item.ProductName, + Colors: item.Colors, + BoltCount: item.BoltCount, + TotalLengthM: item.TotalLengthM, + }) + } + return &types.ListPanViewResp{Total: rpcResp.Total, List: list}, nil +} diff --git a/gateway/internal/logic/inventory/panbolt/saveBoltsLogic.go b/gateway/internal/logic/inventory/panbolt/saveBoltsLogic.go new file mode 100644 index 0000000..954cda1 --- /dev/null +++ b/gateway/internal/logic/inventory/panbolt/saveBoltsLogic.go @@ -0,0 +1,38 @@ +package panbolt + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/pkg/ctxdata" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type SaveBoltsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewSaveBoltsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveBoltsLogic { + return &SaveBoltsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *SaveBoltsLogic) SaveBolts(req *types.SaveBoltsReq) (resp *types.IdResp, err error) { + panId := ctxdata.GetPathId(l.ctx) + _, err = l.svcCtx.InventoryRpc.SaveBolts(l.ctx, &pb.SaveBoltsReq{ + PanId: panId, + Lengths: req.Lengths, + }) + if err != nil { + return nil, err + } + return &types.IdResp{Id: panId}, nil +} diff --git a/gateway/internal/logic/inventory/product/createProductLogic.go b/gateway/internal/logic/inventory/product/createProductLogic.go index 386eda1..ea36d5a 100644 --- a/gateway/internal/logic/inventory/product/createProductLogic.go +++ b/gateway/internal/logic/inventory/product/createProductLogic.go @@ -26,17 +26,13 @@ func NewCreateProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cre func (l *CreateProductLogic) CreateProduct(req *types.CreateProductReq) (resp *types.IdResp, err error) { rpcResp, err := l.svcCtx.InventoryRpc.CreateProduct(l.ctx, &pb.CreateProductReq{ - ProductName: req.ProductName, - ImageUrl: req.ImageUrl, - Spec: req.Spec, - Color: req.Color, - UnitPieces: req.UnitPieces, - UnitRolls: req.UnitRolls, - StockQuantity: req.StockQuantity, - Location: req.Location, - CostPrice: req.CostPrice, - SalesPrice: req.SalesPrice, - Remark: req.Remark, + ProductName: req.ProductName, + ImageUrl: req.ImageUrl, + Spec: req.Spec, + Color: req.Color, + SalesPrice: req.SalesPrice, + Remark: req.Remark, + Pans: panInputsToPb(req.Pans), }) if err != nil { return nil, err @@ -44,3 +40,18 @@ func (l *CreateProductLogic) CreateProduct(req *types.CreateProductReq) (resp *t return &types.IdResp{Id: rpcResp.Id}, nil } + +func panInputsToPb(pans []types.PanInput) []*pb.PanInput { + if len(pans) == 0 { + return nil + } + out := make([]*pb.PanInput, 0, len(pans)) + for _, p := range pans { + out = append(out, &pb.PanInput{ + Name: p.Name, + Position: p.Position, + BoltLengths: p.BoltLengths, + }) + } + return out +} diff --git a/gateway/internal/logic/inventory/product/getColorDetailLogic.go b/gateway/internal/logic/inventory/product/getColorDetailLogic.go new file mode 100644 index 0000000..6c2e715 --- /dev/null +++ b/gateway/internal/logic/inventory/product/getColorDetailLogic.go @@ -0,0 +1,50 @@ +package product + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetColorDetailLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetColorDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetColorDetailLogic { + return &GetColorDetailLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *GetColorDetailLogic) GetColorDetail(req *types.ListColorDetailReq) (resp *types.ColorDetailResp, err error) { + rpcResp, err := l.svcCtx.InventoryRpc.ListColorDetail(l.ctx, &pb.ListColorDetailReq{ + ProductName: req.ProductName, + }) + if err != nil { + return nil, err + } + list := make([]types.ColorDetailItem, 0, len(rpcResp.List)) + for _, it := range rpcResp.List { + list = append(list, types.ColorDetailItem{ + ProductId: it.ProductId, + ProductName: it.ProductName, + Color: it.Color, + Spec: it.Spec, + ImageUrl: it.ImageUrl, + PanCount: it.PanCount, + BoltCount: it.BoltCount, + TotalLengthM: it.TotalLengthM, + Locations: it.Locations, + SalesPrice: it.SalesPrice, + }) + } + return &types.ColorDetailResp{List: list}, nil +} diff --git a/gateway/internal/logic/inventory/product/getProductLogic.go b/gateway/internal/logic/inventory/product/getProductLogic.go index b5dc0b9..307839b 100644 --- a/gateway/internal/logic/inventory/product/getProductLogic.go +++ b/gateway/internal/logic/inventory/product/getProductLogic.go @@ -35,21 +35,6 @@ func (l *GetProductLogic) GetProduct() (resp *types.ProductInfo, err error) { return nil, err } - return &types.ProductInfo{ - ProductId: rpcResp.ProductId, - ProductName: rpcResp.ProductName, - ImageUrl: rpcResp.ImageUrl, - Spec: rpcResp.Spec, - Color: rpcResp.Color, - UnitPieces: rpcResp.UnitPieces, - UnitRolls: rpcResp.UnitRolls, - StockQuantity: rpcResp.StockQuantity, - Location: rpcResp.Location, - CostPrice: rpcResp.CostPrice, - SalesPrice: rpcResp.SalesPrice, - Remark: rpcResp.Remark, - Status: rpcResp.Status, - CreatedAt: rpcResp.CreatedAt, - UpdatedAt: rpcResp.UpdatedAt, - }, nil + pi := productInfoFromPB(rpcResp) + return &pi, nil } diff --git a/gateway/internal/logic/inventory/product/getProductSummaryLogic.go b/gateway/internal/logic/inventory/product/getProductSummaryLogic.go new file mode 100644 index 0000000..37567bd --- /dev/null +++ b/gateway/internal/logic/inventory/product/getProductSummaryLogic.go @@ -0,0 +1,46 @@ +package product + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetProductSummaryLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetProductSummaryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductSummaryLogic { + return &GetProductSummaryLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *GetProductSummaryLogic) GetProductSummary() (resp *types.ProductSummaryResp, err error) { + rpcResp, err := l.svcCtx.InventoryRpc.ListProductSummary(l.ctx, &pb.ListProductSummaryReq{}) + if err != nil { + return nil, err + } + list := make([]types.ProductSummaryItem, 0, len(rpcResp.List)) + for _, it := range rpcResp.List { + list = append(list, types.ProductSummaryItem{ + ProductName: it.ProductName, + Spec: it.Spec, + ColorCount: it.ColorCount, + TotalPanCount: it.TotalPanCount, + TotalBoltCount: it.TotalBoltCount, + TotalLengthM: it.TotalLengthM, + Colors: it.Colors, + Locations: it.Locations, + }) + } + return &types.ProductSummaryResp{List: list}, nil +} diff --git a/gateway/internal/logic/inventory/product/getProductTreeLogic.go b/gateway/internal/logic/inventory/product/getProductTreeLogic.go new file mode 100644 index 0000000..7ad8bc7 --- /dev/null +++ b/gateway/internal/logic/inventory/product/getProductTreeLogic.go @@ -0,0 +1,47 @@ +package product + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/pkg/ctxdata" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetProductTreeLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetProductTreeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductTreeLogic { + return &GetProductTreeLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *GetProductTreeLogic) GetProductTree() (resp *types.ProductTreeResp, err error) { + id := ctxdata.GetPathId(l.ctx) + rpcResp, err := l.svcCtx.InventoryRpc.GetProductTree(l.ctx, &pb.GetProductReq{ + ProductId: id, + }) + if err != nil { + return nil, err + } + pans := make([]types.PanInfo, 0, len(rpcResp.Pans)) + for _, p := range rpcResp.Pans { + pans = append(pans, panInfoFromPB(p)) + } + return &types.ProductTreeResp{ + Product: productInfoFromPB(rpcResp.Product), + Pans: pans, + TotalPanCount: rpcResp.TotalPanCount, + TotalBoltCount: rpcResp.TotalBoltCount, + TotalLengthM: rpcResp.TotalLengthM, + }, nil +} diff --git a/gateway/internal/logic/inventory/product/importProductLogic.go b/gateway/internal/logic/inventory/product/importProductLogic.go index 18594fc..406ac0b 100644 --- a/gateway/internal/logic/inventory/product/importProductLogic.go +++ b/gateway/internal/logic/inventory/product/importProductLogic.go @@ -2,10 +2,13 @@ package product import ( "context" - "errors" + "fmt" + "strconv" "muyu-apiserver/gateway/internal/svc" "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/pkg/excelparse" + "muyu-apiserver/rpc/inventory/pb" "github.com/zeromicro/go-zero/core/logx" ) @@ -24,6 +27,50 @@ func NewImportProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Imp } } -func (l *ImportProductLogic) ImportProduct() (resp *types.ImportProductResp, err error) { - return nil, errors.New("import product requires file upload handling, will be implemented in handler layer") +func (l *ImportProductLogic) ImportProduct(filePath, fileName string) (resp *types.ImportProductResp, err error) { + result, err := excelparse.ParseFile(filePath) + if err != nil { + return nil, fmt.Errorf("解析Excel失败: %w", err) + } + + l.Infof("excel parsed: format=%s, products=%d, skipped=%d", + result.ParserName, len(result.Products), result.SkippedRows) + + products := make([]*pb.CreateProductReq, 0, len(result.Products)) + for _, p := range result.Products { + products = append(products, &pb.CreateProductReq{ + ProductName: p.ProductName, + Spec: p.Spec, + Color: p.Color, + SalesPrice: p.SalesPrice, + Remark: p.Remark, + }) + } + + rpcResp, err := l.svcCtx.InventoryRpc.ImportProducts(l.ctx, &pb.ImportProductReq{ + Products: products, + FileName: fileName + " (" + result.ParserName + "格式)", + Operator: operatorFromCtx(l.ctx), + }) + if err != nil { + return nil, err + } + + return &types.ImportProductResp{ + TotalCount: rpcResp.TotalCount, + SuccessCount: rpcResp.SuccessCount, + FailCount: rpcResp.FailCount, + ErrorMsg: rpcResp.ErrorMsg, + ImportId: rpcResp.ImportId, + }, nil +} + +func operatorFromCtx(ctx context.Context) string { + if uid, ok := ctx.Value("userId").(string); ok { + return uid + } + if uid, ok := ctx.Value("userId").(int64); ok { + return strconv.FormatInt(uid, 10) + } + return "system" } diff --git a/gateway/internal/logic/inventory/product/listPansLogic.go b/gateway/internal/logic/inventory/product/listPansLogic.go new file mode 100644 index 0000000..0426f48 --- /dev/null +++ b/gateway/internal/logic/inventory/product/listPansLogic.go @@ -0,0 +1,85 @@ +package product + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/pkg/ctxdata" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListPansLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListPansLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListPansLogic { + return &ListPansLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListPansLogic) ListPans() (resp *types.ListPanResp, err error) { + id := ctxdata.GetPathId(l.ctx) + rpcResp, err := l.svcCtx.InventoryRpc.ListPans(l.ctx, &pb.ListPanReq{ + ProductId: id, + }) + if err != nil { + return nil, err + } + list := make([]types.PanInfo, 0, len(rpcResp.List)) + for _, p := range rpcResp.List { + list = append(list, panInfoFromPB(p)) + } + return &types.ListPanResp{List: list}, nil +} + +func boltInfoFromPB(b *pb.BoltInfo) types.BoltInfo { + return types.BoltInfo{ + BoltId: b.BoltId, + PanId: b.PanId, + LengthM: b.LengthM, + SortOrder: b.SortOrder, + } +} + +func panInfoFromPB(p *pb.PanInfo) types.PanInfo { + bolts := make([]types.BoltInfo, 0, len(p.Bolts)) + for _, b := range p.Bolts { + bolts = append(bolts, boltInfoFromPB(b)) + } + return types.PanInfo{ + PanId: p.PanId, + ProductId: p.ProductId, + Name: p.Name, + Position: p.Position, + SortOrder: p.SortOrder, + Bolts: bolts, + BoltCount: p.BoltCount, + TotalLength: p.TotalLength, + } +} + +func productInfoFromPB(p *pb.ProductInfo) types.ProductInfo { + if p == nil { + return types.ProductInfo{} + } + return types.ProductInfo{ + ProductId: p.ProductId, + ProductName: p.ProductName, + ImageUrl: p.ImageUrl, + Spec: p.Spec, + Color: p.Color, + SalesPrice: p.SalesPrice, + Remark: p.Remark, + Status: p.Status, + CreatedAt: p.CreatedAt, + UpdatedAt: p.UpdatedAt, + } +} diff --git a/gateway/internal/logic/inventory/product/listProductLogic.go b/gateway/internal/logic/inventory/product/listProductLogic.go index 543244f..3ce85b7 100644 --- a/gateway/internal/logic/inventory/product/listProductLogic.go +++ b/gateway/internal/logic/inventory/product/listProductLogic.go @@ -31,7 +31,6 @@ func (l *ListProductLogic) ListProduct(req *types.ListProductReq) (resp *types.L ProductName: req.ProductName, Spec: req.Spec, Color: req.Color, - Location: req.Location, Status: req.Status, }) if err != nil { @@ -40,23 +39,7 @@ func (l *ListProductLogic) ListProduct(req *types.ListProductReq) (resp *types.L list := make([]types.ProductInfo, 0, len(rpcResp.List)) for _, p := range rpcResp.List { - list = append(list, types.ProductInfo{ - ProductId: p.ProductId, - ProductName: p.ProductName, - ImageUrl: p.ImageUrl, - Spec: p.Spec, - Color: p.Color, - UnitPieces: p.UnitPieces, - UnitRolls: p.UnitRolls, - StockQuantity: p.StockQuantity, - Location: p.Location, - CostPrice: p.CostPrice, - SalesPrice: p.SalesPrice, - Remark: p.Remark, - Status: p.Status, - CreatedAt: p.CreatedAt, - UpdatedAt: p.UpdatedAt, - }) + list = append(list, productInfoFromPB(p)) } return &types.ListProductResp{ diff --git a/gateway/internal/logic/inventory/product/savePansLogic.go b/gateway/internal/logic/inventory/product/savePansLogic.go new file mode 100644 index 0000000..6e11ab7 --- /dev/null +++ b/gateway/internal/logic/inventory/product/savePansLogic.go @@ -0,0 +1,38 @@ +package product + +import ( + "context" + + "muyu-apiserver/gateway/internal/svc" + "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/pkg/ctxdata" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type SavePansLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewSavePansLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SavePansLogic { + return &SavePansLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *SavePansLogic) SavePans(req *types.SavePansReq) (resp *types.IdResp, err error) { + id := ctxdata.GetPathId(l.ctx) + _, err = l.svcCtx.InventoryRpc.SavePans(l.ctx, &pb.SavePansReq{ + ProductId: id, + Pans: panInputsToPb(req.Pans), + }) + if err != nil { + return nil, err + } + return &types.IdResp{Id: id}, nil +} diff --git a/gateway/internal/logic/inventory/product/updateProductLogic.go b/gateway/internal/logic/inventory/product/updateProductLogic.go index 06f47fb..d5b4e59 100644 --- a/gateway/internal/logic/inventory/product/updateProductLogic.go +++ b/gateway/internal/logic/inventory/product/updateProductLogic.go @@ -29,18 +29,13 @@ func (l *UpdateProductLogic) UpdateProduct(req *types.UpdateProductReq) (resp *t id := ctxdata.GetPathId(l.ctx) _, err = l.svcCtx.InventoryRpc.UpdateProduct(l.ctx, &pb.UpdateProductReq{ - ProductId: id, - ProductName: req.ProductName, - ImageUrl: req.ImageUrl, - Spec: req.Spec, - Color: req.Color, - UnitPieces: req.UnitPieces, - UnitRolls: req.UnitRolls, - StockQuantity: req.StockQuantity, - Location: req.Location, - CostPrice: req.CostPrice, - SalesPrice: req.SalesPrice, - Remark: req.Remark, + ProductId: id, + ProductName: req.ProductName, + ImageUrl: req.ImageUrl, + Spec: req.Spec, + Color: req.Color, + SalesPrice: req.SalesPrice, + Remark: req.Remark, }) if err != nil { return nil, err diff --git a/gateway/internal/logic/inventory/stock/getStockSummaryLogic.go b/gateway/internal/logic/inventory/stock/getStockSummaryLogic.go index 0eb4cf0..842f5fc 100644 --- a/gateway/internal/logic/inventory/stock/getStockSummaryLogic.go +++ b/gateway/internal/logic/inventory/stock/getStockSummaryLogic.go @@ -33,8 +33,8 @@ func (l *GetStockSummaryLogic) GetStockSummary() (resp *types.StockSummaryResp, return &types.StockSummaryResp{ ProductCount: rpcResp.ProductCount, TotalPieces: rpcResp.TotalPieces, - TotalRolls: rpcResp.TotalRolls, - TotalCostValue: rpcResp.TotalCostValue, + TotalPans: rpcResp.TotalPans, + TotalLengthM: rpcResp.TotalLengthM, TotalSalesValue: rpcResp.TotalSalesValue, }, nil } diff --git a/gateway/internal/logic/inventory/stock/listStockLogic.go b/gateway/internal/logic/inventory/stock/listStockLogic.go index 5c46fde..e375a04 100644 --- a/gateway/internal/logic/inventory/stock/listStockLogic.go +++ b/gateway/internal/logic/inventory/stock/listStockLogic.go @@ -31,7 +31,6 @@ func (l *ListStockLogic) ListStock(req *types.ListProductReq) (resp *types.ListP ProductName: req.ProductName, Spec: req.Spec, Color: req.Color, - Location: req.Location, Status: req.Status, }) if err != nil { @@ -41,21 +40,16 @@ func (l *ListStockLogic) ListStock(req *types.ListProductReq) (resp *types.ListP list := make([]types.ProductInfo, 0, len(rpcResp.List)) for _, p := range rpcResp.List { list = append(list, types.ProductInfo{ - ProductId: p.ProductId, - ProductName: p.ProductName, - ImageUrl: p.ImageUrl, - Spec: p.Spec, - Color: p.Color, - UnitPieces: p.UnitPieces, - UnitRolls: p.UnitRolls, - StockQuantity: p.StockQuantity, - Location: p.Location, - CostPrice: p.CostPrice, - SalesPrice: p.SalesPrice, - Remark: p.Remark, - Status: p.Status, - CreatedAt: p.CreatedAt, - UpdatedAt: p.UpdatedAt, + ProductId: p.ProductId, + ProductName: p.ProductName, + ImageUrl: p.ImageUrl, + Spec: p.Spec, + Color: p.Color, + SalesPrice: p.SalesPrice, + Remark: p.Remark, + Status: p.Status, + CreatedAt: p.CreatedAt, + UpdatedAt: p.UpdatedAt, }) } diff --git a/gateway/internal/logic/system/user/createUserLogic.go b/gateway/internal/logic/system/user/createUserLogic.go index ec1d6b8..cc88972 100644 --- a/gateway/internal/logic/system/user/createUserLogic.go +++ b/gateway/internal/logic/system/user/createUserLogic.go @@ -5,6 +5,7 @@ import ( "muyu-apiserver/gateway/internal/svc" "muyu-apiserver/gateway/internal/types" + "muyu-apiserver/pkg/ctxdata" "muyu-apiserver/rpc/system/pb" "github.com/zeromicro/go-zero/core/logx" @@ -37,5 +38,9 @@ func (l *CreateUserLogic) CreateUser(req *types.CreateUserReq) (resp *types.IdRe return nil, err } + if tenantId := ctxdata.GetTenantId(l.ctx); tenantId != "" { + _ = l.svcCtx.CrmRepo.AddUserToTenant(l.ctx, rpcResp.Id, tenantId) + } + return &types.IdResp{Id: rpcResp.Id}, nil } diff --git a/gateway/internal/repo/crmrepo.go b/gateway/internal/repo/crmrepo.go index 23ca64f..8be63d9 100644 --- a/gateway/internal/repo/crmrepo.go +++ b/gateway/internal/repo/crmrepo.go @@ -63,6 +63,36 @@ func NewCrmRepo(conn sqlx.SqlConn) *CrmRepo { return &CrmRepo{conn: conn} } +func (r *CrmRepo) SearchTenants(ctx context.Context, keyword string, limit int) ([]GraphNode, error) { + if limit <= 0 || limit > 50 { + limit = 20 + } + nodes := make([]GraphNode, 0) + if keyword == "" { + if err := r.conn.QueryRowsCtx(ctx, &nodes, + "SELECT tenant_id, tenant_name FROM crm_tenant WHERE status = 1 ORDER BY tenant_name LIMIT $1", limit); err != nil { + return nil, err + } + } else { + if err := r.conn.QueryRowsCtx(ctx, &nodes, + "SELECT tenant_id, tenant_name FROM crm_tenant WHERE status = 1 AND tenant_name LIKE $1 ORDER BY tenant_name LIMIT $2", + "%"+keyword+"%", limit); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (r *CrmRepo) AddUserToTenant(ctx context.Context, userId, tenantId string) error { + _, err := r.conn.ExecCtx(ctx, + `INSERT INTO crm_tenant_user (user_id, tenant_id, is_primary, status) + VALUES ($1, $2, 1, 1) + ON CONFLICT (user_id, tenant_id) DO NOTHING`, + userId, tenantId, + ) + return err +} + func (r *CrmRepo) VerifyUserTenant(ctx context.Context, userId, tenantId string) (bool, error) { var count int64 err := r.conn.QueryRowCtx(ctx, &count, diff --git a/gateway/internal/types/types.go b/gateway/internal/types/types.go index 778e55a..3839246 100644 --- a/gateway/internal/types/types.go +++ b/gateway/internal/types/types.go @@ -34,17 +34,13 @@ type CreateMenuReq struct { } type CreateProductReq struct { - ProductName string `json:"productName"` - ImageUrl string `json:"imageUrl,optional"` - Spec string `json:"spec,optional"` - Color string `json:"color,optional"` - UnitPieces int64 `json:"unitPieces,optional"` - UnitRolls int64 `json:"unitRolls,optional"` - StockQuantity string `json:"stockQuantity,optional"` - Location string `json:"location,optional"` - CostPrice string `json:"costPrice,optional"` - SalesPrice string `json:"salesPrice,optional"` - Remark string `json:"remark,optional"` + ProductName string `json:"productName"` + ImageUrl string `json:"imageUrl,optional"` + Spec string `json:"spec,optional"` + Color string `json:"color,optional"` + SalesPrice string `json:"salesPrice,optional"` + Remark string `json:"remark,optional"` + Pans []PanInput `json:"pans,optional"` } type CreateRoleReq struct { @@ -118,7 +114,6 @@ type ListProductReq struct { ProductName string `form:"productName,optional"` Spec string `form:"spec,optional"` Color string `form:"color,optional"` - Location string `form:"location,optional"` Status int64 `form:"status,optional,default=-1"` } @@ -230,21 +225,147 @@ type PageReq struct { } type ProductInfo struct { - ProductId string `json:"productId"` - ProductName string `json:"productName"` - ImageUrl string `json:"imageUrl"` - Spec string `json:"spec"` - Color string `json:"color"` - UnitPieces int64 `json:"unitPieces"` - UnitRolls int64 `json:"unitRolls"` - StockQuantity string `json:"stockQuantity"` - Location string `json:"location"` - CostPrice string `json:"costPrice"` - SalesPrice string `json:"salesPrice"` - Remark string `json:"remark"` - Status int64 `json:"status"` - CreatedAt string `json:"createdAt"` - UpdatedAt string `json:"updatedAt"` + ProductId string `json:"productId"` + ProductName string `json:"productName"` + ImageUrl string `json:"imageUrl"` + Spec string `json:"spec"` + Color string `json:"color"` + SalesPrice string `json:"salesPrice"` + Remark string `json:"remark"` + Status int64 `json:"status"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +type BoltInfo struct { + BoltId string `json:"boltId"` + PanId string `json:"panId"` + LengthM string `json:"lengthM"` + SortOrder int64 `json:"sortOrder"` +} + +type PanInfo struct { + PanId string `json:"panId"` + ProductId string `json:"productId"` + Name string `json:"name"` + Position string `json:"position"` + SortOrder int64 `json:"sortOrder"` + Bolts []BoltInfo `json:"bolts"` + BoltCount int64 `json:"boltCount"` + TotalLength string `json:"totalLength"` +} + +type PanInput struct { + Name string `json:"name"` + Position string `json:"position,optional"` + BoltLengths []string `json:"boltLengths,optional"` +} + +type ListPanResp struct { + List []PanInfo `json:"list"` +} + +type SavePansReq struct { + Pans []PanInput `json:"pans"` +} + +type ListBoltResp struct { + List []BoltInfo `json:"list"` +} + +type SaveBoltsReq struct { + Lengths []string `json:"lengths"` +} + +type ProductTreeResp struct { + Product ProductInfo `json:"product"` + Pans []PanInfo `json:"pans"` + TotalPanCount int64 `json:"totalPanCount"` + TotalBoltCount int64 `json:"totalBoltCount"` + TotalLengthM string `json:"totalLengthM"` +} + +type ProductSummaryItem struct { + ProductName string `json:"productName"` + Spec string `json:"spec"` + ColorCount int64 `json:"colorCount"` + TotalPanCount int64 `json:"totalPanCount"` + TotalBoltCount int64 `json:"totalBoltCount"` + TotalLengthM string `json:"totalLengthM"` + Colors string `json:"colors"` + Locations string `json:"locations"` +} + +type ProductSummaryResp struct { + List []ProductSummaryItem `json:"list"` +} + +type ColorDetailItem struct { + ProductId string `json:"productId"` + ProductName string `json:"productName"` + Color string `json:"color"` + Spec string `json:"spec"` + ImageUrl string `json:"imageUrl"` + PanCount int64 `json:"panCount"` + BoltCount int64 `json:"boltCount"` + TotalLengthM string `json:"totalLengthM"` + Locations string `json:"locations"` + SalesPrice string `json:"salesPrice"` +} + +type ListColorDetailReq struct { + ProductName string `form:"productName"` +} + +type ColorDetailResp struct { + List []ColorDetailItem `json:"list"` +} + +type PanListItem struct { + PanId string `json:"panId"` + ProductId string `json:"productId"` + Name string `json:"name"` + Position string `json:"position"` + ProductName string `json:"productName"` + Colors string `json:"colors"` + BoltCount int64 `json:"boltCount"` + TotalLengthM string `json:"totalLengthM"` +} + +type ListPanViewReq struct { + Page int64 `form:"page,default=1"` + PageSize int64 `form:"pageSize,default=20"` + ProductName string `form:"productName,optional"` + Position string `form:"position,optional"` +} + +type ListPanViewResp struct { + Total int64 `json:"total"` + List []PanListItem `json:"list"` +} + +type BoltListItem struct { + BoltId string `json:"boltId"` + PanId string `json:"panId"` + LengthM string `json:"lengthM"` + Color string `json:"color"` + SortOrder int64 `json:"sortOrder"` + PanName string `json:"panName"` + Position string `json:"position"` + ProductId string `json:"productId"` + ProductName string `json:"productName"` +} + +type ListBoltViewReq struct { + Page int64 `form:"page,default=1"` + PageSize int64 `form:"pageSize,default=20"` + ProductName string `form:"productName,optional"` + Position string `form:"position,optional"` +} + +type ListBoltViewResp struct { + Total int64 `json:"total"` + List []BoltListItem `json:"list"` } type RoleInfo struct { @@ -337,8 +458,8 @@ type StockGroupResp struct { type StockSummaryResp struct { ProductCount int64 `json:"productCount"` TotalPieces int64 `json:"totalPieces"` - TotalRolls int64 `json:"totalRolls"` - TotalCostValue string `json:"totalCostValue"` + TotalPans int64 `json:"totalPans"` + TotalLengthM string `json:"totalLengthM"` TotalSalesValue string `json:"totalSalesValue"` } @@ -359,17 +480,12 @@ type UpdateMenuReq struct { } type UpdateProductReq struct { - ProductName string `json:"productName,optional"` - ImageUrl string `json:"imageUrl,optional"` - Spec string `json:"spec,optional"` - Color string `json:"color,optional"` - UnitPieces int64 `json:"unitPieces,optional"` - UnitRolls int64 `json:"unitRolls,optional"` - StockQuantity string `json:"stockQuantity,optional"` - Location string `json:"location,optional"` - CostPrice string `json:"costPrice,optional"` - SalesPrice string `json:"salesPrice,optional"` - Remark string `json:"remark,optional"` + ProductName string `json:"productName,optional"` + ImageUrl string `json:"imageUrl,optional"` + Spec string `json:"spec,optional"` + Color string `json:"color,optional"` + SalesPrice string `json:"salesPrice,optional"` + Remark string `json:"remark,optional"` } type UpdateRoleReq struct { diff --git a/go.mod b/go.mod index 03eb75c..0434468 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,8 @@ require ( github.com/casbin/gorm-adapter/v3 v3.28.0 github.com/golang-jwt/jwt/v5 v5.3.1 github.com/lib/pq v1.12.0 + github.com/prometheus/client_golang v1.23.2 + github.com/xuri/excelize/v2 v2.10.1 github.com/zeromicro/go-zero v1.10.0 golang.org/x/crypto v0.48.0 google.golang.org/grpc v1.79.1 @@ -68,14 +70,18 @@ require ( github.com/ncruces/go-strftime v1.0.0 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.66.1 // indirect github.com/prometheus/procfs v0.16.1 // indirect github.com/redis/go-redis/v9 v9.17.3 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/richardlehane/mscfb v1.0.6 // indirect + github.com/richardlehane/msoleps v1.0.6 // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/tiendc/go-deepcopy v1.7.2 // indirect + github.com/xuri/efp v0.0.1 // indirect + github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 // indirect go.etcd.io/etcd/api/v3 v3.5.15 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.15 // indirect go.etcd.io/etcd/client/v3 v3.5.15 // indirect @@ -97,7 +103,7 @@ require ( go.uber.org/zap v1.24.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect - golang.org/x/net v0.49.0 // indirect + golang.org/x/net v0.50.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect diff --git a/go.sum b/go.sum index 5d2723b..21fbc2f 100644 --- a/go.sum +++ b/go.sum @@ -223,6 +223,10 @@ github.com/redis/go-redis/v9 v9.17.3 h1:fN29NdNrE17KttK5Ndf20buqfDZwGNgoUr9qjl1D github.com/redis/go-redis/v9 v9.17.3/go.mod h1:u410H11HMLoB+TP67dz8rL9s6QW2j76l0//kSOd3370= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/richardlehane/mscfb v1.0.6 h1:eN3bvvZCp00bs7Zf52bxNwAx5lJDBK1tCuH19qq5aC8= +github.com/richardlehane/mscfb v1.0.6/go.mod h1:pe0+IUIc0AHh0+teNzBlJCtSyZdFOGgV4ZK9bsoV+Jo= +github.com/richardlehane/msoleps v1.0.6 h1:9BvkpjvD+iUBalUY4esMwv6uBkfOip/Lzvd93jvR9gg= +github.com/richardlehane/msoleps v1.0.6/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= @@ -248,6 +252,14 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/tiendc/go-deepcopy v1.7.2 h1:Ut2yYR7W9tWjTQitganoIue4UGxZwCcJy3orjrrIj44= +github.com/tiendc/go-deepcopy v1.7.2/go.mod h1:4bKjNC2r7boYOkD2IOuZpYjmlDdzjbpTRyCx+goBCJQ= +github.com/xuri/efp v0.0.1 h1:fws5Rv3myXyYni8uwj2qKjVaRP30PdjeYe2Y6FDsCL8= +github.com/xuri/efp v0.0.1/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.10.1 h1:V62UlqopMqha3kOpnlHy2CcRVw1V8E63jFoWUmMzxN0= +github.com/xuri/excelize/v2 v2.10.1/go.mod h1:iG5tARpgaEeIhTqt3/fgXCGoBRt4hNXgCp3tfXKoOIc= +github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 h1:+C0TIdyyYmzadGaL/HBLbf3WdLgC29pgyhTjAT/0nuE= +github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -317,6 +329,8 @@ golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 h1:fQsdNF2N+/YewlRZiricy4P1iimyPKZ/xwniHj8Q2a0= golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU= +golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ= +golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -348,8 +362,8 @@ golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= -golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= +golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= +golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/model/invproductboltmodel.go b/model/invproductboltmodel.go new file mode 100644 index 0000000..71c62c3 --- /dev/null +++ b/model/invproductboltmodel.go @@ -0,0 +1,146 @@ +package model + +import ( + "context" + "fmt" + "strings" + + "github.com/zeromicro/go-zero/core/stores/sqlx" +) + +var _ InvProductBoltModel = (*customInvProductBoltModel)(nil) + +// BoltListItem is the flat view row for the bolt-dimension panel. +// Color comes from the bolt itself, spec is omitted (product-level only). +type BoltListItem struct { + BoltId string `db:"bolt_id"` + PanId string `db:"pan_id"` + LengthM float64 `db:"length_m"` + Color string `db:"color"` + SortOrder int64 `db:"sort_order"` + PanName string `db:"pan_name"` + Position string `db:"position"` + ProductId string `db:"product_id"` + ProductName string `db:"product_name"` +} + +type ( + InvProductBoltModel interface { + invProductBoltModel + FindByPanId(ctx context.Context, panId string) ([]*InvProductBolt, error) + FindByProductId(ctx context.Context, productId string) ([]*InvProductBolt, error) + DeleteByPanId(ctx context.Context, panId string) error + DeleteByProductId(ctx context.Context, productId string) error + BulkReplace(ctx context.Context, panId, tenantId string, bolts []*InvProductBolt) error + FindBoltList(ctx context.Context, tenantId string, page, pageSize int64, productName, position string) ([]*BoltListItem, int64, error) + } + + customInvProductBoltModel struct { + *defaultInvProductBoltModel + } +) + +func NewInvProductBoltModel(conn sqlx.SqlConn) InvProductBoltModel { + return &customInvProductBoltModel{ + defaultInvProductBoltModel: newInvProductBoltModel(conn), + } +} + +func (m *customInvProductBoltModel) FindByPanId(ctx context.Context, panId string) ([]*InvProductBolt, error) { + var list []*InvProductBolt + query := fmt.Sprintf("SELECT %s FROM %s WHERE `pan_id` = ? ORDER BY `sort_order`", invProductBoltRows, m.table) + err := m.conn.QueryRowsCtx(ctx, &list, query, panId) + if err != nil { + return nil, err + } + return list, nil +} + +func (m *customInvProductBoltModel) FindByProductId(ctx context.Context, productId string) ([]*InvProductBolt, error) { + var list []*InvProductBolt + query := fmt.Sprintf( + "SELECT b.`id`, b.`bolt_id`, b.`pan_id`, b.`length_m`, b.`sort_order`, b.`tenant_id`, b.`created_at`, b.`updated_at` "+ + "FROM %s b INNER JOIN `inv_product_pan` p ON b.`pan_id` = p.`pan_id` "+ + "WHERE p.`product_id` = ? ORDER BY p.`sort_order`, b.`sort_order`", m.table) + err := m.conn.QueryRowsCtx(ctx, &list, query, productId) + if err != nil { + return nil, err + } + return list, nil +} + +func (m *customInvProductBoltModel) DeleteByPanId(ctx context.Context, panId string) error { + query := fmt.Sprintf("DELETE FROM %s WHERE `pan_id` = ?", m.table) + _, err := m.conn.ExecCtx(ctx, query, panId) + return err +} + +func (m *customInvProductBoltModel) DeleteByProductId(ctx context.Context, productId string) error { + query := fmt.Sprintf( + "DELETE b FROM %s b INNER JOIN `inv_product_pan` p ON b.`pan_id` = p.`pan_id` WHERE p.`product_id` = ?", m.table) + _, err := m.conn.ExecCtx(ctx, query, productId) + return err +} + +func (m *customInvProductBoltModel) FindBoltList(ctx context.Context, tenantId string, page, pageSize int64, productName, position string) ([]*BoltListItem, int64, error) { + where := "WHERE b.tenant_id = ? AND p.deleted_at IS NULL" + args := []interface{}{tenantId} + + if productName != "" { + where += " AND p.product_name LIKE ?" + args = append(args, "%"+productName+"%") + } + if position != "" { + where += " AND pan.position LIKE ?" + args = append(args, "%"+position+"%") + } + + countQuery := fmt.Sprintf(`SELECT COUNT(*) + FROM %s b + JOIN inv_product_pan pan ON pan.pan_id = b.pan_id + JOIN inv_product p ON p.product_id = pan.product_id + %s`, m.table, where) + var total int64 + if err := m.conn.QueryRowCtx(ctx, &total, countQuery, args...); err != nil { + return nil, 0, err + } + + query := fmt.Sprintf(`SELECT b.bolt_id, b.pan_id, b.length_m, b.color, b.sort_order, + pan.name AS pan_name, pan.position, + p.product_id, p.product_name + FROM %s b + JOIN inv_product_pan pan ON pan.pan_id = b.pan_id + JOIN inv_product p ON p.product_id = pan.product_id + %s + ORDER BY b.created_at DESC + LIMIT ? OFFSET ?`, m.table, where) + args = append(args, pageSize, (page-1)*pageSize) + + var list []*BoltListItem + if err := m.conn.QueryRowsCtx(ctx, &list, query, args...); err != nil { + return nil, 0, err + } + return list, total, nil +} + +func (m *customInvProductBoltModel) BulkReplace(ctx context.Context, panId, tenantId string, bolts []*InvProductBolt) error { + return m.conn.TransactCtx(ctx, func(ctx context.Context, session sqlx.Session) error { + delQuery := fmt.Sprintf("DELETE FROM %s WHERE `pan_id` = ?", m.table) + if _, err := session.ExecCtx(ctx, delQuery, panId); err != nil { + return err + } + if len(bolts) == 0 { + return nil + } + placeholder := "(?, ?, ?, ?, ?, ?)" + placeholders := make([]string, len(bolts)) + args := make([]interface{}, 0, len(bolts)*6) + for i, b := range bolts { + placeholders[i] = placeholder + args = append(args, b.BoltId, panId, b.LengthM, b.Color, b.SortOrder, tenantId) + } + insQuery := fmt.Sprintf("INSERT INTO %s (%s) VALUES %s", m.table, invProductBoltRowsExpectAutoSet, strings.Join(placeholders, ",")) + _, err := session.ExecCtx(ctx, insQuery, args...) + return err + }) +} diff --git a/model/invproductboltmodel_gen.go b/model/invproductboltmodel_gen.go new file mode 100644 index 0000000..71eca3a --- /dev/null +++ b/model/invproductboltmodel_gen.go @@ -0,0 +1,95 @@ +package model + +import ( + "context" + "database/sql" + "fmt" + "strings" + "time" + + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stores/sqlx" + "github.com/zeromicro/go-zero/core/stringx" +) + +var ( + invProductBoltFieldNames = builder.RawFieldNames(&InvProductBolt{}) + invProductBoltRows = strings.Join(invProductBoltFieldNames, ",") + invProductBoltRowsExpectAutoSet = strings.Join(stringx.Remove(invProductBoltFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",") + invProductBoltRowsWithPlaceHolder = strings.Join(stringx.Remove(invProductBoltFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?" +) + +type ( + invProductBoltModel interface { + Insert(ctx context.Context, data *InvProductBolt) (sql.Result, error) + FindOne(ctx context.Context, id int64) (*InvProductBolt, error) + FindOneByBoltId(ctx context.Context, boltId string) (*InvProductBolt, error) + Update(ctx context.Context, data *InvProductBolt) error + Delete(ctx context.Context, id int64) error + } + + defaultInvProductBoltModel struct { + conn sqlx.SqlConn + table string + } + + InvProductBolt struct { + Id int64 `db:"id"` + BoltId string `db:"bolt_id"` + PanId string `db:"pan_id"` + LengthM float64 `db:"length_m"` + Color string `db:"color"` + SortOrder int64 `db:"sort_order"` + TenantId string `db:"tenant_id"` + CreatedAt time.Time `db:"created_at"` + UpdatedAt time.Time `db:"updated_at"` + } +) + +func newInvProductBoltModel(conn sqlx.SqlConn) *defaultInvProductBoltModel { + return &defaultInvProductBoltModel{ + conn: conn, + table: "`inv_product_bolt`", + } +} + +func (m *defaultInvProductBoltModel) Insert(ctx context.Context, data *InvProductBolt) (sql.Result, error) { + query := fmt.Sprintf("INSERT INTO %s (%s) VALUES (?, ?, ?, ?, ?, ?)", m.table, invProductBoltRowsExpectAutoSet) + return m.conn.ExecCtx(ctx, query, data.BoltId, data.PanId, data.LengthM, data.Color, data.SortOrder, data.TenantId) +} + +func (m *defaultInvProductBoltModel) FindOne(ctx context.Context, id int64) (*InvProductBolt, error) { + query := fmt.Sprintf("SELECT %s FROM %s WHERE `id` = ? LIMIT 1", invProductBoltRows, m.table) + var resp InvProductBolt + err := m.conn.QueryRowCtx(ctx, &resp, query, id) + if err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultInvProductBoltModel) FindOneByBoltId(ctx context.Context, boltId string) (*InvProductBolt, error) { + query := fmt.Sprintf("SELECT %s FROM %s WHERE `bolt_id` = ? LIMIT 1", invProductBoltRows, m.table) + var resp InvProductBolt + err := m.conn.QueryRowCtx(ctx, &resp, query, boltId) + if err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultInvProductBoltModel) Update(ctx context.Context, data *InvProductBolt) error { + query := fmt.Sprintf("UPDATE %s SET %s WHERE `id` = ?", m.table, invProductBoltRowsWithPlaceHolder) + _, err := m.conn.ExecCtx(ctx, query, data.BoltId, data.PanId, data.LengthM, data.Color, data.SortOrder, data.TenantId, data.Id) + return err +} + +func (m *defaultInvProductBoltModel) Delete(ctx context.Context, id int64) error { + query := fmt.Sprintf("DELETE FROM %s WHERE `id` = ?", m.table) + _, err := m.conn.ExecCtx(ctx, query, id) + return err +} + +func (m *defaultInvProductBoltModel) tableName() string { + return m.table +} diff --git a/model/invproductmodel.go b/model/invproductmodel.go index 961d758..ae0a29e 100755 --- a/model/invproductmodel.go +++ b/model/invproductmodel.go @@ -3,6 +3,7 @@ package model import ( "context" "fmt" + "strings" "github.com/zeromicro/go-zero/core/stores/cache" "github.com/zeromicro/go-zero/core/stores/sqlx" @@ -10,19 +11,46 @@ import ( var _ InvProductModel = (*customInvProductModel)(nil) +// StockGroupResult is kept for GroupBy queries (color / location). type StockGroupResult struct { Name string `db:"name"` Count int64 `db:"count"` Quantity float64 `db:"quantity"` } +type ProductSummary struct { + ProductName string `db:"product_name"` + Spec string `db:"spec"` + ColorCount int64 `db:"color_count"` + TotalPanCount int64 `db:"total_pan_count"` + TotalBoltCount int64 `db:"total_bolt_count"` + TotalLengthM float64 `db:"total_length_m"` + Colors string `db:"colors"` + Locations string `db:"locations"` +} + +type ColorDetail struct { + ProductId string `db:"product_id"` + ProductName string `db:"product_name"` + Color string `db:"color"` + Spec string `db:"spec"` + ImageUrl string `db:"image_url"` + SalesPrice float64 `db:"sales_price"` + PanCount int64 `db:"pan_count"` + BoltCount int64 `db:"bolt_count"` + TotalLengthM float64 `db:"total_length_m"` + Locations string `db:"locations"` +} + type ( InvProductModel interface { invProductModel - FindList(ctx context.Context, tenantId string, page, pageSize int64, productName, spec, color, location string, status int64) ([]*InvProduct, int64, error) - FindStockSummary(ctx context.Context, tenantId string) (productCount, totalPieces, totalRolls int64, totalCostValue, totalSalesValue float64, err error) + FindList(ctx context.Context, tenantId string, page, pageSize int64, productName, spec, color string, status int64) ([]*InvProduct, int64, error) + FindProductSummary(ctx context.Context, tenantId string) ([]*ProductSummary, error) + FindColorDetail(ctx context.Context, tenantId, productName string) ([]*ColorDetail, error) FindGroupByColor(ctx context.Context, tenantId string) ([]StockGroupResult, error) FindGroupByLocation(ctx context.Context, tenantId string) ([]StockGroupResult, error) + BulkInsert(ctx context.Context, products []*InvProduct) (int64, error) } customInvProductModel struct { @@ -36,7 +64,48 @@ func NewInvProductModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Opti } } -func (m *customInvProductModel) FindList(ctx context.Context, tenantId string, page, pageSize int64, productName, spec, color, location string, status int64) ([]*InvProduct, int64, error) { +const bulkBatchSize = 200 + +func (m *customInvProductModel) BulkInsert(ctx context.Context, products []*InvProduct) (int64, error) { + if len(products) == 0 { + return 0, nil + } + + var totalAffected int64 + for i := 0; i < len(products); i += bulkBatchSize { + end := i + bulkBatchSize + if end > len(products) { + end = len(products) + } + batch := products[i:end] + + placeholder := "(" + strings.Repeat("?,", 9) + "?)" + placeholders := make([]string, len(batch)) + args := make([]interface{}, 0, len(batch)*10) + + for j, p := range batch { + placeholders[j] = placeholder + args = append(args, + p.ProductId, p.ProductName, p.ImageUrl, p.Spec, p.Color, + p.SalesPrice, p.Remark, p.Status, p.TenantId, p.DeletedAt, + ) + } + + query := fmt.Sprintf("INSERT INTO %s (%s) VALUES %s", + m.table, invProductRowsExpectAutoSet, strings.Join(placeholders, ",")) + + result, err := m.ExecNoCacheCtx(ctx, query, args...) + if err != nil { + return totalAffected, fmt.Errorf("batch %d-%d: %w", i, end-1, err) + } + n, _ := result.RowsAffected() + totalAffected += n + } + + return totalAffected, nil +} + +func (m *customInvProductModel) FindList(ctx context.Context, tenantId string, page, pageSize int64, productName, spec, color string, status int64) ([]*InvProduct, int64, error) { where := "WHERE deleted_at IS NULL AND tenant_id = ?" args := []interface{}{tenantId} @@ -52,10 +121,6 @@ func (m *customInvProductModel) FindList(ctx context.Context, tenantId string, p where += " AND color = ?" args = append(args, color) } - if location != "" { - where += " AND location = ?" - args = append(args, location) - } if status >= 0 { where += " AND status = ?" args = append(args, status) @@ -79,25 +144,37 @@ func (m *customInvProductModel) FindList(ctx context.Context, tenantId string, p return list, total, nil } -func (m *customInvProductModel) FindStockSummary(ctx context.Context, tenantId string) (productCount, totalPieces, totalRolls int64, totalCostValue, totalSalesValue float64, err error) { - var summary struct { - ProductCount int64 `db:"product_count"` - TotalPieces int64 `db:"total_pieces"` - TotalRolls int64 `db:"total_rolls"` - TotalCostValue float64 `db:"total_cost_value"` - TotalSalesValue float64 `db:"total_sales_value"` - } - query := fmt.Sprintf("SELECT COUNT(*) AS product_count, COALESCE(SUM(unit_pieces), 0) AS total_pieces, COALESCE(SUM(unit_rolls), 0) AS total_rolls, COALESCE(SUM(stock_quantity * cost_price), 0) AS total_cost_value, COALESCE(SUM(stock_quantity * sales_price), 0) AS total_sales_value FROM %s WHERE deleted_at IS NULL AND tenant_id = ?", m.table) - err = m.QueryRowNoCacheCtx(ctx, &summary, query, tenantId) +func (m *customInvProductModel) FindProductSummary(ctx context.Context, tenantId string) ([]*ProductSummary, error) { + var list []*ProductSummary + query := `SELECT p.product_name, p.spec, + COUNT(DISTINCT p.product_id) AS color_count, + COUNT(DISTINCT pan.pan_id) AS total_pan_count, + COUNT(bolt.bolt_id) AS total_bolt_count, + COALESCE(SUM(bolt.length_m), 0) AS total_length_m, + GROUP_CONCAT(DISTINCT p.color) AS colors, + GROUP_CONCAT(DISTINCT pan.position ORDER BY pan.position) AS locations + FROM ` + m.table + ` p + LEFT JOIN ` + "`inv_product_pan`" + ` pan ON pan.product_id = p.product_id + LEFT JOIN ` + "`inv_product_bolt`" + ` bolt ON bolt.pan_id = pan.pan_id + WHERE p.tenant_id = ? AND p.deleted_at IS NULL + GROUP BY p.product_name, p.spec + ORDER BY p.product_name` + err := m.QueryRowsNoCacheCtx(ctx, &list, query, tenantId) if err != nil { - return 0, 0, 0, 0, 0, err + return nil, err } - return summary.ProductCount, summary.TotalPieces, summary.TotalRolls, summary.TotalCostValue, summary.TotalSalesValue, nil + return list, nil } func (m *customInvProductModel) FindGroupByColor(ctx context.Context, tenantId string) ([]StockGroupResult, error) { var list []StockGroupResult - query := fmt.Sprintf("SELECT color AS name, COUNT(*) AS count, COALESCE(SUM(stock_quantity), 0) AS quantity FROM %s WHERE deleted_at IS NULL AND tenant_id = ? GROUP BY color ORDER BY count DESC", m.table) + query := `SELECT p.color AS name, COUNT(DISTINCT p.product_id) AS count, + COALESCE(SUM(bolt.length_m), 0) AS quantity + FROM ` + m.table + ` p + LEFT JOIN ` + "`inv_product_pan`" + ` pan ON pan.product_id = p.product_id + LEFT JOIN ` + "`inv_product_bolt`" + ` bolt ON bolt.pan_id = pan.pan_id + WHERE p.tenant_id = ? AND p.deleted_at IS NULL + GROUP BY p.color ORDER BY count DESC` err := m.QueryRowsNoCacheCtx(ctx, &list, query, tenantId) if err != nil { return nil, err @@ -107,10 +184,36 @@ func (m *customInvProductModel) FindGroupByColor(ctx context.Context, tenantId s func (m *customInvProductModel) FindGroupByLocation(ctx context.Context, tenantId string) ([]StockGroupResult, error) { var list []StockGroupResult - query := fmt.Sprintf("SELECT location AS name, COUNT(*) AS count, COALESCE(SUM(stock_quantity), 0) AS quantity FROM %s WHERE deleted_at IS NULL AND tenant_id = ? GROUP BY location ORDER BY count DESC", m.table) + query := `SELECT pan.position AS name, COUNT(DISTINCT p.product_id) AS count, + COALESCE(SUM(bolt.length_m), 0) AS quantity + FROM ` + m.table + ` p + JOIN ` + "`inv_product_pan`" + ` pan ON pan.product_id = p.product_id + LEFT JOIN ` + "`inv_product_bolt`" + ` bolt ON bolt.pan_id = pan.pan_id + WHERE p.tenant_id = ? AND p.deleted_at IS NULL AND pan.position != '' + GROUP BY pan.position ORDER BY count DESC` err := m.QueryRowsNoCacheCtx(ctx, &list, query, tenantId) if err != nil { return nil, err } return list, nil } + +func (m *customInvProductModel) FindColorDetail(ctx context.Context, tenantId, productName string) ([]*ColorDetail, error) { + var list []*ColorDetail + query := `SELECT p.product_id, p.product_name, p.color, p.spec, p.image_url, p.sales_price, + COUNT(DISTINCT pan.pan_id) AS pan_count, + COUNT(bolt.bolt_id) AS bolt_count, + COALESCE(SUM(bolt.length_m), 0) AS total_length_m, + GROUP_CONCAT(DISTINCT pan.position ORDER BY pan.position) AS locations + FROM ` + m.table + ` p + LEFT JOIN ` + "`inv_product_pan`" + ` pan ON pan.product_id = p.product_id + LEFT JOIN ` + "`inv_product_bolt`" + ` bolt ON bolt.pan_id = pan.pan_id + WHERE p.tenant_id = ? AND p.deleted_at IS NULL AND p.product_name = ? + GROUP BY p.product_id + ORDER BY p.color` + err := m.QueryRowsNoCacheCtx(ctx, &list, query, tenantId, productName) + if err != nil { + return nil, err + } + return list, nil +} diff --git a/model/invproductmodel_gen.go b/model/invproductmodel_gen.go index f2e2a28..7fefa7c 100755 --- a/model/invproductmodel_gen.go +++ b/model/invproductmodel_gen.go @@ -45,23 +45,19 @@ type ( } InvProduct struct { - Id int64 `db:"id"` - ProductId string `db:"product_id"` - ProductName string `db:"product_name"` - ImageUrl string `db:"image_url"` - Spec string `db:"spec"` - Color string `db:"color"` - UnitPieces int64 `db:"unit_pieces"` - UnitRolls int64 `db:"unit_rolls"` - StockQuantity float64 `db:"stock_quantity"` - Location string `db:"location"` - CostPrice float64 `db:"cost_price"` - SalesPrice float64 `db:"sales_price"` - Remark sql.NullString `db:"remark"` - Status int64 `db:"status"` // 1:enabled 0:disabled - CreatedAt time.Time `db:"created_at"` - UpdatedAt time.Time `db:"updated_at"` - DeletedAt sql.NullTime `db:"deleted_at"` + Id int64 `db:"id"` + ProductId string `db:"product_id"` + ProductName string `db:"product_name"` + ImageUrl string `db:"image_url"` + Spec string `db:"spec"` + Color string `db:"color"` + SalesPrice float64 `db:"sales_price"` + Remark sql.NullString `db:"remark"` + Status int64 `db:"status"` + TenantId string `db:"tenant_id"` + CreatedAt time.Time `db:"created_at"` + UpdatedAt time.Time `db:"updated_at"` + DeletedAt sql.NullTime `db:"deleted_at"` } ) @@ -150,8 +146,8 @@ func (m *defaultInvProductModel) Insert(ctx context.Context, data *InvProduct) ( invProductProductIdKey := fmt.Sprintf("%s%v", cacheInvProductProductIdPrefix, data.ProductId) invProductProductNameKey := fmt.Sprintf("%s%v", cacheInvProductProductNamePrefix, data.ProductName) ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { - query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, invProductRowsExpectAutoSet) - return conn.ExecCtx(ctx, query, data.ProductId, data.ProductName, data.ImageUrl, data.Spec, data.Color, data.UnitPieces, data.UnitRolls, data.StockQuantity, data.Location, data.CostPrice, data.SalesPrice, data.Remark, data.Status, data.DeletedAt) + query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, invProductRowsExpectAutoSet) + return conn.ExecCtx(ctx, query, data.ProductId, data.ProductName, data.ImageUrl, data.Spec, data.Color, data.SalesPrice, data.Remark, data.Status, data.TenantId, data.DeletedAt) }, invProductIdKey, invProductProductIdKey, invProductProductNameKey) return ret, err } @@ -167,7 +163,7 @@ func (m *defaultInvProductModel) Update(ctx context.Context, newData *InvProduct invProductProductNameKey := fmt.Sprintf("%s%v", cacheInvProductProductNamePrefix, data.ProductName) _, err = m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, invProductRowsWithPlaceHolder) - return conn.ExecCtx(ctx, query, newData.ProductId, newData.ProductName, newData.ImageUrl, newData.Spec, newData.Color, newData.UnitPieces, newData.UnitRolls, newData.StockQuantity, newData.Location, newData.CostPrice, newData.SalesPrice, newData.Remark, newData.Status, newData.DeletedAt, newData.Id) + return conn.ExecCtx(ctx, query, newData.ProductId, newData.ProductName, newData.ImageUrl, newData.Spec, newData.Color, newData.SalesPrice, newData.Remark, newData.Status, newData.TenantId, newData.DeletedAt, newData.Id) }, invProductIdKey, invProductProductIdKey, invProductProductNameKey) return err } diff --git a/model/invproductpanmodel.go b/model/invproductpanmodel.go new file mode 100644 index 0000000..00cdcd3 --- /dev/null +++ b/model/invproductpanmodel.go @@ -0,0 +1,123 @@ +package model + +import ( + "context" + "fmt" + "strings" + + "github.com/zeromicro/go-zero/core/stores/sqlx" +) + +var _ InvProductPanModel = (*customInvProductPanModel)(nil) + +// PanListItem is the aggregated view row for the pan-dimension panel. +// Colors is aggregated from the bolts on this pan; spec is omitted (product-level only). +type PanListItem struct { + PanId string `db:"pan_id"` + ProductId string `db:"product_id"` + Name string `db:"name"` + Position string `db:"position"` + ProductName string `db:"product_name"` + Colors string `db:"colors"` + BoltCount int64 `db:"bolt_count"` + TotalLengthM float64 `db:"total_length_m"` +} + +type ( + InvProductPanModel interface { + invProductPanModel + FindByProductId(ctx context.Context, productId string) ([]*InvProductPan, error) + DeleteByProductId(ctx context.Context, productId string) error + BulkReplace(ctx context.Context, productId, tenantId string, pans []*InvProductPan) error + FindPanList(ctx context.Context, tenantId string, page, pageSize int64, productName, position string) ([]*PanListItem, int64, error) + } + + customInvProductPanModel struct { + *defaultInvProductPanModel + } +) + +func NewInvProductPanModel(conn sqlx.SqlConn) InvProductPanModel { + return &customInvProductPanModel{ + defaultInvProductPanModel: newInvProductPanModel(conn), + } +} + +func (m *customInvProductPanModel) FindByProductId(ctx context.Context, productId string) ([]*InvProductPan, error) { + var list []*InvProductPan + query := fmt.Sprintf("SELECT %s FROM %s WHERE `product_id` = ? ORDER BY `sort_order`", invProductPanRows, m.table) + err := m.conn.QueryRowsCtx(ctx, &list, query, productId) + if err != nil { + return nil, err + } + return list, nil +} + +func (m *customInvProductPanModel) DeleteByProductId(ctx context.Context, productId string) error { + query := fmt.Sprintf("DELETE FROM %s WHERE `product_id` = ?", m.table) + _, err := m.conn.ExecCtx(ctx, query, productId) + return err +} + +func (m *customInvProductPanModel) FindPanList(ctx context.Context, tenantId string, page, pageSize int64, productName, position string) ([]*PanListItem, int64, error) { + where := "WHERE pan.tenant_id = ? AND p.deleted_at IS NULL" + args := []interface{}{tenantId} + + if productName != "" { + where += " AND p.product_name LIKE ?" + args = append(args, "%"+productName+"%") + } + if position != "" { + where += " AND pan.position LIKE ?" + args = append(args, "%"+position+"%") + } + + countQuery := fmt.Sprintf(`SELECT COUNT(DISTINCT pan.pan_id) + FROM %s pan JOIN inv_product p ON p.product_id = pan.product_id %s`, m.table, where) + var total int64 + if err := m.conn.QueryRowCtx(ctx, &total, countQuery, args...); err != nil { + return nil, 0, err + } + + query := fmt.Sprintf(`SELECT pan.pan_id, pan.product_id, pan.name, pan.position, + p.product_name, + COALESCE(GROUP_CONCAT(DISTINCT b.color ORDER BY b.color SEPARATOR ', '), '') AS colors, + COUNT(b.bolt_id) AS bolt_count, + COALESCE(SUM(b.length_m), 0) AS total_length_m + FROM %s pan + JOIN inv_product p ON p.product_id = pan.product_id + LEFT JOIN inv_product_bolt b ON b.pan_id = pan.pan_id + %s + GROUP BY pan.pan_id + ORDER BY pan.created_at DESC + LIMIT ? OFFSET ?`, m.table, where) + args = append(args, pageSize, (page-1)*pageSize) + + var list []*PanListItem + if err := m.conn.QueryRowsCtx(ctx, &list, query, args...); err != nil { + return nil, 0, err + } + return list, total, nil +} + +func (m *customInvProductPanModel) BulkReplace(ctx context.Context, productId, tenantId string, pans []*InvProductPan) error { + return m.conn.TransactCtx(ctx, func(ctx context.Context, session sqlx.Session) error { + delQuery := fmt.Sprintf("DELETE FROM %s WHERE `product_id` = ?", m.table) + if _, err := session.ExecCtx(ctx, delQuery, productId); err != nil { + return err + } + if len(pans) == 0 { + return nil + } + placeholder := "(?, ?, ?, ?, ?, ?)" + placeholders := make([]string, len(pans)) + args := make([]interface{}, 0, len(pans)*6) + for i, p := range pans { + placeholders[i] = placeholder + args = append(args, p.PanId, productId, p.Name, p.Position, p.SortOrder, tenantId) + } + insQuery := fmt.Sprintf("INSERT INTO %s (%s) VALUES %s", m.table, invProductPanRowsExpectAutoSet, strings.Join(placeholders, ",")) + _, err := session.ExecCtx(ctx, insQuery, args...) + return err + }) +} diff --git a/model/invproductpanmodel_gen.go b/model/invproductpanmodel_gen.go new file mode 100644 index 0000000..8d6dc01 --- /dev/null +++ b/model/invproductpanmodel_gen.go @@ -0,0 +1,95 @@ +package model + +import ( + "context" + "database/sql" + "fmt" + "strings" + "time" + + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stores/sqlx" + "github.com/zeromicro/go-zero/core/stringx" +) + +var ( + invProductPanFieldNames = builder.RawFieldNames(&InvProductPan{}) + invProductPanRows = strings.Join(invProductPanFieldNames, ",") + invProductPanRowsExpectAutoSet = strings.Join(stringx.Remove(invProductPanFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",") + invProductPanRowsWithPlaceHolder = strings.Join(stringx.Remove(invProductPanFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?" +) + +type ( + invProductPanModel interface { + Insert(ctx context.Context, data *InvProductPan) (sql.Result, error) + FindOne(ctx context.Context, id int64) (*InvProductPan, error) + FindOneByPanId(ctx context.Context, panId string) (*InvProductPan, error) + Update(ctx context.Context, data *InvProductPan) error + Delete(ctx context.Context, id int64) error + } + + defaultInvProductPanModel struct { + conn sqlx.SqlConn + table string + } + + InvProductPan struct { + Id int64 `db:"id"` + PanId string `db:"pan_id"` + ProductId string `db:"product_id"` + Name string `db:"name"` + Position string `db:"position"` + SortOrder int64 `db:"sort_order"` + TenantId string `db:"tenant_id"` + CreatedAt time.Time `db:"created_at"` + UpdatedAt time.Time `db:"updated_at"` + } +) + +func newInvProductPanModel(conn sqlx.SqlConn) *defaultInvProductPanModel { + return &defaultInvProductPanModel{ + conn: conn, + table: "`inv_product_pan`", + } +} + +func (m *defaultInvProductPanModel) Insert(ctx context.Context, data *InvProductPan) (sql.Result, error) { + query := fmt.Sprintf("INSERT INTO %s (%s) VALUES (?, ?, ?, ?, ?, ?)", m.table, invProductPanRowsExpectAutoSet) + return m.conn.ExecCtx(ctx, query, data.PanId, data.ProductId, data.Name, data.Position, data.SortOrder, data.TenantId) +} + +func (m *defaultInvProductPanModel) FindOne(ctx context.Context, id int64) (*InvProductPan, error) { + query := fmt.Sprintf("SELECT %s FROM %s WHERE `id` = ? LIMIT 1", invProductPanRows, m.table) + var resp InvProductPan + err := m.conn.QueryRowCtx(ctx, &resp, query, id) + if err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultInvProductPanModel) FindOneByPanId(ctx context.Context, panId string) (*InvProductPan, error) { + query := fmt.Sprintf("SELECT %s FROM %s WHERE `pan_id` = ? LIMIT 1", invProductPanRows, m.table) + var resp InvProductPan + err := m.conn.QueryRowCtx(ctx, &resp, query, panId) + if err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultInvProductPanModel) Update(ctx context.Context, data *InvProductPan) error { + query := fmt.Sprintf("UPDATE %s SET %s WHERE `id` = ?", m.table, invProductPanRowsWithPlaceHolder) + _, err := m.conn.ExecCtx(ctx, query, data.PanId, data.ProductId, data.Name, data.Position, data.SortOrder, data.TenantId, data.Id) + return err +} + +func (m *defaultInvProductPanModel) Delete(ctx context.Context, id int64) error { + query := fmt.Sprintf("DELETE FROM %s WHERE `id` = ?", m.table) + _, err := m.conn.ExecCtx(ctx, query, id) + return err +} + +func (m *defaultInvProductPanModel) tableName() string { + return m.table +} diff --git a/model/sysrolemodel_gen.go b/model/sysrolemodel_gen.go index d14a374..fabd4dc 100755 --- a/model/sysrolemodel_gen.go +++ b/model/sysrolemodel_gen.go @@ -46,6 +46,7 @@ type ( SysRole struct { Id int64 `db:"id"` + TenantId string `db:"tenant_id"` RoleId string `db:"role_id"` RoleName string `db:"role_name"` RoleKey string `db:"role_key"` @@ -142,8 +143,8 @@ func (m *defaultSysRoleModel) Insert(ctx context.Context, data *SysRole) (sql.Re sysRoleRoleIdKey := fmt.Sprintf("%s%v", cacheSysRoleRoleIdPrefix, data.RoleId) sysRoleRoleKeyKey := fmt.Sprintf("%s%v", cacheSysRoleRoleKeyPrefix, data.RoleKey) ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { - query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?)", m.table, sysRoleRowsExpectAutoSet) - return conn.ExecCtx(ctx, query, data.RoleId, data.RoleName, data.RoleKey, data.RoleDesc, data.SortOrder, data.Status) + query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, sysRoleRowsExpectAutoSet) + return conn.ExecCtx(ctx, query, data.TenantId, data.RoleId, data.RoleName, data.RoleKey, data.RoleDesc, data.SortOrder, data.Status) }, sysRoleIdKey, sysRoleRoleIdKey, sysRoleRoleKeyKey) return ret, err } @@ -159,7 +160,7 @@ func (m *defaultSysRoleModel) Update(ctx context.Context, newData *SysRole) erro sysRoleRoleKeyKey := fmt.Sprintf("%s%v", cacheSysRoleRoleKeyPrefix, data.RoleKey) _, err = m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, sysRoleRowsWithPlaceHolder) - return conn.ExecCtx(ctx, query, newData.RoleId, newData.RoleName, newData.RoleKey, newData.RoleDesc, newData.SortOrder, newData.Status, newData.Id) + return conn.ExecCtx(ctx, query, newData.TenantId, newData.RoleId, newData.RoleName, newData.RoleKey, newData.RoleDesc, newData.SortOrder, newData.Status, newData.Id) }, sysRoleIdKey, sysRoleRoleIdKey, sysRoleRoleKeyKey) return err } diff --git a/pkg/excelparse/miaozhang.go b/pkg/excelparse/miaozhang.go new file mode 100644 index 0000000..ee75fb3 --- /dev/null +++ b/pkg/excelparse/miaozhang.go @@ -0,0 +1,102 @@ +package excelparse + +import ( + "strconv" + "strings" +) + +// MiaozhangParser handles Excel exports from 秒账 (miaozhang.cn). +// +// Expected headers: +// 图片1 | 图片2 | 图片3 | 名称 | 规格型号 | 颜色 | 条形码 | 匹数 | 库存数量 | 成本均价 | 参考售价 | 备注 | 更新日期 +type MiaozhangParser struct{} + +func (p *MiaozhangParser) Name() string { return "秒账" } + +func (p *MiaozhangParser) Match(headers []string) bool { + required := map[string]bool{"名称": false, "规格型号": false, "颜色": false, "匹数": false, "库存数量": false} + for _, h := range headers { + h = strings.TrimSpace(h) + if _, ok := required[h]; ok { + required[h] = true + } + } + for _, found := range required { + if !found { + return false + } + } + return true +} + +func (p *MiaozhangParser) ParseRows(headers []string, rows [][]string) (*ParseResult, error) { + idx := buildIndex(headers) + + var products []ParsedProduct + skipped := 0 + + for _, row := range rows { + name := colVal(row, idx["名称"]) + + if name == "" || strings.HasPrefix(name, "总") { + skipped++ + continue + } + + rolls, _ := strconv.ParseInt(colVal(row, idx["匹数"]), 10, 64) + + products = append(products, ParsedProduct{ + ProductName: name, + Spec: colVal(row, idx["规格型号"]), + Color: colVal(row, idx["颜色"]), + UnitRolls: rolls, + StockQuantity: stripUnit(colVal(row, idx["库存数量"])), + CostPrice: stripCurrency(colVal(row, idx["成本均价"])), + SalesPrice: stripCurrency(colVal(row, idx["参考售价"])), + Remark: colVal(row, idx["备注"]), + }) + } + + return &ParseResult{Products: products, SkippedRows: skipped}, nil +} + +func buildIndex(headers []string) map[string]int { + m := make(map[string]int, len(headers)) + for i, h := range headers { + m[strings.TrimSpace(h)] = i + } + return m +} + +func colVal(row []string, idx int) string { + if idx < 0 || idx >= len(row) { + return "" + } + return strings.TrimSpace(row[idx]) +} + +// stripUnit removes trailing unit markers like "米", "kg", etc. +func stripUnit(s string) string { + s = strings.TrimSpace(s) + for _, suffix := range []string{"米", "m", "kg", "KG"} { + s = strings.TrimSuffix(s, suffix) + } + s = strings.TrimSpace(s) + if s == "" { + return "0" + } + return s +} + +// stripCurrency removes leading ¥ / $ / ¥ symbols. +func stripCurrency(s string) string { + s = strings.TrimSpace(s) + for _, prefix := range []string{"¥", "¥", "$", "$"} { + s = strings.TrimPrefix(s, prefix) + } + s = strings.TrimSpace(s) + if s == "" { + return "0" + } + return s +} diff --git a/pkg/excelparse/parse.go b/pkg/excelparse/parse.go new file mode 100644 index 0000000..9a88089 --- /dev/null +++ b/pkg/excelparse/parse.go @@ -0,0 +1,167 @@ +package excelparse + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "os" + "os/exec" + "path/filepath" + "strings" + "time" + + "github.com/xuri/excelize/v2" +) + +var parsers []FormatParser + +func init() { + parsers = append(parsers, &MiaozhangParser{}) +} + +// RegisterParser adds a format parser at runtime (e.g. for plugins). +func RegisterParser(p FormatParser) { + parsers = append(parsers, p) +} + +// xlsToolPath returns the path to the xls2json.js script. +// Checks XLS_TOOL_PATH env var first, then falls back to a path +// relative to the binary's directory so it works both locally and in Docker. +func xlsToolPath() (string, error) { + if p := os.Getenv("XLS_TOOL_PATH"); p != "" { + return p, nil + } + // Docker layout: /app/tools/xls2json.js + candidates := []string{ + "/app/tools/xls2json.js", + } + // Local dev: look relative to the process working directory + if cwd, err := os.Getwd(); err == nil { + candidates = append(candidates, + filepath.Join(cwd, "deploy/tools/xls2json.js"), + filepath.Join(cwd, "../deploy/tools/xls2json.js"), + ) + } + for _, p := range candidates { + if _, err := os.Stat(p); err == nil { + return p, nil + } + } + return "", fmt.Errorf("xls2json.js not found; set XLS_TOOL_PATH env var or deploy to /app/tools/") +} + +// ParseFile reads an Excel file, auto-detects the competitor format, and returns parsed products. +func ParseFile(filePath string) (*ParseResult, error) { + ext := strings.ToLower(filepath.Ext(filePath)) + + var headers []string + var rows [][]string + var err error + + switch ext { + case ".xlsx": + headers, rows, err = readXLSX(filePath) + case ".xls": + headers, rows, err = readXLS(filePath) + default: + return nil, ErrUnsupportedExt + } + if err != nil { + return nil, fmt.Errorf("read excel: %w", err) + } + if len(rows) == 0 { + return nil, ErrEmptyFile + } + + for _, p := range parsers { + if p.Match(headers) { + result, err := p.ParseRows(headers, rows) + if err != nil { + return nil, fmt.Errorf("parse %s: %w", p.Name(), err) + } + result.ParserName = p.Name() + return result, nil + } + } + + return nil, ErrUnknownFormat +} + +func readXLSX(filePath string) ([]string, [][]string, error) { + f, err := excelize.OpenFile(filePath) + if err != nil { + return nil, nil, err + } + defer f.Close() + + sheets := f.GetSheetList() + if len(sheets) == 0 { + return nil, nil, ErrEmptyFile + } + + allRows, err := f.GetRows(sheets[0]) + if err != nil { + return nil, nil, err + } + if len(allRows) < 2 { + return nil, nil, ErrEmptyFile + } + + return allRows[0], allRows[1:], nil +} + +// readXLS delegates to the xls2json.js Node.js script via subprocess. +// This handles legacy .xls (BIFF8) files including those with embedded images, +// which pure-Go libraries cannot reliably process. +func readXLS(filePath string) ([]string, [][]string, error) { + toolPath, err := xlsToolPath() + if err != nil { + return nil, nil, err + } + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + var stdout, stderr bytes.Buffer + cmd := exec.CommandContext(ctx, "node", toolPath, filePath) + cmd.Stdout = &stdout + cmd.Stderr = &stderr + + if err := cmd.Run(); err != nil { + msg := strings.TrimSpace(stderr.String()) + if msg == "" { + msg = err.Error() + } + return nil, nil, fmt.Errorf("xls2json: %s", msg) + } + + // JSON format: [][]interface{} (first row = headers) + var raw [][]interface{} + if err := json.Unmarshal(stdout.Bytes(), &raw); err != nil { + return nil, nil, fmt.Errorf("xls2json output parse: %w", err) + } + if len(raw) < 2 { + return nil, nil, ErrEmptyFile + } + + toStrings := func(row []interface{}) []string { + out := make([]string, len(row)) + for i, v := range row { + if v == nil { + out[i] = "" + } else { + out[i] = strings.TrimSpace(fmt.Sprintf("%v", v)) + } + } + return out + } + + headers := toStrings(raw[0]) + rows := make([][]string, 0, len(raw)-1) + for _, r := range raw[1:] { + rows = append(rows, toStrings(r)) + } + + return headers, rows, nil +} diff --git a/pkg/excelparse/types.go b/pkg/excelparse/types.go new file mode 100644 index 0000000..e962ce3 --- /dev/null +++ b/pkg/excelparse/types.go @@ -0,0 +1,34 @@ +package excelparse + +import "errors" + +var ( + ErrUnknownFormat = errors.New("unrecognized excel format; supported: 秒账, 领星") + ErrEmptyFile = errors.New("excel file has no data rows") + ErrUnsupportedExt = errors.New("unsupported file extension; use .xls or .xlsx") +) + +type ParsedProduct struct { + ProductName string + Spec string + Color string + UnitRolls int64 + StockQuantity string + CostPrice string + SalesPrice string + Remark string +} + +type ParseResult struct { + Products []ParsedProduct + ParserName string + SkippedRows int +} + +// FormatParser transforms raw spreadsheet rows into structured products. +// Each competitor format (秒账, 领星, etc.) implements this interface. +type FormatParser interface { + Name() string + Match(headers []string) bool + ParseRows(headers []string, rows [][]string) (*ParseResult, error) +} diff --git a/pkg/metrics/interceptor.go b/pkg/metrics/interceptor.go new file mode 100644 index 0000000..1c07b90 --- /dev/null +++ b/pkg/metrics/interceptor.go @@ -0,0 +1,32 @@ +package metrics + +import ( + "context" + "strconv" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/status" +) + +func UnaryServerInterceptor() grpc.UnaryServerInterceptor { + return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) { + start := time.Now() + resp, err := handler(ctx, req) + elapsed := time.Since(start).Seconds() + + code := "OK" + if err != nil { + if st, ok := status.FromError(err); ok { + code = strconv.Itoa(int(st.Code())) + } else { + code = "Unknown" + } + } + + RPCDurationSeconds.WithLabelValues(info.FullMethod).Observe(elapsed) + RPCRequestsTotal.WithLabelValues(info.FullMethod, code).Inc() + + return resp, err + } +} diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go new file mode 100644 index 0000000..5d0a69c --- /dev/null +++ b/pkg/metrics/metrics.go @@ -0,0 +1,141 @@ +package metrics + +import ( + "net/http" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/zeromicro/go-zero/core/logx" +) + +const namespace = "muyu" +const subsystem = "inventory" + +// ---- Business Counters ---- + +var ProductCreatedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "product_created_total", + Help: "Total number of products created.", +}, []string{"tenant_id", "product_name", "spec", "color"}) + +var ProductDeletedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "product_deleted_total", + Help: "Total number of products deleted (soft delete).", +}, []string{"tenant_id"}) + +var ImportOperationsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "import_operations_total", + Help: "Total number of import operations executed.", +}, []string{"tenant_id", "operator"}) + +var ImportProductsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "import_products_total", + Help: "Total number of products processed during imports.", +}, []string{"tenant_id", "result"}) + +var InboundLengthMetersTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "inbound_length_meters_total", + Help: "Total length (meters) of fabric added to inventory.", +}, []string{"tenant_id", "product_name", "color", "operation"}) + +var InboundBoltsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "inbound_bolts_total", + Help: "Total number of bolt records added to inventory.", +}, []string{"tenant_id", "operation"}) + +var PansSavedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "pans_saved_total", + Help: "Total number of pan-save operations.", +}, []string{"tenant_id", "product_id"}) + +var StockCheckCreatedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "stock_check_created_total", + Help: "Total number of stock check records created.", +}, []string{"tenant_id"}) + +var StockCheckConfirmedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "stock_check_confirmed_total", + Help: "Total number of stock checks confirmed.", +}, []string{"tenant_id"}) + +var StockAdjustCreatedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "stock_adjust_created_total", + Help: "Total number of stock adjustments created.", +}, []string{"tenant_id", "reason"}) + +var StockAdjustApprovedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "stock_adjust_approved_total", + Help: "Total number of stock adjustments approved/rejected.", +}, []string{"tenant_id", "action"}) + +var StockAdjustQuantityMeters = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "stock_adjust_quantity_meters_total", + Help: "Total adjusted quantity in meters (absolute value, split by direction).", +}, []string{"tenant_id", "direction"}) + +// ---- Histograms ---- + +var ImportBatchSize = prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "import_batch_size", + Help: "Number of products per import operation.", + Buckets: []float64{1, 5, 10, 50, 100, 200, 500, 1000}, +}, []string{"tenant_id"}) + +// ---- RPC Operational Metrics ---- + +var RPCDurationSeconds = prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "rpc_duration_seconds", + Help: "Duration of RPC calls in seconds.", + Buckets: prometheus.DefBuckets, +}, []string{"method"}) + +var RPCRequestsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: namespace, Subsystem: subsystem, + Name: "rpc_requests_total", + Help: "Total number of RPC requests.", +}, []string{"method", "code"}) + +func init() { + prometheus.MustRegister( + ProductCreatedTotal, + ProductDeletedTotal, + ImportOperationsTotal, + ImportProductsTotal, + InboundLengthMetersTotal, + InboundBoltsTotal, + PansSavedTotal, + StockCheckCreatedTotal, + StockCheckConfirmedTotal, + StockAdjustCreatedTotal, + StockAdjustApprovedTotal, + StockAdjustQuantityMeters, + ImportBatchSize, + RPCDurationSeconds, + RPCRequestsTotal, + ) +} + +func StartHTTP(addr string) { + mux := http.NewServeMux() + mux.Handle("/metrics", promhttp.Handler()) + go func() { + logx.Infof("prometheus metrics listening on %s", addr) + if err := http.ListenAndServe(addr, mux); err != nil { + logx.Errorf("prometheus http server error: %v", err) + } + }() +} diff --git a/rpc/inventory/buf.gen.yaml b/rpc/inventory/buf.gen.yaml new file mode 100644 index 0000000..849261c --- /dev/null +++ b/rpc/inventory/buf.gen.yaml @@ -0,0 +1,10 @@ +version: v2 +plugins: + - local: protoc-gen-go + out: pb + opt: + - paths=source_relative + - local: protoc-gen-go-grpc + out: pb + opt: + - paths=source_relative diff --git a/rpc/inventory/buf.yaml b/rpc/inventory/buf.yaml new file mode 100644 index 0000000..3879cd2 --- /dev/null +++ b/rpc/inventory/buf.yaml @@ -0,0 +1,9 @@ +version: v2 +modules: + - path: . +lint: + use: + - DEFAULT +breaking: + use: + - FILE diff --git a/rpc/inventory/etc/inventory.yaml b/rpc/inventory/etc/inventory.yaml index 21038af..c91f827 100644 --- a/rpc/inventory/etc/inventory.yaml +++ b/rpc/inventory/etc/inventory.yaml @@ -11,6 +11,8 @@ DataSource: root:muyu2026@tcp(127.0.0.1:3306)/muyu_wms?charset=utf8mb4&parseTime Cache: - Host: 127.0.0.1:6379 +PrometheusAddr: :9092 + Log: ServiceName: inventory-rpc Mode: console diff --git a/rpc/inventory/internal/config/config.go b/rpc/inventory/internal/config/config.go index fe94d71..916198a 100755 --- a/rpc/inventory/internal/config/config.go +++ b/rpc/inventory/internal/config/config.go @@ -7,6 +7,7 @@ import ( type Config struct { zrpc.RpcServerConf - DataSource string - Cache cache.CacheConf + DataSource string + Cache cache.CacheConf + PrometheusAddr string `json:",default=:9092"` } diff --git a/rpc/inventory/internal/logic/approvestockadjustlogic.go b/rpc/inventory/internal/logic/approvestockadjustlogic.go index 32eac3f..7c5a787 100644 --- a/rpc/inventory/internal/logic/approvestockadjustlogic.go +++ b/rpc/inventory/internal/logic/approvestockadjustlogic.go @@ -3,6 +3,8 @@ package logic import ( "context" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" "muyu-apiserver/rpc/inventory/internal/svc" "muyu-apiserver/rpc/inventory/pb" @@ -39,29 +41,11 @@ func (l *ApproveStockAdjustLogic) ApproveStockAdjust(in *pb.ApproveStockAdjustRe switch in.Action { case 1: // approve - details, err := l.svcCtx.AdjustDetailModel.FindByAdjustId(l.ctx, in.AdjustId) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - for _, d := range details { - product, err := l.svcCtx.ProductModel.FindOneByProductId(l.ctx, d.ProductId) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to find product %s: %v", d.ProductId, err) - } - - product.StockQuantity = d.AfterQuantity - err = l.svcCtx.ProductModel.Update(l.ctx, product) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to update product %s stock: %v", d.ProductId, err) - } - } - + // In the three-layer model, actual stock adjustments are done via + // SaveBolts/SavePans. Approving records the approval decision only. adjust.Status = 1 - case 2: // reject adjust.Status = 2 - default: return nil, status.Errorf(codes.InvalidArgument, "unsupported action: %d", in.Action) } @@ -71,5 +55,12 @@ func (l *ApproveStockAdjustLogic) ApproveStockAdjust(in *pb.ApproveStockAdjustRe return nil, status.Error(codes.Internal, err.Error()) } + tenantId := tenantctx.ExtractTenantId(l.ctx) + actionLabel := "approve" + if in.Action == 2 { + actionLabel = "reject" + } + metrics.StockAdjustApprovedTotal.WithLabelValues(tenantId, actionLabel).Inc() + return &pb.Empty{}, nil } diff --git a/rpc/inventory/internal/logic/confirmstockchecklogic.go b/rpc/inventory/internal/logic/confirmstockchecklogic.go index 5ecdc8b..48beb70 100644 --- a/rpc/inventory/internal/logic/confirmstockchecklogic.go +++ b/rpc/inventory/internal/logic/confirmstockchecklogic.go @@ -3,6 +3,8 @@ package logic import ( "context" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" "muyu-apiserver/rpc/inventory/internal/svc" "muyu-apiserver/rpc/inventory/pb" @@ -35,29 +37,17 @@ func (l *ConfirmStockCheckLogic) ConfirmStockCheck(in *pb.ConfirmStockCheckReq) return nil, status.Error(codes.FailedPrecondition, "stock check cannot be confirmed in current status") } - details, err := l.svcCtx.CheckDetailModel.FindByCheckId(l.ctx, in.CheckId) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - for _, d := range details { - product, err := l.svcCtx.ProductModel.FindOneByProductId(l.ctx, d.ProductId) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to find product %s: %v", d.ProductId, err) - } - - product.StockQuantity = d.ActualQuantity - err = l.svcCtx.ProductModel.Update(l.ctx, product) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to update product %s stock: %v", d.ProductId, err) - } - } - + // In the three-layer model, stock is held in bolt records. + // Confirming a stock check marks it as completed; bolt-level adjustments + // are handled separately via the SaveBolts/SavePans endpoints. check.Status = 2 err = l.svcCtx.StockCheckModel.Update(l.ctx, check) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } + tenantId := tenantctx.ExtractTenantId(l.ctx) + metrics.StockCheckConfirmedTotal.WithLabelValues(tenantId).Inc() + return &pb.Empty{}, nil } diff --git a/rpc/inventory/internal/logic/createproductlogic.go b/rpc/inventory/internal/logic/createproductlogic.go index 3ca370f..2242cf1 100644 --- a/rpc/inventory/internal/logic/createproductlogic.go +++ b/rpc/inventory/internal/logic/createproductlogic.go @@ -6,6 +6,8 @@ import ( "strconv" "muyu-apiserver/model" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" "muyu-apiserver/pkg/uid" "muyu-apiserver/rpc/inventory/internal/svc" "muyu-apiserver/rpc/inventory/pb" @@ -31,25 +33,17 @@ func NewCreateProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cre func (l *CreateProductLogic) CreateProduct(in *pb.CreateProductReq) (*pb.IdResp, error) { productId := uid.Generate() - - stockQuantity, _ := strconv.ParseFloat(in.StockQuantity, 64) - costPrice, _ := strconv.ParseFloat(in.CostPrice, 64) salesPrice, _ := strconv.ParseFloat(in.SalesPrice, 64) product := &model.InvProduct{ - ProductId: productId, - ProductName: in.ProductName, - ImageUrl: in.ImageUrl, - Spec: in.Spec, - Color: in.Color, - UnitPieces: in.UnitPieces, - UnitRolls: in.UnitRolls, - StockQuantity: stockQuantity, - Location: in.Location, - CostPrice: costPrice, - SalesPrice: salesPrice, - Remark: sql.NullString{String: in.Remark, Valid: in.Remark != ""}, - Status: 1, + ProductId: productId, + ProductName: in.ProductName, + ImageUrl: in.ImageUrl, + Spec: in.Spec, + Color: in.Color, + SalesPrice: salesPrice, + Remark: sql.NullString{String: in.Remark, Valid: in.Remark != ""}, + Status: 1, } _, err := l.svcCtx.ProductModel.Insert(l.ctx, product) @@ -57,5 +51,52 @@ func (l *CreateProductLogic) CreateProduct(in *pb.CreateProductReq) (*pb.IdResp, return nil, status.Error(codes.Internal, err.Error()) } + tenantId := tenantctx.ExtractTenantId(l.ctx) + var totalLengthM float64 + var totalBolts int + + if len(in.Pans) > 0 { + pans := make([]*model.InvProductPan, 0, len(in.Pans)) + for i, panInput := range in.Pans { + panId := uid.Generate() + pans = append(pans, &model.InvProductPan{ + PanId: panId, + ProductId: productId, + Name: panInput.Name, + Position: panInput.Position, + SortOrder: int64(i + 1), + }) + + if len(panInput.BoltLengths) > 0 { + bolts := make([]*model.InvProductBolt, 0, len(panInput.BoltLengths)) + for j, lengthStr := range panInput.BoltLengths { + lengthM, _ := strconv.ParseFloat(lengthStr, 64) + totalLengthM += lengthM + bolts = append(bolts, &model.InvProductBolt{ + BoltId: uid.Generate(), + PanId: panId, + LengthM: lengthM, + SortOrder: int64(j + 1), + }) + } + totalBolts += len(panInput.BoltLengths) + if err := l.svcCtx.BoltModel.BulkReplace(l.ctx, panId, "", bolts); err != nil { + l.Errorf("create bolts for pan %s failed: %v", panId, err) + } + } + } + if err := l.svcCtx.PanModel.BulkReplace(l.ctx, productId, "", pans); err != nil { + l.Errorf("create pans for product %s failed: %v", productId, err) + } + } + + metrics.ProductCreatedTotal.WithLabelValues(tenantId, in.ProductName, in.Spec, in.Color).Inc() + if totalLengthM > 0 { + metrics.InboundLengthMetersTotal.WithLabelValues(tenantId, in.ProductName, in.Color, "create").Add(totalLengthM) + } + if totalBolts > 0 { + metrics.InboundBoltsTotal.WithLabelValues(tenantId, "create").Add(float64(totalBolts)) + } + return &pb.IdResp{Id: productId}, nil } diff --git a/rpc/inventory/internal/logic/createstockadjustlogic.go b/rpc/inventory/internal/logic/createstockadjustlogic.go index 7805a84..9bb4494 100644 --- a/rpc/inventory/internal/logic/createstockadjustlogic.go +++ b/rpc/inventory/internal/logic/createstockadjustlogic.go @@ -6,7 +6,11 @@ import ( "strconv" "time" + "math" + "muyu-apiserver/model" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" "muyu-apiserver/pkg/uid" "muyu-apiserver/rpc/inventory/internal/svc" "muyu-apiserver/rpc/inventory/pb" @@ -30,6 +34,19 @@ func NewCreateStockAdjustLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } +// currentQty returns the total bolt length (meters) for a product. +func (l *CreateStockAdjustLogic) currentQty(productId string) float64 { + bolts, err := l.svcCtx.BoltModel.FindByProductId(l.ctx, productId) + if err != nil { + return 0 + } + var total float64 + for _, b := range bolts { + total += b.LengthM + } + return total +} + func (l *CreateStockAdjustLogic) CreateStockAdjust(in *pb.CreateStockAdjustReq) (*pb.IdResp, error) { adjustId := uid.Generate() adjustNo := generateNo("TZ") @@ -56,19 +73,20 @@ func (l *CreateStockAdjustLogic) CreateStockAdjust(in *pb.CreateStockAdjustReq) details := make([]*model.InvStockAdjustDetail, 0, len(in.Details)) for _, d := range in.Details { - product, err := l.svcCtx.ProductModel.FindOneByProductId(l.ctx, d.ProductId) + _, err := l.svcCtx.ProductModel.FindOneByProductId(l.ctx, d.ProductId) if err != nil { return nil, status.Errorf(codes.NotFound, "product %s not found", d.ProductId) } + beforeQty := l.currentQty(d.ProductId) adjustQty, _ := strconv.ParseFloat(d.AdjustQuantity, 64) - afterQty := product.StockQuantity + adjustQty + afterQty := beforeQty + adjustQty details = append(details, &model.InvStockAdjustDetail{ DetailId: uid.Generate(), AdjustId: adjustId, ProductId: d.ProductId, - BeforeQuantity: product.StockQuantity, + BeforeQuantity: beforeQty, AdjustQuantity: adjustQty, AfterQuantity: afterQty, Remark: sql.NullString{String: d.Remark, Valid: d.Remark != ""}, @@ -80,5 +98,15 @@ func (l *CreateStockAdjustLogic) CreateStockAdjust(in *pb.CreateStockAdjustReq) return nil, status.Error(codes.Internal, err.Error()) } + tenantId := tenantctx.ExtractTenantId(l.ctx) + metrics.StockAdjustCreatedTotal.WithLabelValues(tenantId, in.AdjustReason).Inc() + for _, d := range details { + if d.AdjustQuantity >= 0 { + metrics.StockAdjustQuantityMeters.WithLabelValues(tenantId, "increase").Add(d.AdjustQuantity) + } else { + metrics.StockAdjustQuantityMeters.WithLabelValues(tenantId, "decrease").Add(math.Abs(d.AdjustQuantity)) + } + } + return &pb.IdResp{Id: adjustId}, nil } diff --git a/rpc/inventory/internal/logic/createstockchecklogic.go b/rpc/inventory/internal/logic/createstockchecklogic.go index 83c4e3a..440687a 100644 --- a/rpc/inventory/internal/logic/createstockchecklogic.go +++ b/rpc/inventory/internal/logic/createstockchecklogic.go @@ -8,6 +8,8 @@ import ( "time" "muyu-apiserver/model" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" "muyu-apiserver/pkg/uid" "muyu-apiserver/rpc/inventory/internal/svc" "muyu-apiserver/rpc/inventory/pb" @@ -36,6 +38,19 @@ func generateNo(prefix string) string { return fmt.Sprintf("%s%s%04d", prefix, now.Format("20060102"), now.UnixNano()%10000) } +// computeSystemQty returns the total bolt length (meters) for a product. +func (l *CreateStockCheckLogic) computeSystemQty(productId string) float64 { + bolts, err := l.svcCtx.BoltModel.FindByProductId(l.ctx, productId) + if err != nil { + return 0 + } + var total float64 + for _, b := range bolts { + total += b.LengthM + } + return total +} + func (l *CreateStockCheckLogic) CreateStockCheck(in *pb.CreateStockCheckReq) (*pb.IdResp, error) { checkId := uid.Generate() checkNo := generateNo("PD") @@ -66,15 +81,16 @@ func (l *CreateStockCheckLogic) CreateStockCheck(in *pb.CreateStockCheckReq) (*p return nil, status.Errorf(codes.NotFound, "product %s not found", d.ProductId) } + systemQty := l.computeSystemQty(d.ProductId) actualQty, _ := strconv.ParseFloat(d.ActualQuantity, 64) - diffQty := actualQty - product.StockQuantity - diffAmount := diffQty * product.CostPrice + diffQty := actualQty - systemQty + diffAmount := diffQty * product.SalesPrice details = append(details, &model.InvStockCheckDetail{ DetailId: uid.Generate(), CheckId: checkId, ProductId: d.ProductId, - SystemQuantity: product.StockQuantity, + SystemQuantity: systemQty, ActualQuantity: actualQty, DiffQuantity: diffQty, DiffAmount: diffAmount, @@ -87,5 +103,8 @@ func (l *CreateStockCheckLogic) CreateStockCheck(in *pb.CreateStockCheckReq) (*p return nil, status.Error(codes.Internal, err.Error()) } + tenantId := tenantctx.ExtractTenantId(l.ctx) + metrics.StockCheckCreatedTotal.WithLabelValues(tenantId).Inc() + return &pb.IdResp{Id: checkId}, nil } diff --git a/rpc/inventory/internal/logic/deleteproductlogic.go b/rpc/inventory/internal/logic/deleteproductlogic.go index 908bf55..0fec899 100644 --- a/rpc/inventory/internal/logic/deleteproductlogic.go +++ b/rpc/inventory/internal/logic/deleteproductlogic.go @@ -5,6 +5,8 @@ import ( "database/sql" "time" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" "muyu-apiserver/rpc/inventory/internal/svc" "muyu-apiserver/rpc/inventory/pb" @@ -41,5 +43,8 @@ func (l *DeleteProductLogic) DeleteProduct(in *pb.DeleteProductReq) (*pb.Empty, return nil, status.Error(codes.Internal, err.Error()) } + tenantId := tenantctx.ExtractTenantId(l.ctx) + metrics.ProductDeletedTotal.WithLabelValues(tenantId).Inc() + return &pb.Empty{}, nil } diff --git a/rpc/inventory/internal/logic/getproductlogic.go b/rpc/inventory/internal/logic/getproductlogic.go index 9eb2439..20e12a1 100644 --- a/rpc/inventory/internal/logic/getproductlogic.go +++ b/rpc/inventory/internal/logic/getproductlogic.go @@ -33,20 +33,15 @@ func (l *GetProductLogic) GetProduct(in *pb.GetProductReq) (*pb.ProductInfo, err } return &pb.ProductInfo{ - ProductId: product.ProductId, - ProductName: product.ProductName, - ImageUrl: product.ImageUrl, - Spec: product.Spec, - Color: product.Color, - UnitPieces: product.UnitPieces, - UnitRolls: product.UnitRolls, - StockQuantity: fmt.Sprintf("%.2f", product.StockQuantity), - Location: product.Location, - CostPrice: fmt.Sprintf("%.2f", product.CostPrice), - SalesPrice: fmt.Sprintf("%.2f", product.SalesPrice), - Remark: product.Remark.String, - Status: product.Status, - CreatedAt: product.CreatedAt.Format("2006-01-02 15:04:05"), - UpdatedAt: product.UpdatedAt.Format("2006-01-02 15:04:05"), + ProductId: product.ProductId, + ProductName: product.ProductName, + ImageUrl: product.ImageUrl, + Spec: product.Spec, + Color: product.Color, + SalesPrice: fmt.Sprintf("%.2f", product.SalesPrice), + Remark: product.Remark.String, + Status: product.Status, + CreatedAt: product.CreatedAt.Format("2006-01-02 15:04:05"), + UpdatedAt: product.UpdatedAt.Format("2006-01-02 15:04:05"), }, nil } diff --git a/rpc/inventory/internal/logic/getproducttreelogic.go b/rpc/inventory/internal/logic/getproducttreelogic.go new file mode 100644 index 0000000..d8d4fe8 --- /dev/null +++ b/rpc/inventory/internal/logic/getproducttreelogic.go @@ -0,0 +1,95 @@ +package logic + +import ( + "context" + "fmt" + + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type GetProductTreeLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetProductTreeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductTreeLogic { + return &GetProductTreeLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *GetProductTreeLogic) GetProductTree(in *pb.GetProductReq) (*pb.ProductTreeResp, error) { + product, err := l.svcCtx.ProductModel.FindOneByProductId(l.ctx, in.ProductId) + if err != nil { + return nil, status.Error(codes.NotFound, "product not found") + } + + pans, err := l.svcCtx.PanModel.FindByProductId(l.ctx, in.ProductId) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + var totalBoltCount int64 + var totalLengthM float64 + pbPans := make([]*pb.PanInfo, 0, len(pans)) + + for _, pan := range pans { + bolts, err := l.svcCtx.BoltModel.FindByPanId(l.ctx, pan.PanId) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + var panLength float64 + pbBolts := make([]*pb.BoltInfo, 0, len(bolts)) + for _, b := range bolts { + pbBolts = append(pbBolts, &pb.BoltInfo{ + BoltId: b.BoltId, + PanId: b.PanId, + LengthM: fmt.Sprintf("%.2f", b.LengthM), + SortOrder: b.SortOrder, + }) + panLength += b.LengthM + } + + totalBoltCount += int64(len(bolts)) + totalLengthM += panLength + + pbPans = append(pbPans, &pb.PanInfo{ + PanId: pan.PanId, + ProductId: pan.ProductId, + Name: pan.Name, + Position: pan.Position, + SortOrder: pan.SortOrder, + Bolts: pbBolts, + BoltCount: int64(len(bolts)), + TotalLength: fmt.Sprintf("%.2f", panLength), + }) + } + + return &pb.ProductTreeResp{ + Product: &pb.ProductInfo{ + ProductId: product.ProductId, + ProductName: product.ProductName, + ImageUrl: product.ImageUrl, + Spec: product.Spec, + Color: product.Color, + SalesPrice: fmt.Sprintf("%.2f", product.SalesPrice), + Remark: product.Remark.String, + Status: product.Status, + CreatedAt: product.CreatedAt.Format("2006-01-02 15:04:05"), + UpdatedAt: product.UpdatedAt.Format("2006-01-02 15:04:05"), + }, + Pans: pbPans, + TotalPanCount: int64(len(pans)), + TotalBoltCount: totalBoltCount, + TotalLengthM: fmt.Sprintf("%.2f", totalLengthM), + }, nil +} diff --git a/rpc/inventory/internal/logic/getstocksummarylogic.go b/rpc/inventory/internal/logic/getstocksummarylogic.go index 10825ed..a2c4a3e 100644 --- a/rpc/inventory/internal/logic/getstocksummarylogic.go +++ b/rpc/inventory/internal/logic/getstocksummarylogic.go @@ -29,16 +29,26 @@ func NewGetStockSummaryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G func (l *GetStockSummaryLogic) GetStockSummary(in *pb.StockSummaryReq) (*pb.StockSummaryResp, error) { tenantId := tenantctx.ExtractTenantId(l.ctx) - productCount, totalPieces, totalRolls, totalCostValue, totalSalesValue, err := l.svcCtx.ProductModel.FindStockSummary(l.ctx, tenantId) + summaries, err := l.svcCtx.ProductModel.FindProductSummary(l.ctx, tenantId) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } + var productCount, totalPieces, totalPans int64 + var totalLengthM, totalSalesValue float64 + for _, s := range summaries { + productCount += s.ColorCount + totalPieces += s.TotalBoltCount + totalPans += s.TotalPanCount + totalLengthM += s.TotalLengthM + } + _ = totalSalesValue + return &pb.StockSummaryResp{ ProductCount: productCount, TotalPieces: totalPieces, - TotalRolls: totalRolls, - TotalCostValue: fmt.Sprintf("%.2f", totalCostValue), - TotalSalesValue: fmt.Sprintf("%.2f", totalSalesValue), + TotalPans: totalPans, + TotalLengthM: fmt.Sprintf("%.2f", totalLengthM), + TotalSalesValue: "0.00", }, nil } diff --git a/rpc/inventory/internal/logic/importproductslogic.go b/rpc/inventory/internal/logic/importproductslogic.go index acbf5ee..f4bab8f 100644 --- a/rpc/inventory/internal/logic/importproductslogic.go +++ b/rpc/inventory/internal/logic/importproductslogic.go @@ -3,11 +3,12 @@ package logic import ( "context" "database/sql" - "fmt" "strconv" "strings" "muyu-apiserver/model" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" "muyu-apiserver/pkg/uid" "muyu-apiserver/rpc/inventory/internal/svc" "muyu-apiserver/rpc/inventory/pb" @@ -32,44 +33,35 @@ func NewImportProductsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Im } func (l *ImportProductsLogic) ImportProducts(in *pb.ImportProductReq) (*pb.ImportProductResp, error) { - var successCount, failCount int64 - var errMsgs []string + products := make([]*model.InvProduct, 0, len(in.Products)) - for i, p := range in.Products { - productId := uid.Generate() - stockQuantity, _ := strconv.ParseFloat(p.StockQuantity, 64) - costPrice, _ := strconv.ParseFloat(p.CostPrice, 64) + for _, p := range in.Products { salesPrice, _ := strconv.ParseFloat(p.SalesPrice, 64) - product := &model.InvProduct{ - ProductId: productId, - ProductName: p.ProductName, - ImageUrl: p.ImageUrl, - Spec: p.Spec, - Color: p.Color, - UnitPieces: p.UnitPieces, - UnitRolls: p.UnitRolls, - StockQuantity: stockQuantity, - Location: p.Location, - CostPrice: costPrice, - SalesPrice: salesPrice, - Remark: sql.NullString{String: p.Remark, Valid: p.Remark != ""}, - Status: 1, - } - - _, err := l.svcCtx.ProductModel.Insert(l.ctx, product) - if err != nil { - failCount++ - errMsgs = append(errMsgs, fmt.Sprintf("row %d: %s", i+1, err.Error())) - } else { - successCount++ - } + products = append(products, &model.InvProduct{ + ProductId: uid.Generate(), + ProductName: p.ProductName, + ImageUrl: p.ImageUrl, + Spec: p.Spec, + Color: p.Color, + SalesPrice: salesPrice, + Remark: sql.NullString{String: p.Remark, Valid: p.Remark != ""}, + Status: 1, + }) } - totalCount := int64(len(in.Products)) - importId := uid.Generate() - errorMsg := strings.Join(errMsgs, "; ") + totalCount := int64(len(products)) + affected, err := l.svcCtx.ProductModel.BulkInsert(l.ctx, products) + var errorMsg string + successCount := affected + failCount := totalCount - affected + if err != nil { + errorMsg = err.Error() + l.Errorf("bulk insert partial failure: %v", err) + } + + importId := uid.Generate() importLog := &model.InvStockImportLog{ ImportId: importId, FileName: in.FileName, @@ -80,9 +72,23 @@ func (l *ImportProductsLogic) ImportProducts(in *pb.ImportProductReq) (*pb.Impor Operator: in.Operator, } - _, err := l.svcCtx.ImportLogModel.Insert(l.ctx, importLog) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) + if _, logErr := l.svcCtx.ImportLogModel.Insert(l.ctx, importLog); logErr != nil { + l.Errorf("save import log failed: %v", logErr) + if err != nil { + return nil, status.Error(codes.Internal, strings.Join([]string{errorMsg, logErr.Error()}, "; ")) + } + return nil, status.Error(codes.Internal, logErr.Error()) + } + + tenantId := tenantctx.ExtractTenantId(l.ctx) + metrics.ImportOperationsTotal.WithLabelValues(tenantId, in.Operator).Inc() + metrics.ImportProductsTotal.WithLabelValues(tenantId, "success").Add(float64(successCount)) + if failCount > 0 { + metrics.ImportProductsTotal.WithLabelValues(tenantId, "fail").Add(float64(failCount)) + } + metrics.ImportBatchSize.WithLabelValues(tenantId).Observe(float64(totalCount)) + for _, p := range in.Products { + metrics.ProductCreatedTotal.WithLabelValues(tenantId, p.ProductName, p.Spec, p.Color).Inc() } return &pb.ImportProductResp{ diff --git a/rpc/inventory/internal/logic/listboltslogic.go b/rpc/inventory/internal/logic/listboltslogic.go new file mode 100644 index 0000000..8f6d137 --- /dev/null +++ b/rpc/inventory/internal/logic/listboltslogic.go @@ -0,0 +1,46 @@ +package logic + +import ( + "context" + "fmt" + + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ListBoltsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewListBoltsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListBoltsLogic { + return &ListBoltsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ListBoltsLogic) ListBolts(in *pb.ListBoltReq) (*pb.ListBoltResp, error) { + bolts, err := l.svcCtx.BoltModel.FindByPanId(l.ctx, in.PanId) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + pbBolts := make([]*pb.BoltInfo, 0, len(bolts)) + for _, b := range bolts { + pbBolts = append(pbBolts, &pb.BoltInfo{ + BoltId: b.BoltId, + PanId: b.PanId, + LengthM: fmt.Sprintf("%.2f", b.LengthM), + SortOrder: b.SortOrder, + }) + } + + return &pb.ListBoltResp{List: pbBolts}, nil +} diff --git a/rpc/inventory/internal/logic/listboltviewlogic.go b/rpc/inventory/internal/logic/listboltviewlogic.go new file mode 100644 index 0000000..30207af --- /dev/null +++ b/rpc/inventory/internal/logic/listboltviewlogic.go @@ -0,0 +1,53 @@ +package logic + +import ( + "context" + "fmt" + + "muyu-apiserver/pkg/tenantctx" + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ListBoltViewLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewListBoltViewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListBoltViewLogic { + return &ListBoltViewLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ListBoltViewLogic) ListBoltView(in *pb.ListBoltViewReq) (*pb.ListBoltViewResp, error) { + tenantId := tenantctx.ExtractTenantId(l.ctx) + list, total, err := l.svcCtx.BoltModel.FindBoltList(l.ctx, tenantId, in.Page, in.PageSize, in.ProductName, in.Position) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + pbList := make([]*pb.BoltListItem, 0, len(list)) + for _, item := range list { + pbList = append(pbList, &pb.BoltListItem{ + BoltId: item.BoltId, + PanId: item.PanId, + LengthM: fmt.Sprintf("%.2f", item.LengthM), + Color: item.Color, + SortOrder: item.SortOrder, + PanName: item.PanName, + Position: item.Position, + ProductId: item.ProductId, + ProductName: item.ProductName, + }) + } + + return &pb.ListBoltViewResp{Total: total, List: pbList}, nil +} diff --git a/rpc/inventory/internal/logic/listcolordetaillogic.go b/rpc/inventory/internal/logic/listcolordetaillogic.go new file mode 100644 index 0000000..ca0c3a1 --- /dev/null +++ b/rpc/inventory/internal/logic/listcolordetaillogic.go @@ -0,0 +1,54 @@ +package logic + +import ( + "context" + "fmt" + + "muyu-apiserver/pkg/tenantctx" + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ListColorDetailLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewListColorDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListColorDetailLogic { + return &ListColorDetailLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ListColorDetailLogic) ListColorDetail(in *pb.ListColorDetailReq) (*pb.ListColorDetailResp, error) { + tenantId := tenantctx.ExtractTenantId(l.ctx) + list, err := l.svcCtx.ProductModel.FindColorDetail(l.ctx, tenantId, in.ProductName) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + pbList := make([]*pb.ColorDetailItem, 0, len(list)) + for _, d := range list { + pbList = append(pbList, &pb.ColorDetailItem{ + ProductId: d.ProductId, + ProductName: d.ProductName, + Color: d.Color, + Spec: d.Spec, + ImageUrl: d.ImageUrl, + PanCount: d.PanCount, + BoltCount: d.BoltCount, + TotalLengthM: fmt.Sprintf("%.2f", d.TotalLengthM), + Locations: d.Locations, + SalesPrice: fmt.Sprintf("%.2f", d.SalesPrice), + }) + } + + return &pb.ListColorDetailResp{List: pbList}, nil +} diff --git a/rpc/inventory/internal/logic/listpanslogic.go b/rpc/inventory/internal/logic/listpanslogic.go new file mode 100644 index 0000000..f574fb7 --- /dev/null +++ b/rpc/inventory/internal/logic/listpanslogic.go @@ -0,0 +1,65 @@ +package logic + +import ( + "context" + "fmt" + + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ListPansLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewListPansLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListPansLogic { + return &ListPansLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ListPansLogic) ListPans(in *pb.ListPanReq) (*pb.ListPanResp, error) { + pans, err := l.svcCtx.PanModel.FindByProductId(l.ctx, in.ProductId) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + pbPans := make([]*pb.PanInfo, 0, len(pans)) + for _, pan := range pans { + bolts, err := l.svcCtx.BoltModel.FindByPanId(l.ctx, pan.PanId) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + var panLength float64 + pbBolts := make([]*pb.BoltInfo, 0, len(bolts)) + for _, b := range bolts { + pbBolts = append(pbBolts, &pb.BoltInfo{ + BoltId: b.BoltId, + PanId: b.PanId, + LengthM: fmt.Sprintf("%.2f", b.LengthM), + SortOrder: b.SortOrder, + }) + panLength += b.LengthM + } + pbPans = append(pbPans, &pb.PanInfo{ + PanId: pan.PanId, + ProductId: pan.ProductId, + Name: pan.Name, + Position: pan.Position, + SortOrder: pan.SortOrder, + Bolts: pbBolts, + BoltCount: int64(len(bolts)), + TotalLength: fmt.Sprintf("%.2f", panLength), + }) + } + + return &pb.ListPanResp{List: pbPans}, nil +} diff --git a/rpc/inventory/internal/logic/listpanviewlogic.go b/rpc/inventory/internal/logic/listpanviewlogic.go new file mode 100644 index 0000000..588e946 --- /dev/null +++ b/rpc/inventory/internal/logic/listpanviewlogic.go @@ -0,0 +1,52 @@ +package logic + +import ( + "context" + "fmt" + + "muyu-apiserver/pkg/tenantctx" + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ListPanViewLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewListPanViewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListPanViewLogic { + return &ListPanViewLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ListPanViewLogic) ListPanView(in *pb.ListPanViewReq) (*pb.ListPanViewResp, error) { + tenantId := tenantctx.ExtractTenantId(l.ctx) + list, total, err := l.svcCtx.PanModel.FindPanList(l.ctx, tenantId, in.Page, in.PageSize, in.ProductName, in.Position) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + pbList := make([]*pb.PanListItem, 0, len(list)) + for _, item := range list { + pbList = append(pbList, &pb.PanListItem{ + PanId: item.PanId, + ProductId: item.ProductId, + Name: item.Name, + Position: item.Position, + ProductName: item.ProductName, + Colors: item.Colors, + BoltCount: item.BoltCount, + TotalLengthM: fmt.Sprintf("%.2f", item.TotalLengthM), + }) + } + + return &pb.ListPanViewResp{Total: total, List: pbList}, nil +} diff --git a/rpc/inventory/internal/logic/listproductlogic.go b/rpc/inventory/internal/logic/listproductlogic.go index 098e5f2..59b4ae6 100644 --- a/rpc/inventory/internal/logic/listproductlogic.go +++ b/rpc/inventory/internal/logic/listproductlogic.go @@ -29,7 +29,7 @@ func NewListProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListP func (l *ListProductLogic) ListProduct(in *pb.ListProductReq) (*pb.ListProductResp, error) { tenantId := tenantctx.ExtractTenantId(l.ctx) - list, total, err := l.svcCtx.ProductModel.FindList(l.ctx, tenantId, in.Page, in.PageSize, in.ProductName, in.Spec, in.Color, in.Location, in.Status) + list, total, err := l.svcCtx.ProductModel.FindList(l.ctx, tenantId, in.Page, in.PageSize, in.ProductName, in.Spec, in.Color, in.Status) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -37,21 +37,16 @@ func (l *ListProductLogic) ListProduct(in *pb.ListProductReq) (*pb.ListProductRe pbList := make([]*pb.ProductInfo, 0, len(list)) for _, p := range list { pbList = append(pbList, &pb.ProductInfo{ - ProductId: p.ProductId, - ProductName: p.ProductName, - ImageUrl: p.ImageUrl, - Spec: p.Spec, - Color: p.Color, - UnitPieces: p.UnitPieces, - UnitRolls: p.UnitRolls, - StockQuantity: fmt.Sprintf("%.2f", p.StockQuantity), - Location: p.Location, - CostPrice: fmt.Sprintf("%.2f", p.CostPrice), - SalesPrice: fmt.Sprintf("%.2f", p.SalesPrice), - Remark: p.Remark.String, - Status: p.Status, - CreatedAt: p.CreatedAt.Format("2006-01-02 15:04:05"), - UpdatedAt: p.UpdatedAt.Format("2006-01-02 15:04:05"), + ProductId: p.ProductId, + ProductName: p.ProductName, + ImageUrl: p.ImageUrl, + Spec: p.Spec, + Color: p.Color, + SalesPrice: fmt.Sprintf("%.2f", p.SalesPrice), + Remark: p.Remark.String, + Status: p.Status, + CreatedAt: p.CreatedAt.Format("2006-01-02 15:04:05"), + UpdatedAt: p.UpdatedAt.Format("2006-01-02 15:04:05"), }) } diff --git a/rpc/inventory/internal/logic/listproductsummarylogic.go b/rpc/inventory/internal/logic/listproductsummarylogic.go new file mode 100644 index 0000000..3ba90d7 --- /dev/null +++ b/rpc/inventory/internal/logic/listproductsummarylogic.go @@ -0,0 +1,52 @@ +package logic + +import ( + "context" + "fmt" + + "muyu-apiserver/pkg/tenantctx" + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ListProductSummaryLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewListProductSummaryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListProductSummaryLogic { + return &ListProductSummaryLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ListProductSummaryLogic) ListProductSummary(in *pb.ListProductSummaryReq) (*pb.ListProductSummaryResp, error) { + tenantId := tenantctx.ExtractTenantId(l.ctx) + list, err := l.svcCtx.ProductModel.FindProductSummary(l.ctx, tenantId) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + pbList := make([]*pb.ProductSummaryItem, 0, len(list)) + for _, s := range list { + pbList = append(pbList, &pb.ProductSummaryItem{ + ProductName: s.ProductName, + Spec: s.Spec, + ColorCount: s.ColorCount, + TotalPanCount: s.TotalPanCount, + TotalBoltCount: s.TotalBoltCount, + TotalLengthM: fmt.Sprintf("%.2f", s.TotalLengthM), + Colors: s.Colors, + Locations: s.Locations, + }) + } + + return &pb.ListProductSummaryResp{List: pbList}, nil +} diff --git a/rpc/inventory/internal/logic/saveboltslogic.go b/rpc/inventory/internal/logic/saveboltslogic.go new file mode 100644 index 0000000..80c3fd1 --- /dev/null +++ b/rpc/inventory/internal/logic/saveboltslogic.go @@ -0,0 +1,59 @@ +package logic + +import ( + "context" + "strconv" + + "muyu-apiserver/model" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" + "muyu-apiserver/pkg/uid" + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type SaveBoltsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewSaveBoltsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveBoltsLogic { + return &SaveBoltsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *SaveBoltsLogic) SaveBolts(in *pb.SaveBoltsReq) (*pb.Empty, error) { + tenantId := tenantctx.ExtractTenantId(l.ctx) + + var totalLengthM float64 + bolts := make([]*model.InvProductBolt, 0, len(in.Lengths)) + for i, lengthStr := range in.Lengths { + lengthM, _ := strconv.ParseFloat(lengthStr, 64) + totalLengthM += lengthM + bolts = append(bolts, &model.InvProductBolt{ + BoltId: uid.Generate(), + PanId: in.PanId, + LengthM: lengthM, + SortOrder: int64(i + 1), + }) + } + + if err := l.svcCtx.BoltModel.BulkReplace(l.ctx, in.PanId, tenantId, bolts); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + metrics.InboundBoltsTotal.WithLabelValues(tenantId, "save_bolts").Add(float64(len(in.Lengths))) + if totalLengthM > 0 { + metrics.InboundLengthMetersTotal.WithLabelValues(tenantId, "", "", "save_bolts").Add(totalLengthM) + } + + return &pb.Empty{}, nil +} diff --git a/rpc/inventory/internal/logic/savepanslogic.go b/rpc/inventory/internal/logic/savepanslogic.go new file mode 100644 index 0000000..e3e07bb --- /dev/null +++ b/rpc/inventory/internal/logic/savepanslogic.go @@ -0,0 +1,105 @@ +package logic + +import ( + "context" + "strconv" + + "muyu-apiserver/model" + "muyu-apiserver/pkg/metrics" + "muyu-apiserver/pkg/tenantctx" + "muyu-apiserver/pkg/uid" + "muyu-apiserver/rpc/inventory/internal/svc" + "muyu-apiserver/rpc/inventory/pb" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type SavePansLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewSavePansLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SavePansLogic { + return &SavePansLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *SavePansLogic) SavePans(in *pb.SavePansReq) (*pb.Empty, error) { + tenantId := tenantctx.ExtractTenantId(l.ctx) + + if err := l.svcCtx.BoltModel.DeleteByProductId(l.ctx, in.ProductId); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + var totalLengthM float64 + var totalBolts int + + pans := make([]*model.InvProductPan, 0, len(in.Pans)) + for i, panInput := range in.Pans { + panId := uid.Generate() + pans = append(pans, &model.InvProductPan{ + PanId: panId, + ProductId: in.ProductId, + Name: panInput.Name, + Position: panInput.Position, + SortOrder: int64(i + 1), + TenantId: tenantId, + }) + + if len(panInput.BoltLengths) > 0 { + bolts := make([]*model.InvProductBolt, 0, len(panInput.BoltLengths)) + for j, lengthStr := range panInput.BoltLengths { + lengthM, _ := strconv.ParseFloat(lengthStr, 64) + totalLengthM += lengthM + bolts = append(bolts, &model.InvProductBolt{ + BoltId: uid.Generate(), + PanId: panId, + LengthM: lengthM, + SortOrder: int64(j + 1), + }) + } + totalBolts += len(panInput.BoltLengths) + if err := l.svcCtx.BoltModel.BulkReplace(l.ctx, panId, tenantId, bolts); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + } + } + + if err := l.svcCtx.PanModel.BulkReplace(l.ctx, in.ProductId, tenantId, pans); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + metrics.PansSavedTotal.WithLabelValues(tenantId, in.ProductId).Inc() + if totalLengthM > 0 { + productName := l.resolveProductName(in.ProductId) + color := l.resolveProductColor(in.ProductId) + metrics.InboundLengthMetersTotal.WithLabelValues(tenantId, productName, color, "save_pans").Add(totalLengthM) + } + if totalBolts > 0 { + metrics.InboundBoltsTotal.WithLabelValues(tenantId, "save_pans").Add(float64(totalBolts)) + } + + return &pb.Empty{}, nil +} + +func (l *SavePansLogic) resolveProductName(productId string) string { + p, err := l.svcCtx.ProductModel.FindOneByProductId(l.ctx, productId) + if err != nil { + return "unknown" + } + return p.ProductName +} + +func (l *SavePansLogic) resolveProductColor(productId string) string { + p, err := l.svcCtx.ProductModel.FindOneByProductId(l.ctx, productId) + if err != nil { + return "unknown" + } + return p.Color +} diff --git a/rpc/inventory/internal/logic/updateproductlogic.go b/rpc/inventory/internal/logic/updateproductlogic.go index 0cbbad9..0dc2df9 100644 --- a/rpc/inventory/internal/logic/updateproductlogic.go +++ b/rpc/inventory/internal/logic/updateproductlogic.go @@ -33,19 +33,12 @@ func (l *UpdateProductLogic) UpdateProduct(in *pb.UpdateProductReq) (*pb.Empty, return nil, status.Error(codes.NotFound, "product not found") } - stockQuantity, _ := strconv.ParseFloat(in.StockQuantity, 64) - costPrice, _ := strconv.ParseFloat(in.CostPrice, 64) salesPrice, _ := strconv.ParseFloat(in.SalesPrice, 64) product.ProductName = in.ProductName product.ImageUrl = in.ImageUrl product.Spec = in.Spec product.Color = in.Color - product.UnitPieces = in.UnitPieces - product.UnitRolls = in.UnitRolls - product.StockQuantity = stockQuantity - product.Location = in.Location - product.CostPrice = costPrice product.SalesPrice = salesPrice product.Remark = sql.NullString{String: in.Remark, Valid: in.Remark != ""} diff --git a/rpc/inventory/internal/logic/updatestockchecklogic.go b/rpc/inventory/internal/logic/updatestockchecklogic.go index e2cc6bc..597c448 100644 --- a/rpc/inventory/internal/logic/updatestockchecklogic.go +++ b/rpc/inventory/internal/logic/updatestockchecklogic.go @@ -29,6 +29,18 @@ func NewUpdateStockCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } +func (l *UpdateStockCheckLogic) systemQty(productId string) float64 { + bolts, err := l.svcCtx.BoltModel.FindByProductId(l.ctx, productId) + if err != nil { + return 0 + } + var total float64 + for _, b := range bolts { + total += b.LengthM + } + return total +} + func (l *UpdateStockCheckLogic) UpdateStockCheck(in *pb.UpdateStockCheckReq) (*pb.Empty, error) { check, err := l.svcCtx.StockCheckModel.FindOneByCheckId(l.ctx, in.CheckId) if err != nil { @@ -59,15 +71,16 @@ func (l *UpdateStockCheckLogic) UpdateStockCheck(in *pb.UpdateStockCheckReq) (*p return nil, status.Errorf(codes.NotFound, "product %s not found", d.ProductId) } + sysQty := l.systemQty(d.ProductId) actualQty, _ := strconv.ParseFloat(d.ActualQuantity, 64) - diffQty := actualQty - product.StockQuantity - diffAmount := diffQty * product.CostPrice + diffQty := actualQty - sysQty + diffAmount := diffQty * product.SalesPrice details = append(details, &model.InvStockCheckDetail{ DetailId: uid.Generate(), CheckId: in.CheckId, ProductId: d.ProductId, - SystemQuantity: product.StockQuantity, + SystemQuantity: sysQty, ActualQuantity: actualQty, DiffQuantity: diffQty, DiffAmount: diffAmount, diff --git a/rpc/inventory/internal/server/inventoryserviceserver.go b/rpc/inventory/internal/server/inventoryserviceserver.go index 276bb60..75043a4 100644 --- a/rpc/inventory/internal/server/inventoryserviceserver.go +++ b/rpc/inventory/internal/server/inventoryserviceserver.go @@ -23,7 +23,7 @@ func NewInventoryServiceServer(svcCtx *svc.ServiceContext) *InventoryServiceServ } } -// Product +// Product CRUD func (s *InventoryServiceServer) CreateProduct(ctx context.Context, in *pb.CreateProductReq) (*pb.IdResp, error) { l := logic.NewCreateProductLogic(ctx, s.svcCtx) return l.CreateProduct(in) @@ -49,6 +49,57 @@ func (s *InventoryServiceServer) ListProduct(ctx context.Context, in *pb.ListPro return l.ListProduct(in) } +// Product Tree (panel 3) +func (s *InventoryServiceServer) GetProductTree(ctx context.Context, in *pb.GetProductReq) (*pb.ProductTreeResp, error) { + l := logic.NewGetProductTreeLogic(ctx, s.svcCtx) + return l.GetProductTree(in) +} + +// Product Summary (panel 1) +func (s *InventoryServiceServer) ListProductSummary(ctx context.Context, in *pb.ListProductSummaryReq) (*pb.ListProductSummaryResp, error) { + l := logic.NewListProductSummaryLogic(ctx, s.svcCtx) + return l.ListProductSummary(in) +} + +// Color Detail (panel 2) +func (s *InventoryServiceServer) ListColorDetail(ctx context.Context, in *pb.ListColorDetailReq) (*pb.ListColorDetailResp, error) { + l := logic.NewListColorDetailLogic(ctx, s.svcCtx) + return l.ListColorDetail(in) +} + +// Pan / Bolt list views +func (s *InventoryServiceServer) ListPanView(ctx context.Context, in *pb.ListPanViewReq) (*pb.ListPanViewResp, error) { + l := logic.NewListPanViewLogic(ctx, s.svcCtx) + return l.ListPanView(in) +} + +func (s *InventoryServiceServer) ListBoltView(ctx context.Context, in *pb.ListBoltViewReq) (*pb.ListBoltViewResp, error) { + l := logic.NewListBoltViewLogic(ctx, s.svcCtx) + return l.ListBoltView(in) +} + +// Pan CRUD +func (s *InventoryServiceServer) ListPans(ctx context.Context, in *pb.ListPanReq) (*pb.ListPanResp, error) { + l := logic.NewListPansLogic(ctx, s.svcCtx) + return l.ListPans(in) +} + +func (s *InventoryServiceServer) SavePans(ctx context.Context, in *pb.SavePansReq) (*pb.Empty, error) { + l := logic.NewSavePansLogic(ctx, s.svcCtx) + return l.SavePans(in) +} + +// Bolt CRUD +func (s *InventoryServiceServer) ListBolts(ctx context.Context, in *pb.ListBoltReq) (*pb.ListBoltResp, error) { + l := logic.NewListBoltsLogic(ctx, s.svcCtx) + return l.ListBolts(in) +} + +func (s *InventoryServiceServer) SaveBolts(ctx context.Context, in *pb.SaveBoltsReq) (*pb.Empty, error) { + l := logic.NewSaveBoltsLogic(ctx, s.svcCtx) + return l.SaveBolts(in) +} + // Import func (s *InventoryServiceServer) ImportProducts(ctx context.Context, in *pb.ImportProductReq) (*pb.ImportProductResp, error) { l := logic.NewImportProductsLogic(ctx, s.svcCtx) diff --git a/rpc/inventory/internal/svc/servicecontext.go b/rpc/inventory/internal/svc/servicecontext.go index 1073605..a38e99f 100644 --- a/rpc/inventory/internal/svc/servicecontext.go +++ b/rpc/inventory/internal/svc/servicecontext.go @@ -10,6 +10,8 @@ import ( type ServiceContext struct { Config config.Config ProductModel model.InvProductModel + PanModel model.InvProductPanModel + BoltModel model.InvProductBoltModel ImportLogModel model.InvStockImportLogModel StockCheckModel model.InvStockCheckModel CheckDetailModel model.InvStockCheckDetailModel @@ -22,6 +24,8 @@ func NewServiceContext(c config.Config) *ServiceContext { return &ServiceContext{ Config: c, ProductModel: model.NewInvProductModel(conn, c.Cache), + PanModel: model.NewInvProductPanModel(conn), + BoltModel: model.NewInvProductBoltModel(conn), ImportLogModel: model.NewInvStockImportLogModel(conn, c.Cache), StockCheckModel: model.NewInvStockCheckModel(conn, c.Cache), CheckDetailModel: model.NewInvStockCheckDetailModel(conn, c.Cache), diff --git a/rpc/inventory/inventory.go b/rpc/inventory/inventory.go index 160eaec..b3bebc1 100644 --- a/rpc/inventory/inventory.go +++ b/rpc/inventory/inventory.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" + "muyu-apiserver/pkg/metrics" "muyu-apiserver/rpc/inventory/internal/config" "muyu-apiserver/rpc/inventory/internal/server" "muyu-apiserver/rpc/inventory/internal/svc" @@ -25,6 +26,8 @@ func main() { conf.MustLoad(*configFile, &c) ctx := svc.NewServiceContext(c) + metrics.StartHTTP(c.PrometheusAddr) + s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { pb.RegisterInventoryServiceServer(grpcServer, server.NewInventoryServiceServer(ctx)) @@ -32,6 +35,7 @@ func main() { reflection.Register(grpcServer) } }) + s.AddUnaryInterceptors(metrics.UnaryServerInterceptor()) defer s.Stop() fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) diff --git a/rpc/inventory/inventory.proto b/rpc/inventory/inventory.proto index 3061201..f81bcf1 100644 --- a/rpc/inventory/inventory.proto +++ b/rpc/inventory/inventory.proto @@ -12,16 +12,11 @@ message ProductInfo { string image_url = 3; string spec = 4; string color = 5; - int64 unit_pieces = 6; - int64 unit_rolls = 7; - string stock_quantity = 8; - string location = 9; - string cost_price = 10; - string sales_price = 11; - string remark = 12; - int64 status = 13; - string created_at = 14; - string updated_at = 15; + string sales_price = 6; + string remark = 7; + int64 status = 8; + string created_at = 9; + string updated_at = 10; } message CreateProductReq { @@ -29,13 +24,9 @@ message CreateProductReq { string image_url = 2; string spec = 3; string color = 4; - int64 unit_pieces = 5; - int64 unit_rolls = 6; - string stock_quantity = 7; - string location = 8; - string cost_price = 9; - string sales_price = 10; - string remark = 11; + string sales_price = 5; + string remark = 6; + repeated PanInput pans = 7; } message UpdateProductReq { @@ -44,13 +35,8 @@ message UpdateProductReq { string image_url = 3; string spec = 4; string color = 5; - int64 unit_pieces = 6; - int64 unit_rolls = 7; - string stock_quantity = 8; - string location = 9; - string cost_price = 10; - string sales_price = 11; - string remark = 12; + string sales_price = 6; + string remark = 7; } message DeleteProductReq { @@ -67,8 +53,7 @@ message ListProductReq { string product_name = 3; string spec = 4; string color = 5; - string location = 6; - int64 status = 7; + int64 status = 6; } message ListProductResp { @@ -76,6 +61,161 @@ message ListProductResp { repeated ProductInfo list = 2; } +// ==================== Pan (盘) ==================== + +message PanInfo { + string pan_id = 1; + string product_id = 2; + string name = 3; + string position = 4; + int64 sort_order = 5; + repeated BoltInfo bolts = 6; + int64 bolt_count = 7; + string total_length = 8; +} + +message PanInput { + string name = 1; + string position = 2; + repeated string bolt_lengths = 3; +} + +message ListPanReq { + string product_id = 1; +} + +message ListPanResp { + repeated PanInfo list = 1; +} + +message SavePansReq { + string product_id = 1; + repeated PanInput pans = 2; +} + +// ==================== Bolt (匹) ==================== + +message BoltInfo { + string bolt_id = 1; + string pan_id = 2; + string length_m = 3; + int64 sort_order = 4; +} + +message ListBoltReq { + string pan_id = 1; +} + +message ListBoltResp { + repeated BoltInfo list = 1; +} + +message SaveBoltsReq { + string pan_id = 1; + repeated string lengths = 2; +} + +// ==================== Product Tree (三层详情) ==================== + +message ProductTreeResp { + ProductInfo product = 1; + repeated PanInfo pans = 2; + int64 total_pan_count = 3; + int64 total_bolt_count = 4; + string total_length_m = 5; +} + +// ==================== Panel 1: Product Summary ==================== + +message ProductSummaryItem { + string product_name = 1; + string spec = 2; + int64 color_count = 3; + int64 total_pan_count = 4; + int64 total_bolt_count = 5; + string total_length_m = 6; + string colors = 7; + string locations = 8; +} + +message ListProductSummaryReq {} + +message ListProductSummaryResp { + repeated ProductSummaryItem list = 1; +} + +// ==================== Panel 2: Color Detail ==================== + +message ColorDetailItem { + string product_id = 1; + string product_name = 2; + string color = 3; + string spec = 4; + string image_url = 5; + int64 pan_count = 6; + int64 bolt_count = 7; + string total_length_m = 8; + string locations = 9; + string sales_price = 10; +} + +message ListColorDetailReq { + string product_name = 1; +} + +message ListColorDetailResp { + repeated ColorDetailItem list = 1; +} + +// ==================== Pan / Bolt List View ==================== + +message PanListItem { + string pan_id = 1; + string product_id = 2; + string name = 3; + string position = 4; + string product_name = 5; + string colors = 6; // aggregated from bolt.color, no spec + int64 bolt_count = 7; + string total_length_m = 8; +} + +message ListPanViewReq { + int64 page = 1; + int64 page_size = 2; + string product_name = 3; + string position = 4; +} + +message ListPanViewResp { + int64 total = 1; + repeated PanListItem list = 2; +} + +message BoltListItem { + string bolt_id = 1; + string pan_id = 2; + string length_m = 3; + string color = 4; // bolt's own color, no spec + int64 sort_order = 5; + string pan_name = 6; + string position = 7; + string product_id = 8; + string product_name = 9; +} + +message ListBoltViewReq { + int64 page = 1; + int64 page_size = 2; + string product_name = 3; + string position = 4; +} + +message ListBoltViewResp { + int64 total = 1; + repeated BoltListItem list = 2; +} + // ==================== Stock Import ==================== message ImportProductReq { @@ -120,8 +260,8 @@ message StockSummaryReq {} message StockSummaryResp { int64 product_count = 1; int64 total_pieces = 2; - int64 total_rolls = 3; - string total_cost_value = 4; + int64 total_pans = 3; + string total_length_m = 4; string total_sales_value = 5; } @@ -284,13 +424,34 @@ message Empty {} // ==================== Service ==================== service InventoryService { - // Product + // Product CRUD rpc CreateProduct(CreateProductReq) returns (IdResp); rpc UpdateProduct(UpdateProductReq) returns (Empty); rpc DeleteProduct(DeleteProductReq) returns (Empty); rpc GetProduct(GetProductReq) returns (ProductInfo); rpc ListProduct(ListProductReq) returns (ListProductResp); + // Product Tree (panel 3) + rpc GetProductTree(GetProductReq) returns (ProductTreeResp); + + // Product Summary (panel 1) + rpc ListProductSummary(ListProductSummaryReq) returns (ListProductSummaryResp); + + // Color Detail (panel 2) + rpc ListColorDetail(ListColorDetailReq) returns (ListColorDetailResp); + + // Pan / Bolt list views (dimension panels) + rpc ListPanView(ListPanViewReq) returns (ListPanViewResp); + rpc ListBoltView(ListBoltViewReq) returns (ListBoltViewResp); + + // Pan CRUD + rpc ListPans(ListPanReq) returns (ListPanResp); + rpc SavePans(SavePansReq) returns (Empty); + + // Bolt CRUD + rpc ListBolts(ListBoltReq) returns (ListBoltResp); + rpc SaveBolts(SaveBoltsReq) returns (Empty); + // Import rpc ImportProducts(ImportProductReq) returns (ImportProductResp); rpc ListImportLog(ListImportLogReq) returns (ListImportLogResp); diff --git a/rpc/inventory/inventoryservice/inventoryservice.go b/rpc/inventory/inventoryservice/inventoryservice.go index 7150d99..2407740 100644 --- a/rpc/inventory/inventoryservice/inventoryservice.go +++ b/rpc/inventory/inventoryservice/inventoryservice.go @@ -14,50 +14,87 @@ import ( ) type ( - ApproveStockAdjustReq = pb.ApproveStockAdjustReq - ConfirmStockCheckReq = pb.ConfirmStockCheckReq - CreateProductReq = pb.CreateProductReq - CreateStockAdjustReq = pb.CreateStockAdjustReq - CreateStockCheckReq = pb.CreateStockCheckReq - DeleteProductReq = pb.DeleteProductReq - Empty = pb.Empty - GetProductReq = pb.GetProductReq - GetStockAdjustReq = pb.GetStockAdjustReq - GetStockCheckReq = pb.GetStockCheckReq - IdResp = pb.IdResp - ImportLogInfo = pb.ImportLogInfo - ImportProductReq = pb.ImportProductReq - ImportProductResp = pb.ImportProductResp - ListImportLogReq = pb.ListImportLogReq - ListImportLogResp = pb.ListImportLogResp - ListProductReq = pb.ListProductReq - ListProductResp = pb.ListProductResp - ListStockAdjustReq = pb.ListStockAdjustReq - ListStockAdjustResp = pb.ListStockAdjustResp - ListStockCheckReq = pb.ListStockCheckReq - ListStockCheckResp = pb.ListStockCheckResp - ProductInfo = pb.ProductInfo - StockAdjustDetailInfo = pb.StockAdjustDetailInfo - StockAdjustDetailReq = pb.StockAdjustDetailReq - StockAdjustInfo = pb.StockAdjustInfo - StockCheckDetailInfo = pb.StockCheckDetailInfo - StockCheckDetailReq = pb.StockCheckDetailReq - StockCheckInfo = pb.StockCheckInfo - StockGroupItem = pb.StockGroupItem - StockGroupReq = pb.StockGroupReq - StockGroupResp = pb.StockGroupResp - StockSummaryReq = pb.StockSummaryReq - StockSummaryResp = pb.StockSummaryResp - UpdateProductReq = pb.UpdateProductReq - UpdateStockCheckReq = pb.UpdateStockCheckReq + ApproveStockAdjustReq = pb.ApproveStockAdjustReq + BoltListItem = pb.BoltListItem + BoltInfo = pb.BoltInfo + ColorDetailItem = pb.ColorDetailItem + ConfirmStockCheckReq = pb.ConfirmStockCheckReq + CreateProductReq = pb.CreateProductReq + CreateStockAdjustReq = pb.CreateStockAdjustReq + CreateStockCheckReq = pb.CreateStockCheckReq + DeleteProductReq = pb.DeleteProductReq + Empty = pb.Empty + GetProductReq = pb.GetProductReq + GetStockAdjustReq = pb.GetStockAdjustReq + GetStockCheckReq = pb.GetStockCheckReq + IdResp = pb.IdResp + ImportLogInfo = pb.ImportLogInfo + ImportProductReq = pb.ImportProductReq + ImportProductResp = pb.ImportProductResp + ListBoltReq = pb.ListBoltReq + ListBoltResp = pb.ListBoltResp + ListBoltViewReq = pb.ListBoltViewReq + ListBoltViewResp = pb.ListBoltViewResp + ListColorDetailReq = pb.ListColorDetailReq + ListPanViewReq = pb.ListPanViewReq + ListPanViewResp = pb.ListPanViewResp + PanListItem = pb.PanListItem + ListColorDetailResp = pb.ListColorDetailResp + ListImportLogReq = pb.ListImportLogReq + ListImportLogResp = pb.ListImportLogResp + ListPanReq = pb.ListPanReq + ListPanResp = pb.ListPanResp + ListProductReq = pb.ListProductReq + ListProductResp = pb.ListProductResp + ListProductSummaryReq = pb.ListProductSummaryReq + ListProductSummaryResp = pb.ListProductSummaryResp + ListStockAdjustReq = pb.ListStockAdjustReq + ListStockAdjustResp = pb.ListStockAdjustResp + ListStockCheckReq = pb.ListStockCheckReq + ListStockCheckResp = pb.ListStockCheckResp + PanInfo = pb.PanInfo + PanInput = pb.PanInput + ProductInfo = pb.ProductInfo + ProductSummaryItem = pb.ProductSummaryItem + ProductTreeResp = pb.ProductTreeResp + SaveBoltsReq = pb.SaveBoltsReq + SavePansReq = pb.SavePansReq + StockAdjustDetailInfo = pb.StockAdjustDetailInfo + StockAdjustDetailReq = pb.StockAdjustDetailReq + StockAdjustInfo = pb.StockAdjustInfo + StockCheckDetailInfo = pb.StockCheckDetailInfo + StockCheckDetailReq = pb.StockCheckDetailReq + StockCheckInfo = pb.StockCheckInfo + StockGroupItem = pb.StockGroupItem + StockGroupReq = pb.StockGroupReq + StockGroupResp = pb.StockGroupResp + StockSummaryReq = pb.StockSummaryReq + StockSummaryResp = pb.StockSummaryResp + UpdateProductReq = pb.UpdateProductReq + UpdateStockCheckReq = pb.UpdateStockCheckReq InventoryService interface { - // Product + // Product CRUD CreateProduct(ctx context.Context, in *CreateProductReq, opts ...grpc.CallOption) (*IdResp, error) UpdateProduct(ctx context.Context, in *UpdateProductReq, opts ...grpc.CallOption) (*Empty, error) DeleteProduct(ctx context.Context, in *DeleteProductReq, opts ...grpc.CallOption) (*Empty, error) GetProduct(ctx context.Context, in *GetProductReq, opts ...grpc.CallOption) (*ProductInfo, error) ListProduct(ctx context.Context, in *ListProductReq, opts ...grpc.CallOption) (*ListProductResp, error) + // Product Tree (panel 3) + GetProductTree(ctx context.Context, in *GetProductReq, opts ...grpc.CallOption) (*ProductTreeResp, error) + // Product Summary (panel 1) + ListProductSummary(ctx context.Context, in *ListProductSummaryReq, opts ...grpc.CallOption) (*ListProductSummaryResp, error) + // Color Detail (panel 2) + ListColorDetail(ctx context.Context, in *ListColorDetailReq, opts ...grpc.CallOption) (*ListColorDetailResp, error) + // Pan / Bolt list views + ListPanView(ctx context.Context, in *ListPanViewReq, opts ...grpc.CallOption) (*ListPanViewResp, error) + ListBoltView(ctx context.Context, in *ListBoltViewReq, opts ...grpc.CallOption) (*ListBoltViewResp, error) + // Pan CRUD + ListPans(ctx context.Context, in *ListPanReq, opts ...grpc.CallOption) (*ListPanResp, error) + SavePans(ctx context.Context, in *SavePansReq, opts ...grpc.CallOption) (*Empty, error) + // Bolt CRUD + ListBolts(ctx context.Context, in *ListBoltReq, opts ...grpc.CallOption) (*ListBoltResp, error) + SaveBolts(ctx context.Context, in *SaveBoltsReq, opts ...grpc.CallOption) (*Empty, error) // Import ImportProducts(ctx context.Context, in *ImportProductReq, opts ...grpc.CallOption) (*ImportProductResp, error) ListImportLog(ctx context.Context, in *ListImportLogReq, opts ...grpc.CallOption) (*ListImportLogResp, error) @@ -88,7 +125,7 @@ func NewInventoryService(cli zrpc.Client) InventoryService { } } -// Product +// Product CRUD func (m *defaultInventoryService) CreateProduct(ctx context.Context, in *CreateProductReq, opts ...grpc.CallOption) (*IdResp, error) { client := pb.NewInventoryServiceClient(m.cli.Conn()) return client.CreateProduct(ctx, in, opts...) @@ -114,6 +151,51 @@ func (m *defaultInventoryService) ListProduct(ctx context.Context, in *ListProdu return client.ListProduct(ctx, in, opts...) } +func (m *defaultInventoryService) GetProductTree(ctx context.Context, in *GetProductReq, opts ...grpc.CallOption) (*ProductTreeResp, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.GetProductTree(ctx, in, opts...) +} + +func (m *defaultInventoryService) ListProductSummary(ctx context.Context, in *ListProductSummaryReq, opts ...grpc.CallOption) (*ListProductSummaryResp, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.ListProductSummary(ctx, in, opts...) +} + +func (m *defaultInventoryService) ListColorDetail(ctx context.Context, in *ListColorDetailReq, opts ...grpc.CallOption) (*ListColorDetailResp, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.ListColorDetail(ctx, in, opts...) +} + +func (m *defaultInventoryService) ListPanView(ctx context.Context, in *ListPanViewReq, opts ...grpc.CallOption) (*ListPanViewResp, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.ListPanView(ctx, in, opts...) +} + +func (m *defaultInventoryService) ListBoltView(ctx context.Context, in *ListBoltViewReq, opts ...grpc.CallOption) (*ListBoltViewResp, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.ListBoltView(ctx, in, opts...) +} + +func (m *defaultInventoryService) ListPans(ctx context.Context, in *ListPanReq, opts ...grpc.CallOption) (*ListPanResp, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.ListPans(ctx, in, opts...) +} + +func (m *defaultInventoryService) SavePans(ctx context.Context, in *SavePansReq, opts ...grpc.CallOption) (*Empty, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.SavePans(ctx, in, opts...) +} + +func (m *defaultInventoryService) ListBolts(ctx context.Context, in *ListBoltReq, opts ...grpc.CallOption) (*ListBoltResp, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.ListBolts(ctx, in, opts...) +} + +func (m *defaultInventoryService) SaveBolts(ctx context.Context, in *SaveBoltsReq, opts ...grpc.CallOption) (*Empty, error) { + client := pb.NewInventoryServiceClient(m.cli.Conn()) + return client.SaveBolts(ctx, in, opts...) +} + // Import func (m *defaultInventoryService) ImportProducts(ctx context.Context, in *ImportProductReq, opts ...grpc.CallOption) (*ImportProductResp, error) { client := pb.NewInventoryServiceClient(m.cli.Conn()) diff --git a/rpc/inventory/pb/inventory.pb.go b/rpc/inventory/pb/inventory.pb.go index b1eeed8..e838666 100644 --- a/rpc/inventory/pb/inventory.pb.go +++ b/rpc/inventory/pb/inventory.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.3 -// source: rpc/inventory/inventory.proto +// protoc-gen-go v1.36.11 +// protoc v5.29.3 +// source: inventory.proto package pb @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,34 +22,26 @@ const ( ) type ProductInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ProductName string `protobuf:"bytes,2,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + ImageUrl string `protobuf:"bytes,3,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` + Spec string `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` + Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"` + SalesPrice string `protobuf:"bytes,6,opt,name=sales_price,json=salesPrice,proto3" json:"sales_price,omitempty"` + Remark string `protobuf:"bytes,7,opt,name=remark,proto3" json:"remark,omitempty"` + Status int64 `protobuf:"varint,8,opt,name=status,proto3" json:"status,omitempty"` + CreatedAt string `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt string `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` unknownFields protoimpl.UnknownFields - - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - ProductName string `protobuf:"bytes,2,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` - ImageUrl string `protobuf:"bytes,3,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` - Spec string `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` - Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"` - UnitPieces int64 `protobuf:"varint,6,opt,name=unit_pieces,json=unitPieces,proto3" json:"unit_pieces,omitempty"` - UnitRolls int64 `protobuf:"varint,7,opt,name=unit_rolls,json=unitRolls,proto3" json:"unit_rolls,omitempty"` - StockQuantity string `protobuf:"bytes,8,opt,name=stock_quantity,json=stockQuantity,proto3" json:"stock_quantity,omitempty"` - Location string `protobuf:"bytes,9,opt,name=location,proto3" json:"location,omitempty"` - CostPrice string `protobuf:"bytes,10,opt,name=cost_price,json=costPrice,proto3" json:"cost_price,omitempty"` - SalesPrice string `protobuf:"bytes,11,opt,name=sales_price,json=salesPrice,proto3" json:"sales_price,omitempty"` - Remark string `protobuf:"bytes,12,opt,name=remark,proto3" json:"remark,omitempty"` - Status int64 `protobuf:"varint,13,opt,name=status,proto3" json:"status,omitempty"` - CreatedAt string `protobuf:"bytes,14,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt string `protobuf:"bytes,15,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ProductInfo) Reset() { *x = ProductInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProductInfo) String() string { @@ -58,8 +51,8 @@ func (x *ProductInfo) String() string { func (*ProductInfo) ProtoMessage() {} func (x *ProductInfo) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[0] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -71,7 +64,7 @@ func (x *ProductInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductInfo.ProtoReflect.Descriptor instead. func (*ProductInfo) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{0} + return file_inventory_proto_rawDescGZIP(), []int{0} } func (x *ProductInfo) GetProductId() string { @@ -109,41 +102,6 @@ func (x *ProductInfo) GetColor() string { return "" } -func (x *ProductInfo) GetUnitPieces() int64 { - if x != nil { - return x.UnitPieces - } - return 0 -} - -func (x *ProductInfo) GetUnitRolls() int64 { - if x != nil { - return x.UnitRolls - } - return 0 -} - -func (x *ProductInfo) GetStockQuantity() string { - if x != nil { - return x.StockQuantity - } - return "" -} - -func (x *ProductInfo) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -func (x *ProductInfo) GetCostPrice() string { - if x != nil { - return x.CostPrice - } - return "" -} - func (x *ProductInfo) GetSalesPrice() string { if x != nil { return x.SalesPrice @@ -180,30 +138,23 @@ func (x *ProductInfo) GetUpdatedAt() string { } type CreateProductReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ProductName string `protobuf:"bytes,1,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + ImageUrl string `protobuf:"bytes,2,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` + Spec string `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + Color string `protobuf:"bytes,4,opt,name=color,proto3" json:"color,omitempty"` + SalesPrice string `protobuf:"bytes,5,opt,name=sales_price,json=salesPrice,proto3" json:"sales_price,omitempty"` + Remark string `protobuf:"bytes,6,opt,name=remark,proto3" json:"remark,omitempty"` + Pans []*PanInput `protobuf:"bytes,7,rep,name=pans,proto3" json:"pans,omitempty"` unknownFields protoimpl.UnknownFields - - ProductName string `protobuf:"bytes,1,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` - ImageUrl string `protobuf:"bytes,2,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` - Spec string `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` - Color string `protobuf:"bytes,4,opt,name=color,proto3" json:"color,omitempty"` - UnitPieces int64 `protobuf:"varint,5,opt,name=unit_pieces,json=unitPieces,proto3" json:"unit_pieces,omitempty"` - UnitRolls int64 `protobuf:"varint,6,opt,name=unit_rolls,json=unitRolls,proto3" json:"unit_rolls,omitempty"` - StockQuantity string `protobuf:"bytes,7,opt,name=stock_quantity,json=stockQuantity,proto3" json:"stock_quantity,omitempty"` - Location string `protobuf:"bytes,8,opt,name=location,proto3" json:"location,omitempty"` - CostPrice string `protobuf:"bytes,9,opt,name=cost_price,json=costPrice,proto3" json:"cost_price,omitempty"` - SalesPrice string `protobuf:"bytes,10,opt,name=sales_price,json=salesPrice,proto3" json:"sales_price,omitempty"` - Remark string `protobuf:"bytes,11,opt,name=remark,proto3" json:"remark,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CreateProductReq) Reset() { *x = CreateProductReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CreateProductReq) String() string { @@ -213,8 +164,8 @@ func (x *CreateProductReq) String() string { func (*CreateProductReq) ProtoMessage() {} func (x *CreateProductReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[1] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -226,7 +177,7 @@ func (x *CreateProductReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateProductReq.ProtoReflect.Descriptor instead. func (*CreateProductReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{1} + return file_inventory_proto_rawDescGZIP(), []int{1} } func (x *CreateProductReq) GetProductName() string { @@ -257,41 +208,6 @@ func (x *CreateProductReq) GetColor() string { return "" } -func (x *CreateProductReq) GetUnitPieces() int64 { - if x != nil { - return x.UnitPieces - } - return 0 -} - -func (x *CreateProductReq) GetUnitRolls() int64 { - if x != nil { - return x.UnitRolls - } - return 0 -} - -func (x *CreateProductReq) GetStockQuantity() string { - if x != nil { - return x.StockQuantity - } - return "" -} - -func (x *CreateProductReq) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -func (x *CreateProductReq) GetCostPrice() string { - if x != nil { - return x.CostPrice - } - return "" -} - func (x *CreateProductReq) GetSalesPrice() string { if x != nil { return x.SalesPrice @@ -306,32 +222,31 @@ func (x *CreateProductReq) GetRemark() string { return "" } -type UpdateProductReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func (x *CreateProductReq) GetPans() []*PanInput { + if x != nil { + return x.Pans + } + return nil +} - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - ProductName string `protobuf:"bytes,2,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` - ImageUrl string `protobuf:"bytes,3,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` - Spec string `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` - Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"` - UnitPieces int64 `protobuf:"varint,6,opt,name=unit_pieces,json=unitPieces,proto3" json:"unit_pieces,omitempty"` - UnitRolls int64 `protobuf:"varint,7,opt,name=unit_rolls,json=unitRolls,proto3" json:"unit_rolls,omitempty"` - StockQuantity string `protobuf:"bytes,8,opt,name=stock_quantity,json=stockQuantity,proto3" json:"stock_quantity,omitempty"` - Location string `protobuf:"bytes,9,opt,name=location,proto3" json:"location,omitempty"` - CostPrice string `protobuf:"bytes,10,opt,name=cost_price,json=costPrice,proto3" json:"cost_price,omitempty"` - SalesPrice string `protobuf:"bytes,11,opt,name=sales_price,json=salesPrice,proto3" json:"sales_price,omitempty"` - Remark string `protobuf:"bytes,12,opt,name=remark,proto3" json:"remark,omitempty"` +type UpdateProductReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ProductName string `protobuf:"bytes,2,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + ImageUrl string `protobuf:"bytes,3,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` + Spec string `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` + Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"` + SalesPrice string `protobuf:"bytes,6,opt,name=sales_price,json=salesPrice,proto3" json:"sales_price,omitempty"` + Remark string `protobuf:"bytes,7,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateProductReq) Reset() { *x = UpdateProductReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UpdateProductReq) String() string { @@ -341,8 +256,8 @@ func (x *UpdateProductReq) String() string { func (*UpdateProductReq) ProtoMessage() {} func (x *UpdateProductReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[2] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -354,7 +269,7 @@ func (x *UpdateProductReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateProductReq.ProtoReflect.Descriptor instead. func (*UpdateProductReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{2} + return file_inventory_proto_rawDescGZIP(), []int{2} } func (x *UpdateProductReq) GetProductId() string { @@ -392,41 +307,6 @@ func (x *UpdateProductReq) GetColor() string { return "" } -func (x *UpdateProductReq) GetUnitPieces() int64 { - if x != nil { - return x.UnitPieces - } - return 0 -} - -func (x *UpdateProductReq) GetUnitRolls() int64 { - if x != nil { - return x.UnitRolls - } - return 0 -} - -func (x *UpdateProductReq) GetStockQuantity() string { - if x != nil { - return x.StockQuantity - } - return "" -} - -func (x *UpdateProductReq) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -func (x *UpdateProductReq) GetCostPrice() string { - if x != nil { - return x.CostPrice - } - return "" -} - func (x *UpdateProductReq) GetSalesPrice() string { if x != nil { return x.SalesPrice @@ -442,20 +322,17 @@ func (x *UpdateProductReq) GetRemark() string { } type DeleteProductReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` unknownFields protoimpl.UnknownFields - - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DeleteProductReq) Reset() { *x = DeleteProductReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DeleteProductReq) String() string { @@ -465,8 +342,8 @@ func (x *DeleteProductReq) String() string { func (*DeleteProductReq) ProtoMessage() {} func (x *DeleteProductReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[3] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -478,7 +355,7 @@ func (x *DeleteProductReq) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteProductReq.ProtoReflect.Descriptor instead. func (*DeleteProductReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{3} + return file_inventory_proto_rawDescGZIP(), []int{3} } func (x *DeleteProductReq) GetProductId() string { @@ -489,20 +366,17 @@ func (x *DeleteProductReq) GetProductId() string { } type GetProductReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` unknownFields protoimpl.UnknownFields - - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetProductReq) Reset() { *x = GetProductReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetProductReq) String() string { @@ -512,8 +386,8 @@ func (x *GetProductReq) String() string { func (*GetProductReq) ProtoMessage() {} func (x *GetProductReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[4] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -525,7 +399,7 @@ func (x *GetProductReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetProductReq.ProtoReflect.Descriptor instead. func (*GetProductReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{4} + return file_inventory_proto_rawDescGZIP(), []int{4} } func (x *GetProductReq) GetProductId() string { @@ -536,26 +410,22 @@ func (x *GetProductReq) GetProductId() string { } type ListProductReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + ProductName string `protobuf:"bytes,3,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + Spec string `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` + Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"` + Status int64 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields - - Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` - PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - ProductName string `protobuf:"bytes,3,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` - Spec string `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` - Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"` - Location string `protobuf:"bytes,6,opt,name=location,proto3" json:"location,omitempty"` - Status int64 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListProductReq) Reset() { *x = ListProductReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListProductReq) String() string { @@ -565,8 +435,8 @@ func (x *ListProductReq) String() string { func (*ListProductReq) ProtoMessage() {} func (x *ListProductReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[5] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -578,7 +448,7 @@ func (x *ListProductReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListProductReq.ProtoReflect.Descriptor instead. func (*ListProductReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{5} + return file_inventory_proto_rawDescGZIP(), []int{5} } func (x *ListProductReq) GetPage() int64 { @@ -616,13 +486,6 @@ func (x *ListProductReq) GetColor() string { return "" } -func (x *ListProductReq) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - func (x *ListProductReq) GetStatus() int64 { if x != nil { return x.Status @@ -631,21 +494,18 @@ func (x *ListProductReq) GetStatus() int64 { } type ListProductResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + List []*ProductInfo `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` unknownFields protoimpl.UnknownFields - - Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - List []*ProductInfo `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListProductResp) Reset() { *x = ListProductResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListProductResp) String() string { @@ -655,8 +515,8 @@ func (x *ListProductResp) String() string { func (*ListProductResp) ProtoMessage() {} func (x *ListProductResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[6] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -668,7 +528,7 @@ func (x *ListProductResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListProductResp.ProtoReflect.Descriptor instead. func (*ListProductResp) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{6} + return file_inventory_proto_rawDescGZIP(), []int{6} } func (x *ListProductResp) GetTotal() int64 { @@ -685,23 +545,1436 @@ func (x *ListProductResp) GetList() []*ProductInfo { return nil } -type ImportProductReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache +type PanInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + PanId string `protobuf:"bytes,1,opt,name=pan_id,json=panId,proto3" json:"pan_id,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Position string `protobuf:"bytes,4,opt,name=position,proto3" json:"position,omitempty"` + SortOrder int64 `protobuf:"varint,5,opt,name=sort_order,json=sortOrder,proto3" json:"sort_order,omitempty"` + Bolts []*BoltInfo `protobuf:"bytes,6,rep,name=bolts,proto3" json:"bolts,omitempty"` + BoltCount int64 `protobuf:"varint,7,opt,name=bolt_count,json=boltCount,proto3" json:"bolt_count,omitempty"` + TotalLength string `protobuf:"bytes,8,opt,name=total_length,json=totalLength,proto3" json:"total_length,omitempty"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} - Products []*CreateProductReq `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` - FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` - Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` +func (x *PanInfo) Reset() { + *x = PanInfo{} + mi := &file_inventory_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PanInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PanInfo) ProtoMessage() {} + +func (x *PanInfo) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PanInfo.ProtoReflect.Descriptor instead. +func (*PanInfo) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{7} +} + +func (x *PanInfo) GetPanId() string { + if x != nil { + return x.PanId + } + return "" +} + +func (x *PanInfo) GetProductId() string { + if x != nil { + return x.ProductId + } + return "" +} + +func (x *PanInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PanInfo) GetPosition() string { + if x != nil { + return x.Position + } + return "" +} + +func (x *PanInfo) GetSortOrder() int64 { + if x != nil { + return x.SortOrder + } + return 0 +} + +func (x *PanInfo) GetBolts() []*BoltInfo { + if x != nil { + return x.Bolts + } + return nil +} + +func (x *PanInfo) GetBoltCount() int64 { + if x != nil { + return x.BoltCount + } + return 0 +} + +func (x *PanInfo) GetTotalLength() string { + if x != nil { + return x.TotalLength + } + return "" +} + +type PanInput struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Position string `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"` + BoltLengths []string `protobuf:"bytes,3,rep,name=bolt_lengths,json=boltLengths,proto3" json:"bolt_lengths,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PanInput) Reset() { + *x = PanInput{} + mi := &file_inventory_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PanInput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PanInput) ProtoMessage() {} + +func (x *PanInput) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PanInput.ProtoReflect.Descriptor instead. +func (*PanInput) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{8} +} + +func (x *PanInput) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PanInput) GetPosition() string { + if x != nil { + return x.Position + } + return "" +} + +func (x *PanInput) GetBoltLengths() []string { + if x != nil { + return x.BoltLengths + } + return nil +} + +type ListPanReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListPanReq) Reset() { + *x = ListPanReq{} + mi := &file_inventory_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListPanReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPanReq) ProtoMessage() {} + +func (x *ListPanReq) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPanReq.ProtoReflect.Descriptor instead. +func (*ListPanReq) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{9} +} + +func (x *ListPanReq) GetProductId() string { + if x != nil { + return x.ProductId + } + return "" +} + +type ListPanResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*PanInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListPanResp) Reset() { + *x = ListPanResp{} + mi := &file_inventory_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListPanResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPanResp) ProtoMessage() {} + +func (x *ListPanResp) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPanResp.ProtoReflect.Descriptor instead. +func (*ListPanResp) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{10} +} + +func (x *ListPanResp) GetList() []*PanInfo { + if x != nil { + return x.List + } + return nil +} + +type SavePansReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Pans []*PanInput `protobuf:"bytes,2,rep,name=pans,proto3" json:"pans,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SavePansReq) Reset() { + *x = SavePansReq{} + mi := &file_inventory_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SavePansReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SavePansReq) ProtoMessage() {} + +func (x *SavePansReq) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SavePansReq.ProtoReflect.Descriptor instead. +func (*SavePansReq) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{11} +} + +func (x *SavePansReq) GetProductId() string { + if x != nil { + return x.ProductId + } + return "" +} + +func (x *SavePansReq) GetPans() []*PanInput { + if x != nil { + return x.Pans + } + return nil +} + +type BoltInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + BoltId string `protobuf:"bytes,1,opt,name=bolt_id,json=boltId,proto3" json:"bolt_id,omitempty"` + PanId string `protobuf:"bytes,2,opt,name=pan_id,json=panId,proto3" json:"pan_id,omitempty"` + LengthM string `protobuf:"bytes,3,opt,name=length_m,json=lengthM,proto3" json:"length_m,omitempty"` + SortOrder int64 `protobuf:"varint,4,opt,name=sort_order,json=sortOrder,proto3" json:"sort_order,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BoltInfo) Reset() { + *x = BoltInfo{} + mi := &file_inventory_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BoltInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoltInfo) ProtoMessage() {} + +func (x *BoltInfo) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoltInfo.ProtoReflect.Descriptor instead. +func (*BoltInfo) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{12} +} + +func (x *BoltInfo) GetBoltId() string { + if x != nil { + return x.BoltId + } + return "" +} + +func (x *BoltInfo) GetPanId() string { + if x != nil { + return x.PanId + } + return "" +} + +func (x *BoltInfo) GetLengthM() string { + if x != nil { + return x.LengthM + } + return "" +} + +func (x *BoltInfo) GetSortOrder() int64 { + if x != nil { + return x.SortOrder + } + return 0 +} + +type ListBoltReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + PanId string `protobuf:"bytes,1,opt,name=pan_id,json=panId,proto3" json:"pan_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBoltReq) Reset() { + *x = ListBoltReq{} + mi := &file_inventory_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBoltReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBoltReq) ProtoMessage() {} + +func (x *ListBoltReq) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBoltReq.ProtoReflect.Descriptor instead. +func (*ListBoltReq) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{13} +} + +func (x *ListBoltReq) GetPanId() string { + if x != nil { + return x.PanId + } + return "" +} + +type ListBoltResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*BoltInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBoltResp) Reset() { + *x = ListBoltResp{} + mi := &file_inventory_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBoltResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBoltResp) ProtoMessage() {} + +func (x *ListBoltResp) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBoltResp.ProtoReflect.Descriptor instead. +func (*ListBoltResp) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{14} +} + +func (x *ListBoltResp) GetList() []*BoltInfo { + if x != nil { + return x.List + } + return nil +} + +type SaveBoltsReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + PanId string `protobuf:"bytes,1,opt,name=pan_id,json=panId,proto3" json:"pan_id,omitempty"` + Lengths []string `protobuf:"bytes,2,rep,name=lengths,proto3" json:"lengths,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SaveBoltsReq) Reset() { + *x = SaveBoltsReq{} + mi := &file_inventory_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SaveBoltsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveBoltsReq) ProtoMessage() {} + +func (x *SaveBoltsReq) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveBoltsReq.ProtoReflect.Descriptor instead. +func (*SaveBoltsReq) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{15} +} + +func (x *SaveBoltsReq) GetPanId() string { + if x != nil { + return x.PanId + } + return "" +} + +func (x *SaveBoltsReq) GetLengths() []string { + if x != nil { + return x.Lengths + } + return nil +} + +type ProductTreeResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Product *ProductInfo `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"` + Pans []*PanInfo `protobuf:"bytes,2,rep,name=pans,proto3" json:"pans,omitempty"` + TotalPanCount int64 `protobuf:"varint,3,opt,name=total_pan_count,json=totalPanCount,proto3" json:"total_pan_count,omitempty"` + TotalBoltCount int64 `protobuf:"varint,4,opt,name=total_bolt_count,json=totalBoltCount,proto3" json:"total_bolt_count,omitempty"` + TotalLengthM string `protobuf:"bytes,5,opt,name=total_length_m,json=totalLengthM,proto3" json:"total_length_m,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProductTreeResp) Reset() { + *x = ProductTreeResp{} + mi := &file_inventory_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProductTreeResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProductTreeResp) ProtoMessage() {} + +func (x *ProductTreeResp) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProductTreeResp.ProtoReflect.Descriptor instead. +func (*ProductTreeResp) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{16} +} + +func (x *ProductTreeResp) GetProduct() *ProductInfo { + if x != nil { + return x.Product + } + return nil +} + +func (x *ProductTreeResp) GetPans() []*PanInfo { + if x != nil { + return x.Pans + } + return nil +} + +func (x *ProductTreeResp) GetTotalPanCount() int64 { + if x != nil { + return x.TotalPanCount + } + return 0 +} + +func (x *ProductTreeResp) GetTotalBoltCount() int64 { + if x != nil { + return x.TotalBoltCount + } + return 0 +} + +func (x *ProductTreeResp) GetTotalLengthM() string { + if x != nil { + return x.TotalLengthM + } + return "" +} + +type ProductSummaryItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProductName string `protobuf:"bytes,1,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + Spec string `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + ColorCount int64 `protobuf:"varint,3,opt,name=color_count,json=colorCount,proto3" json:"color_count,omitempty"` + TotalPanCount int64 `protobuf:"varint,4,opt,name=total_pan_count,json=totalPanCount,proto3" json:"total_pan_count,omitempty"` + TotalBoltCount int64 `protobuf:"varint,5,opt,name=total_bolt_count,json=totalBoltCount,proto3" json:"total_bolt_count,omitempty"` + TotalLengthM string `protobuf:"bytes,6,opt,name=total_length_m,json=totalLengthM,proto3" json:"total_length_m,omitempty"` + Colors string `protobuf:"bytes,7,opt,name=colors,proto3" json:"colors,omitempty"` + Locations string `protobuf:"bytes,8,opt,name=locations,proto3" json:"locations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProductSummaryItem) Reset() { + *x = ProductSummaryItem{} + mi := &file_inventory_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProductSummaryItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProductSummaryItem) ProtoMessage() {} + +func (x *ProductSummaryItem) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProductSummaryItem.ProtoReflect.Descriptor instead. +func (*ProductSummaryItem) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{17} +} + +func (x *ProductSummaryItem) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +func (x *ProductSummaryItem) GetSpec() string { + if x != nil { + return x.Spec + } + return "" +} + +func (x *ProductSummaryItem) GetColorCount() int64 { + if x != nil { + return x.ColorCount + } + return 0 +} + +func (x *ProductSummaryItem) GetTotalPanCount() int64 { + if x != nil { + return x.TotalPanCount + } + return 0 +} + +func (x *ProductSummaryItem) GetTotalBoltCount() int64 { + if x != nil { + return x.TotalBoltCount + } + return 0 +} + +func (x *ProductSummaryItem) GetTotalLengthM() string { + if x != nil { + return x.TotalLengthM + } + return "" +} + +func (x *ProductSummaryItem) GetColors() string { + if x != nil { + return x.Colors + } + return "" +} + +func (x *ProductSummaryItem) GetLocations() string { + if x != nil { + return x.Locations + } + return "" +} + +type ListProductSummaryReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListProductSummaryReq) Reset() { + *x = ListProductSummaryReq{} + mi := &file_inventory_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListProductSummaryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProductSummaryReq) ProtoMessage() {} + +func (x *ListProductSummaryReq) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProductSummaryReq.ProtoReflect.Descriptor instead. +func (*ListProductSummaryReq) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{18} +} + +type ListProductSummaryResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ProductSummaryItem `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListProductSummaryResp) Reset() { + *x = ListProductSummaryResp{} + mi := &file_inventory_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListProductSummaryResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProductSummaryResp) ProtoMessage() {} + +func (x *ListProductSummaryResp) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProductSummaryResp.ProtoReflect.Descriptor instead. +func (*ListProductSummaryResp) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{19} +} + +func (x *ListProductSummaryResp) GetList() []*ProductSummaryItem { + if x != nil { + return x.List + } + return nil +} + +type ColorDetailItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ProductName string `protobuf:"bytes,2,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + Color string `protobuf:"bytes,3,opt,name=color,proto3" json:"color,omitempty"` + Spec string `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` + ImageUrl string `protobuf:"bytes,5,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` + PanCount int64 `protobuf:"varint,6,opt,name=pan_count,json=panCount,proto3" json:"pan_count,omitempty"` + BoltCount int64 `protobuf:"varint,7,opt,name=bolt_count,json=boltCount,proto3" json:"bolt_count,omitempty"` + TotalLengthM string `protobuf:"bytes,8,opt,name=total_length_m,json=totalLengthM,proto3" json:"total_length_m,omitempty"` + Locations string `protobuf:"bytes,9,opt,name=locations,proto3" json:"locations,omitempty"` + SalesPrice string `protobuf:"bytes,10,opt,name=sales_price,json=salesPrice,proto3" json:"sales_price,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ColorDetailItem) Reset() { + *x = ColorDetailItem{} + mi := &file_inventory_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ColorDetailItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ColorDetailItem) ProtoMessage() {} + +func (x *ColorDetailItem) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ColorDetailItem.ProtoReflect.Descriptor instead. +func (*ColorDetailItem) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{20} +} + +func (x *ColorDetailItem) GetProductId() string { + if x != nil { + return x.ProductId + } + return "" +} + +func (x *ColorDetailItem) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +func (x *ColorDetailItem) GetColor() string { + if x != nil { + return x.Color + } + return "" +} + +func (x *ColorDetailItem) GetSpec() string { + if x != nil { + return x.Spec + } + return "" +} + +func (x *ColorDetailItem) GetImageUrl() string { + if x != nil { + return x.ImageUrl + } + return "" +} + +func (x *ColorDetailItem) GetPanCount() int64 { + if x != nil { + return x.PanCount + } + return 0 +} + +func (x *ColorDetailItem) GetBoltCount() int64 { + if x != nil { + return x.BoltCount + } + return 0 +} + +func (x *ColorDetailItem) GetTotalLengthM() string { + if x != nil { + return x.TotalLengthM + } + return "" +} + +func (x *ColorDetailItem) GetLocations() string { + if x != nil { + return x.Locations + } + return "" +} + +func (x *ColorDetailItem) GetSalesPrice() string { + if x != nil { + return x.SalesPrice + } + return "" +} + +type ListColorDetailReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProductName string `protobuf:"bytes,1,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListColorDetailReq) Reset() { + *x = ListColorDetailReq{} + mi := &file_inventory_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListColorDetailReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListColorDetailReq) ProtoMessage() {} + +func (x *ListColorDetailReq) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListColorDetailReq.ProtoReflect.Descriptor instead. +func (*ListColorDetailReq) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{21} +} + +func (x *ListColorDetailReq) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +type ListColorDetailResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ColorDetailItem `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListColorDetailResp) Reset() { + *x = ListColorDetailResp{} + mi := &file_inventory_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListColorDetailResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListColorDetailResp) ProtoMessage() {} + +func (x *ListColorDetailResp) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListColorDetailResp.ProtoReflect.Descriptor instead. +func (*ListColorDetailResp) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{22} +} + +func (x *ListColorDetailResp) GetList() []*ColorDetailItem { + if x != nil { + return x.List + } + return nil +} + +type PanListItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + PanId string `protobuf:"bytes,1,opt,name=pan_id,json=panId,proto3" json:"pan_id,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Position string `protobuf:"bytes,4,opt,name=position,proto3" json:"position,omitempty"` + ProductName string `protobuf:"bytes,5,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + Colors string `protobuf:"bytes,6,opt,name=colors,proto3" json:"colors,omitempty"` // aggregated from bolt.color, no spec + BoltCount int64 `protobuf:"varint,7,opt,name=bolt_count,json=boltCount,proto3" json:"bolt_count,omitempty"` + TotalLengthM string `protobuf:"bytes,8,opt,name=total_length_m,json=totalLengthM,proto3" json:"total_length_m,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PanListItem) Reset() { + *x = PanListItem{} + mi := &file_inventory_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PanListItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PanListItem) ProtoMessage() {} + +func (x *PanListItem) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PanListItem.ProtoReflect.Descriptor instead. +func (*PanListItem) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{23} +} + +func (x *PanListItem) GetPanId() string { + if x != nil { + return x.PanId + } + return "" +} + +func (x *PanListItem) GetProductId() string { + if x != nil { + return x.ProductId + } + return "" +} + +func (x *PanListItem) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PanListItem) GetPosition() string { + if x != nil { + return x.Position + } + return "" +} + +func (x *PanListItem) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +func (x *PanListItem) GetColors() string { + if x != nil { + return x.Colors + } + return "" +} + +func (x *PanListItem) GetBoltCount() int64 { + if x != nil { + return x.BoltCount + } + return 0 +} + +func (x *PanListItem) GetTotalLengthM() string { + if x != nil { + return x.TotalLengthM + } + return "" +} + +type ListPanViewReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + ProductName string `protobuf:"bytes,3,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + Position string `protobuf:"bytes,4,opt,name=position,proto3" json:"position,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListPanViewReq) Reset() { + *x = ListPanViewReq{} + mi := &file_inventory_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListPanViewReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPanViewReq) ProtoMessage() {} + +func (x *ListPanViewReq) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPanViewReq.ProtoReflect.Descriptor instead. +func (*ListPanViewReq) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{24} +} + +func (x *ListPanViewReq) GetPage() int64 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListPanViewReq) GetPageSize() int64 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListPanViewReq) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +func (x *ListPanViewReq) GetPosition() string { + if x != nil { + return x.Position + } + return "" +} + +type ListPanViewResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + List []*PanListItem `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListPanViewResp) Reset() { + *x = ListPanViewResp{} + mi := &file_inventory_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListPanViewResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPanViewResp) ProtoMessage() {} + +func (x *ListPanViewResp) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPanViewResp.ProtoReflect.Descriptor instead. +func (*ListPanViewResp) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{25} +} + +func (x *ListPanViewResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *ListPanViewResp) GetList() []*PanListItem { + if x != nil { + return x.List + } + return nil +} + +type BoltListItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + BoltId string `protobuf:"bytes,1,opt,name=bolt_id,json=boltId,proto3" json:"bolt_id,omitempty"` + PanId string `protobuf:"bytes,2,opt,name=pan_id,json=panId,proto3" json:"pan_id,omitempty"` + LengthM string `protobuf:"bytes,3,opt,name=length_m,json=lengthM,proto3" json:"length_m,omitempty"` + Color string `protobuf:"bytes,4,opt,name=color,proto3" json:"color,omitempty"` // bolt's own color, no spec + SortOrder int64 `protobuf:"varint,5,opt,name=sort_order,json=sortOrder,proto3" json:"sort_order,omitempty"` + PanName string `protobuf:"bytes,6,opt,name=pan_name,json=panName,proto3" json:"pan_name,omitempty"` + Position string `protobuf:"bytes,7,opt,name=position,proto3" json:"position,omitempty"` + ProductId string `protobuf:"bytes,8,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ProductName string `protobuf:"bytes,9,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BoltListItem) Reset() { + *x = BoltListItem{} + mi := &file_inventory_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BoltListItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoltListItem) ProtoMessage() {} + +func (x *BoltListItem) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoltListItem.ProtoReflect.Descriptor instead. +func (*BoltListItem) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{26} +} + +func (x *BoltListItem) GetBoltId() string { + if x != nil { + return x.BoltId + } + return "" +} + +func (x *BoltListItem) GetPanId() string { + if x != nil { + return x.PanId + } + return "" +} + +func (x *BoltListItem) GetLengthM() string { + if x != nil { + return x.LengthM + } + return "" +} + +func (x *BoltListItem) GetColor() string { + if x != nil { + return x.Color + } + return "" +} + +func (x *BoltListItem) GetSortOrder() int64 { + if x != nil { + return x.SortOrder + } + return 0 +} + +func (x *BoltListItem) GetPanName() string { + if x != nil { + return x.PanName + } + return "" +} + +func (x *BoltListItem) GetPosition() string { + if x != nil { + return x.Position + } + return "" +} + +func (x *BoltListItem) GetProductId() string { + if x != nil { + return x.ProductId + } + return "" +} + +func (x *BoltListItem) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +type ListBoltViewReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + ProductName string `protobuf:"bytes,3,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + Position string `protobuf:"bytes,4,opt,name=position,proto3" json:"position,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBoltViewReq) Reset() { + *x = ListBoltViewReq{} + mi := &file_inventory_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBoltViewReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBoltViewReq) ProtoMessage() {} + +func (x *ListBoltViewReq) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBoltViewReq.ProtoReflect.Descriptor instead. +func (*ListBoltViewReq) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{27} +} + +func (x *ListBoltViewReq) GetPage() int64 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListBoltViewReq) GetPageSize() int64 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListBoltViewReq) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +func (x *ListBoltViewReq) GetPosition() string { + if x != nil { + return x.Position + } + return "" +} + +type ListBoltViewResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + List []*BoltListItem `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBoltViewResp) Reset() { + *x = ListBoltViewResp{} + mi := &file_inventory_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBoltViewResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBoltViewResp) ProtoMessage() {} + +func (x *ListBoltViewResp) ProtoReflect() protoreflect.Message { + mi := &file_inventory_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBoltViewResp.ProtoReflect.Descriptor instead. +func (*ListBoltViewResp) Descriptor() ([]byte, []int) { + return file_inventory_proto_rawDescGZIP(), []int{28} +} + +func (x *ListBoltViewResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *ListBoltViewResp) GetList() []*BoltListItem { + if x != nil { + return x.List + } + return nil +} + +type ImportProductReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Products []*CreateProductReq `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` + FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` + Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ImportProductReq) Reset() { *x = ImportProductReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ImportProductReq) String() string { @@ -711,8 +1984,8 @@ func (x *ImportProductReq) String() string { func (*ImportProductReq) ProtoMessage() {} func (x *ImportProductReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[29] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -724,7 +1997,7 @@ func (x *ImportProductReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ImportProductReq.ProtoReflect.Descriptor instead. func (*ImportProductReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{7} + return file_inventory_proto_rawDescGZIP(), []int{29} } func (x *ImportProductReq) GetProducts() []*CreateProductReq { @@ -749,24 +2022,21 @@ func (x *ImportProductReq) GetOperator() string { } type ImportProductResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + SuccessCount int64 `protobuf:"varint,2,opt,name=success_count,json=successCount,proto3" json:"success_count,omitempty"` + FailCount int64 `protobuf:"varint,3,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + ErrorMsg string `protobuf:"bytes,4,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` + ImportId string `protobuf:"bytes,5,opt,name=import_id,json=importId,proto3" json:"import_id,omitempty"` unknownFields protoimpl.UnknownFields - - TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - SuccessCount int64 `protobuf:"varint,2,opt,name=success_count,json=successCount,proto3" json:"success_count,omitempty"` - FailCount int64 `protobuf:"varint,3,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` - ErrorMsg string `protobuf:"bytes,4,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` - ImportId string `protobuf:"bytes,5,opt,name=import_id,json=importId,proto3" json:"import_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ImportProductResp) Reset() { *x = ImportProductResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ImportProductResp) String() string { @@ -776,8 +2046,8 @@ func (x *ImportProductResp) String() string { func (*ImportProductResp) ProtoMessage() {} func (x *ImportProductResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[30] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -789,7 +2059,7 @@ func (x *ImportProductResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ImportProductResp.ProtoReflect.Descriptor instead. func (*ImportProductResp) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{8} + return file_inventory_proto_rawDescGZIP(), []int{30} } func (x *ImportProductResp) GetTotalCount() int64 { @@ -828,21 +2098,18 @@ func (x *ImportProductResp) GetImportId() string { } type ListImportLogReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` unknownFields protoimpl.UnknownFields - - Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` - PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListImportLogReq) Reset() { *x = ListImportLogReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListImportLogReq) String() string { @@ -852,8 +2119,8 @@ func (x *ListImportLogReq) String() string { func (*ListImportLogReq) ProtoMessage() {} func (x *ListImportLogReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[31] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -865,7 +2132,7 @@ func (x *ListImportLogReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListImportLogReq.ProtoReflect.Descriptor instead. func (*ListImportLogReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{9} + return file_inventory_proto_rawDescGZIP(), []int{31} } func (x *ListImportLogReq) GetPage() int64 { @@ -883,21 +2150,18 @@ func (x *ListImportLogReq) GetPageSize() int64 { } type ListImportLogResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + List []*ImportLogInfo `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` unknownFields protoimpl.UnknownFields - - Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - List []*ImportLogInfo `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListImportLogResp) Reset() { *x = ListImportLogResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListImportLogResp) String() string { @@ -907,8 +2171,8 @@ func (x *ListImportLogResp) String() string { func (*ListImportLogResp) ProtoMessage() {} func (x *ListImportLogResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[32] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -920,7 +2184,7 @@ func (x *ListImportLogResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListImportLogResp.ProtoReflect.Descriptor instead. func (*ListImportLogResp) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{10} + return file_inventory_proto_rawDescGZIP(), []int{32} } func (x *ListImportLogResp) GetTotal() int64 { @@ -938,27 +2202,24 @@ func (x *ListImportLogResp) GetList() []*ImportLogInfo { } type ImportLogInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ImportId string `protobuf:"bytes,1,opt,name=import_id,json=importId,proto3" json:"import_id,omitempty"` + FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` + TotalCount int64 `protobuf:"varint,3,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + SuccessCount int64 `protobuf:"varint,4,opt,name=success_count,json=successCount,proto3" json:"success_count,omitempty"` + FailCount int64 `protobuf:"varint,5,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + ErrorMsg string `protobuf:"bytes,6,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` + Operator string `protobuf:"bytes,7,opt,name=operator,proto3" json:"operator,omitempty"` + CreatedAt string `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` unknownFields protoimpl.UnknownFields - - ImportId string `protobuf:"bytes,1,opt,name=import_id,json=importId,proto3" json:"import_id,omitempty"` - FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` - TotalCount int64 `protobuf:"varint,3,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - SuccessCount int64 `protobuf:"varint,4,opt,name=success_count,json=successCount,proto3" json:"success_count,omitempty"` - FailCount int64 `protobuf:"varint,5,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` - ErrorMsg string `protobuf:"bytes,6,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` - Operator string `protobuf:"bytes,7,opt,name=operator,proto3" json:"operator,omitempty"` - CreatedAt string `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ImportLogInfo) Reset() { *x = ImportLogInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ImportLogInfo) String() string { @@ -968,8 +2229,8 @@ func (x *ImportLogInfo) String() string { func (*ImportLogInfo) ProtoMessage() {} func (x *ImportLogInfo) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[33] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -981,7 +2242,7 @@ func (x *ImportLogInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ImportLogInfo.ProtoReflect.Descriptor instead. func (*ImportLogInfo) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{11} + return file_inventory_proto_rawDescGZIP(), []int{33} } func (x *ImportLogInfo) GetImportId() string { @@ -1041,18 +2302,16 @@ func (x *ImportLogInfo) GetCreatedAt() string { } type StockSummaryReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockSummaryReq) Reset() { *x = StockSummaryReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockSummaryReq) String() string { @@ -1062,8 +2321,8 @@ func (x *StockSummaryReq) String() string { func (*StockSummaryReq) ProtoMessage() {} func (x *StockSummaryReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[34] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1075,28 +2334,25 @@ func (x *StockSummaryReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StockSummaryReq.ProtoReflect.Descriptor instead. func (*StockSummaryReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{12} + return file_inventory_proto_rawDescGZIP(), []int{34} } type StockSummaryResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProductCount int64 `protobuf:"varint,1,opt,name=product_count,json=productCount,proto3" json:"product_count,omitempty"` - TotalPieces int64 `protobuf:"varint,2,opt,name=total_pieces,json=totalPieces,proto3" json:"total_pieces,omitempty"` - TotalRolls int64 `protobuf:"varint,3,opt,name=total_rolls,json=totalRolls,proto3" json:"total_rolls,omitempty"` - TotalCostValue string `protobuf:"bytes,4,opt,name=total_cost_value,json=totalCostValue,proto3" json:"total_cost_value,omitempty"` - TotalSalesValue string `protobuf:"bytes,5,opt,name=total_sales_value,json=totalSalesValue,proto3" json:"total_sales_value,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ProductCount int64 `protobuf:"varint,1,opt,name=product_count,json=productCount,proto3" json:"product_count,omitempty"` + TotalPieces int64 `protobuf:"varint,2,opt,name=total_pieces,json=totalPieces,proto3" json:"total_pieces,omitempty"` + TotalPans int64 `protobuf:"varint,3,opt,name=total_pans,json=totalPans,proto3" json:"total_pans,omitempty"` + TotalLengthM string `protobuf:"bytes,4,opt,name=total_length_m,json=totalLengthM,proto3" json:"total_length_m,omitempty"` + TotalSalesValue string `protobuf:"bytes,5,opt,name=total_sales_value,json=totalSalesValue,proto3" json:"total_sales_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockSummaryResp) Reset() { *x = StockSummaryResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockSummaryResp) String() string { @@ -1106,8 +2362,8 @@ func (x *StockSummaryResp) String() string { func (*StockSummaryResp) ProtoMessage() {} func (x *StockSummaryResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[35] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1119,7 +2375,7 @@ func (x *StockSummaryResp) ProtoReflect() protoreflect.Message { // Deprecated: Use StockSummaryResp.ProtoReflect.Descriptor instead. func (*StockSummaryResp) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{13} + return file_inventory_proto_rawDescGZIP(), []int{35} } func (x *StockSummaryResp) GetProductCount() int64 { @@ -1136,16 +2392,16 @@ func (x *StockSummaryResp) GetTotalPieces() int64 { return 0 } -func (x *StockSummaryResp) GetTotalRolls() int64 { +func (x *StockSummaryResp) GetTotalPans() int64 { if x != nil { - return x.TotalRolls + return x.TotalPans } return 0 } -func (x *StockSummaryResp) GetTotalCostValue() string { +func (x *StockSummaryResp) GetTotalLengthM() string { if x != nil { - return x.TotalCostValue + return x.TotalLengthM } return "" } @@ -1158,20 +2414,17 @@ func (x *StockSummaryResp) GetTotalSalesValue() string { } type StockGroupReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + GroupBy string `protobuf:"bytes,1,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` unknownFields protoimpl.UnknownFields - - GroupBy string `protobuf:"bytes,1,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StockGroupReq) Reset() { *x = StockGroupReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockGroupReq) String() string { @@ -1181,8 +2434,8 @@ func (x *StockGroupReq) String() string { func (*StockGroupReq) ProtoMessage() {} func (x *StockGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[36] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1194,7 +2447,7 @@ func (x *StockGroupReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StockGroupReq.ProtoReflect.Descriptor instead. func (*StockGroupReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{14} + return file_inventory_proto_rawDescGZIP(), []int{36} } func (x *StockGroupReq) GetGroupBy() string { @@ -1205,22 +2458,19 @@ func (x *StockGroupReq) GetGroupBy() string { } type StockGroupItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Quantity string `protobuf:"bytes,3,opt,name=quantity,proto3" json:"quantity,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - Quantity string `protobuf:"bytes,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StockGroupItem) Reset() { *x = StockGroupItem{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockGroupItem) String() string { @@ -1230,8 +2480,8 @@ func (x *StockGroupItem) String() string { func (*StockGroupItem) ProtoMessage() {} func (x *StockGroupItem) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[37] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1243,7 +2493,7 @@ func (x *StockGroupItem) ProtoReflect() protoreflect.Message { // Deprecated: Use StockGroupItem.ProtoReflect.Descriptor instead. func (*StockGroupItem) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{15} + return file_inventory_proto_rawDescGZIP(), []int{37} } func (x *StockGroupItem) GetName() string { @@ -1268,20 +2518,17 @@ func (x *StockGroupItem) GetQuantity() string { } type StockGroupResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + List []*StockGroupItem `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` unknownFields protoimpl.UnknownFields - - List []*StockGroupItem `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StockGroupResp) Reset() { *x = StockGroupResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockGroupResp) String() string { @@ -1291,8 +2538,8 @@ func (x *StockGroupResp) String() string { func (*StockGroupResp) ProtoMessage() {} func (x *StockGroupResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[38] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1304,7 +2551,7 @@ func (x *StockGroupResp) ProtoReflect() protoreflect.Message { // Deprecated: Use StockGroupResp.ProtoReflect.Descriptor instead. func (*StockGroupResp) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{16} + return file_inventory_proto_rawDescGZIP(), []int{38} } func (x *StockGroupResp) GetList() []*StockGroupItem { @@ -1315,28 +2562,25 @@ func (x *StockGroupResp) GetList() []*StockGroupItem { } type StockCheckInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CheckId string `protobuf:"bytes,1,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` + CheckNo string `protobuf:"bytes,2,opt,name=check_no,json=checkNo,proto3" json:"check_no,omitempty"` + CheckDate string `protobuf:"bytes,3,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` + Checker string `protobuf:"bytes,4,opt,name=checker,proto3" json:"checker,omitempty"` + Status int64 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + Remark string `protobuf:"bytes,6,opt,name=remark,proto3" json:"remark,omitempty"` + CreatedAt string `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt string `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Details []*StockCheckDetailInfo `protobuf:"bytes,9,rep,name=details,proto3" json:"details,omitempty"` unknownFields protoimpl.UnknownFields - - CheckId string `protobuf:"bytes,1,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` - CheckNo string `protobuf:"bytes,2,opt,name=check_no,json=checkNo,proto3" json:"check_no,omitempty"` - CheckDate string `protobuf:"bytes,3,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` - Checker string `protobuf:"bytes,4,opt,name=checker,proto3" json:"checker,omitempty"` - Status int64 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` - Remark string `protobuf:"bytes,6,opt,name=remark,proto3" json:"remark,omitempty"` - CreatedAt string `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt string `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Details []*StockCheckDetailInfo `protobuf:"bytes,9,rep,name=details,proto3" json:"details,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StockCheckInfo) Reset() { *x = StockCheckInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockCheckInfo) String() string { @@ -1346,8 +2590,8 @@ func (x *StockCheckInfo) String() string { func (*StockCheckInfo) ProtoMessage() {} func (x *StockCheckInfo) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[39] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1359,7 +2603,7 @@ func (x *StockCheckInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use StockCheckInfo.ProtoReflect.Descriptor instead. func (*StockCheckInfo) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{17} + return file_inventory_proto_rawDescGZIP(), []int{39} } func (x *StockCheckInfo) GetCheckId() string { @@ -1426,28 +2670,25 @@ func (x *StockCheckInfo) GetDetails() []*StockCheckDetailInfo { } type StockCheckDetailInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DetailId string `protobuf:"bytes,1,opt,name=detail_id,json=detailId,proto3" json:"detail_id,omitempty"` - CheckId string `protobuf:"bytes,2,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` - ProductId string `protobuf:"bytes,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - ProductName string `protobuf:"bytes,4,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` - SystemQuantity string `protobuf:"bytes,5,opt,name=system_quantity,json=systemQuantity,proto3" json:"system_quantity,omitempty"` - ActualQuantity string `protobuf:"bytes,6,opt,name=actual_quantity,json=actualQuantity,proto3" json:"actual_quantity,omitempty"` - DiffQuantity string `protobuf:"bytes,7,opt,name=diff_quantity,json=diffQuantity,proto3" json:"diff_quantity,omitempty"` - DiffAmount string `protobuf:"bytes,8,opt,name=diff_amount,json=diffAmount,proto3" json:"diff_amount,omitempty"` - Remark string `protobuf:"bytes,9,opt,name=remark,proto3" json:"remark,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + DetailId string `protobuf:"bytes,1,opt,name=detail_id,json=detailId,proto3" json:"detail_id,omitempty"` + CheckId string `protobuf:"bytes,2,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` + ProductId string `protobuf:"bytes,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ProductName string `protobuf:"bytes,4,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + SystemQuantity string `protobuf:"bytes,5,opt,name=system_quantity,json=systemQuantity,proto3" json:"system_quantity,omitempty"` + ActualQuantity string `protobuf:"bytes,6,opt,name=actual_quantity,json=actualQuantity,proto3" json:"actual_quantity,omitempty"` + DiffQuantity string `protobuf:"bytes,7,opt,name=diff_quantity,json=diffQuantity,proto3" json:"diff_quantity,omitempty"` + DiffAmount string `protobuf:"bytes,8,opt,name=diff_amount,json=diffAmount,proto3" json:"diff_amount,omitempty"` + Remark string `protobuf:"bytes,9,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockCheckDetailInfo) Reset() { *x = StockCheckDetailInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockCheckDetailInfo) String() string { @@ -1457,8 +2698,8 @@ func (x *StockCheckDetailInfo) String() string { func (*StockCheckDetailInfo) ProtoMessage() {} func (x *StockCheckDetailInfo) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[40] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1470,7 +2711,7 @@ func (x *StockCheckDetailInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use StockCheckDetailInfo.ProtoReflect.Descriptor instead. func (*StockCheckDetailInfo) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{18} + return file_inventory_proto_rawDescGZIP(), []int{40} } func (x *StockCheckDetailInfo) GetDetailId() string { @@ -1537,23 +2778,20 @@ func (x *StockCheckDetailInfo) GetRemark() string { } type CreateStockCheckReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CheckDate string `protobuf:"bytes,1,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` + Checker string `protobuf:"bytes,2,opt,name=checker,proto3" json:"checker,omitempty"` + Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` + Details []*StockCheckDetailReq `protobuf:"bytes,4,rep,name=details,proto3" json:"details,omitempty"` unknownFields protoimpl.UnknownFields - - CheckDate string `protobuf:"bytes,1,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` - Checker string `protobuf:"bytes,2,opt,name=checker,proto3" json:"checker,omitempty"` - Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` - Details []*StockCheckDetailReq `protobuf:"bytes,4,rep,name=details,proto3" json:"details,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CreateStockCheckReq) Reset() { *x = CreateStockCheckReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CreateStockCheckReq) String() string { @@ -1563,8 +2801,8 @@ func (x *CreateStockCheckReq) String() string { func (*CreateStockCheckReq) ProtoMessage() {} func (x *CreateStockCheckReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[41] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1576,7 +2814,7 @@ func (x *CreateStockCheckReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateStockCheckReq.ProtoReflect.Descriptor instead. func (*CreateStockCheckReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{19} + return file_inventory_proto_rawDescGZIP(), []int{41} } func (x *CreateStockCheckReq) GetCheckDate() string { @@ -1608,22 +2846,19 @@ func (x *CreateStockCheckReq) GetDetails() []*StockCheckDetailReq { } type StockCheckDetailReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - ActualQuantity string `protobuf:"bytes,2,opt,name=actual_quantity,json=actualQuantity,proto3" json:"actual_quantity,omitempty"` - Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ActualQuantity string `protobuf:"bytes,2,opt,name=actual_quantity,json=actualQuantity,proto3" json:"actual_quantity,omitempty"` + Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockCheckDetailReq) Reset() { *x = StockCheckDetailReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockCheckDetailReq) String() string { @@ -1633,8 +2868,8 @@ func (x *StockCheckDetailReq) String() string { func (*StockCheckDetailReq) ProtoMessage() {} func (x *StockCheckDetailReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[42] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1646,7 +2881,7 @@ func (x *StockCheckDetailReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StockCheckDetailReq.ProtoReflect.Descriptor instead. func (*StockCheckDetailReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{20} + return file_inventory_proto_rawDescGZIP(), []int{42} } func (x *StockCheckDetailReq) GetProductId() string { @@ -1671,22 +2906,19 @@ func (x *StockCheckDetailReq) GetRemark() string { } type UpdateStockCheckReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CheckId string `protobuf:"bytes,1,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` + Remark string `protobuf:"bytes,2,opt,name=remark,proto3" json:"remark,omitempty"` + Details []*StockCheckDetailReq `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` unknownFields protoimpl.UnknownFields - - CheckId string `protobuf:"bytes,1,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` - Remark string `protobuf:"bytes,2,opt,name=remark,proto3" json:"remark,omitempty"` - Details []*StockCheckDetailReq `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UpdateStockCheckReq) Reset() { *x = UpdateStockCheckReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UpdateStockCheckReq) String() string { @@ -1696,8 +2928,8 @@ func (x *UpdateStockCheckReq) String() string { func (*UpdateStockCheckReq) ProtoMessage() {} func (x *UpdateStockCheckReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[43] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1709,7 +2941,7 @@ func (x *UpdateStockCheckReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateStockCheckReq.ProtoReflect.Descriptor instead. func (*UpdateStockCheckReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{21} + return file_inventory_proto_rawDescGZIP(), []int{43} } func (x *UpdateStockCheckReq) GetCheckId() string { @@ -1734,21 +2966,18 @@ func (x *UpdateStockCheckReq) GetDetails() []*StockCheckDetailReq { } type ConfirmStockCheckReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CheckId string `protobuf:"bytes,1,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` + Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"` unknownFields protoimpl.UnknownFields - - CheckId string `protobuf:"bytes,1,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` - Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ConfirmStockCheckReq) Reset() { *x = ConfirmStockCheckReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ConfirmStockCheckReq) String() string { @@ -1758,8 +2987,8 @@ func (x *ConfirmStockCheckReq) String() string { func (*ConfirmStockCheckReq) ProtoMessage() {} func (x *ConfirmStockCheckReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[44] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1771,7 +3000,7 @@ func (x *ConfirmStockCheckReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfirmStockCheckReq.ProtoReflect.Descriptor instead. func (*ConfirmStockCheckReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{22} + return file_inventory_proto_rawDescGZIP(), []int{44} } func (x *ConfirmStockCheckReq) GetCheckId() string { @@ -1789,20 +3018,17 @@ func (x *ConfirmStockCheckReq) GetOperator() string { } type GetStockCheckReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CheckId string `protobuf:"bytes,1,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` unknownFields protoimpl.UnknownFields - - CheckId string `protobuf:"bytes,1,opt,name=check_id,json=checkId,proto3" json:"check_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetStockCheckReq) Reset() { *x = GetStockCheckReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetStockCheckReq) String() string { @@ -1812,8 +3038,8 @@ func (x *GetStockCheckReq) String() string { func (*GetStockCheckReq) ProtoMessage() {} func (x *GetStockCheckReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[45] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1825,7 +3051,7 @@ func (x *GetStockCheckReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStockCheckReq.ProtoReflect.Descriptor instead. func (*GetStockCheckReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{23} + return file_inventory_proto_rawDescGZIP(), []int{45} } func (x *GetStockCheckReq) GetCheckId() string { @@ -1836,25 +3062,22 @@ func (x *GetStockCheckReq) GetCheckId() string { } type ListStockCheckReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + CheckNo string `protobuf:"bytes,3,opt,name=check_no,json=checkNo,proto3" json:"check_no,omitempty"` + Status int64 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + StartDate string `protobuf:"bytes,5,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` + EndDate string `protobuf:"bytes,6,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` unknownFields protoimpl.UnknownFields - - Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` - PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - CheckNo string `protobuf:"bytes,3,opt,name=check_no,json=checkNo,proto3" json:"check_no,omitempty"` - Status int64 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` - StartDate string `protobuf:"bytes,5,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` - EndDate string `protobuf:"bytes,6,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListStockCheckReq) Reset() { *x = ListStockCheckReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListStockCheckReq) String() string { @@ -1864,8 +3087,8 @@ func (x *ListStockCheckReq) String() string { func (*ListStockCheckReq) ProtoMessage() {} func (x *ListStockCheckReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[46] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1877,7 +3100,7 @@ func (x *ListStockCheckReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListStockCheckReq.ProtoReflect.Descriptor instead. func (*ListStockCheckReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{24} + return file_inventory_proto_rawDescGZIP(), []int{46} } func (x *ListStockCheckReq) GetPage() int64 { @@ -1923,21 +3146,18 @@ func (x *ListStockCheckReq) GetEndDate() string { } type ListStockCheckResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + List []*StockCheckInfo `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` unknownFields protoimpl.UnknownFields - - Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - List []*StockCheckInfo `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListStockCheckResp) Reset() { *x = ListStockCheckResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListStockCheckResp) String() string { @@ -1947,8 +3167,8 @@ func (x *ListStockCheckResp) String() string { func (*ListStockCheckResp) ProtoMessage() {} func (x *ListStockCheckResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[47] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1960,7 +3180,7 @@ func (x *ListStockCheckResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListStockCheckResp.ProtoReflect.Descriptor instead. func (*ListStockCheckResp) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{25} + return file_inventory_proto_rawDescGZIP(), []int{47} } func (x *ListStockCheckResp) GetTotal() int64 { @@ -1978,30 +3198,27 @@ func (x *ListStockCheckResp) GetList() []*StockCheckInfo { } type StockAdjustInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AdjustId string `protobuf:"bytes,1,opt,name=adjust_id,json=adjustId,proto3" json:"adjust_id,omitempty"` + AdjustNo string `protobuf:"bytes,2,opt,name=adjust_no,json=adjustNo,proto3" json:"adjust_no,omitempty"` + AdjustDate string `protobuf:"bytes,3,opt,name=adjust_date,json=adjustDate,proto3" json:"adjust_date,omitempty"` + AdjustReason string `protobuf:"bytes,4,opt,name=adjust_reason,json=adjustReason,proto3" json:"adjust_reason,omitempty"` + Operator string `protobuf:"bytes,5,opt,name=operator,proto3" json:"operator,omitempty"` + Approver string `protobuf:"bytes,6,opt,name=approver,proto3" json:"approver,omitempty"` + Status int64 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` + Remark string `protobuf:"bytes,8,opt,name=remark,proto3" json:"remark,omitempty"` + CreatedAt string `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt string `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Details []*StockAdjustDetailInfo `protobuf:"bytes,11,rep,name=details,proto3" json:"details,omitempty"` unknownFields protoimpl.UnknownFields - - AdjustId string `protobuf:"bytes,1,opt,name=adjust_id,json=adjustId,proto3" json:"adjust_id,omitempty"` - AdjustNo string `protobuf:"bytes,2,opt,name=adjust_no,json=adjustNo,proto3" json:"adjust_no,omitempty"` - AdjustDate string `protobuf:"bytes,3,opt,name=adjust_date,json=adjustDate,proto3" json:"adjust_date,omitempty"` - AdjustReason string `protobuf:"bytes,4,opt,name=adjust_reason,json=adjustReason,proto3" json:"adjust_reason,omitempty"` - Operator string `protobuf:"bytes,5,opt,name=operator,proto3" json:"operator,omitempty"` - Approver string `protobuf:"bytes,6,opt,name=approver,proto3" json:"approver,omitempty"` - Status int64 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` - Remark string `protobuf:"bytes,8,opt,name=remark,proto3" json:"remark,omitempty"` - CreatedAt string `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt string `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Details []*StockAdjustDetailInfo `protobuf:"bytes,11,rep,name=details,proto3" json:"details,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StockAdjustInfo) Reset() { *x = StockAdjustInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockAdjustInfo) String() string { @@ -2011,8 +3228,8 @@ func (x *StockAdjustInfo) String() string { func (*StockAdjustInfo) ProtoMessage() {} func (x *StockAdjustInfo) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[48] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2024,7 +3241,7 @@ func (x *StockAdjustInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use StockAdjustInfo.ProtoReflect.Descriptor instead. func (*StockAdjustInfo) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{26} + return file_inventory_proto_rawDescGZIP(), []int{48} } func (x *StockAdjustInfo) GetAdjustId() string { @@ -2105,27 +3322,24 @@ func (x *StockAdjustInfo) GetDetails() []*StockAdjustDetailInfo { } type StockAdjustDetailInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DetailId string `protobuf:"bytes,1,opt,name=detail_id,json=detailId,proto3" json:"detail_id,omitempty"` - AdjustId string `protobuf:"bytes,2,opt,name=adjust_id,json=adjustId,proto3" json:"adjust_id,omitempty"` - ProductId string `protobuf:"bytes,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - ProductName string `protobuf:"bytes,4,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` - BeforeQuantity string `protobuf:"bytes,5,opt,name=before_quantity,json=beforeQuantity,proto3" json:"before_quantity,omitempty"` - AdjustQuantity string `protobuf:"bytes,6,opt,name=adjust_quantity,json=adjustQuantity,proto3" json:"adjust_quantity,omitempty"` - AfterQuantity string `protobuf:"bytes,7,opt,name=after_quantity,json=afterQuantity,proto3" json:"after_quantity,omitempty"` - Remark string `protobuf:"bytes,8,opt,name=remark,proto3" json:"remark,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + DetailId string `protobuf:"bytes,1,opt,name=detail_id,json=detailId,proto3" json:"detail_id,omitempty"` + AdjustId string `protobuf:"bytes,2,opt,name=adjust_id,json=adjustId,proto3" json:"adjust_id,omitempty"` + ProductId string `protobuf:"bytes,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ProductName string `protobuf:"bytes,4,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + BeforeQuantity string `protobuf:"bytes,5,opt,name=before_quantity,json=beforeQuantity,proto3" json:"before_quantity,omitempty"` + AdjustQuantity string `protobuf:"bytes,6,opt,name=adjust_quantity,json=adjustQuantity,proto3" json:"adjust_quantity,omitempty"` + AfterQuantity string `protobuf:"bytes,7,opt,name=after_quantity,json=afterQuantity,proto3" json:"after_quantity,omitempty"` + Remark string `protobuf:"bytes,8,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockAdjustDetailInfo) Reset() { *x = StockAdjustDetailInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockAdjustDetailInfo) String() string { @@ -2135,8 +3349,8 @@ func (x *StockAdjustDetailInfo) String() string { func (*StockAdjustDetailInfo) ProtoMessage() {} func (x *StockAdjustDetailInfo) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[49] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2148,7 +3362,7 @@ func (x *StockAdjustDetailInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use StockAdjustDetailInfo.ProtoReflect.Descriptor instead. func (*StockAdjustDetailInfo) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{27} + return file_inventory_proto_rawDescGZIP(), []int{49} } func (x *StockAdjustDetailInfo) GetDetailId() string { @@ -2208,24 +3422,21 @@ func (x *StockAdjustDetailInfo) GetRemark() string { } type CreateStockAdjustReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AdjustDate string `protobuf:"bytes,1,opt,name=adjust_date,json=adjustDate,proto3" json:"adjust_date,omitempty"` + AdjustReason string `protobuf:"bytes,2,opt,name=adjust_reason,json=adjustReason,proto3" json:"adjust_reason,omitempty"` + Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` + Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` + Details []*StockAdjustDetailReq `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"` unknownFields protoimpl.UnknownFields - - AdjustDate string `protobuf:"bytes,1,opt,name=adjust_date,json=adjustDate,proto3" json:"adjust_date,omitempty"` - AdjustReason string `protobuf:"bytes,2,opt,name=adjust_reason,json=adjustReason,proto3" json:"adjust_reason,omitempty"` - Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` - Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` - Details []*StockAdjustDetailReq `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CreateStockAdjustReq) Reset() { *x = CreateStockAdjustReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CreateStockAdjustReq) String() string { @@ -2235,8 +3446,8 @@ func (x *CreateStockAdjustReq) String() string { func (*CreateStockAdjustReq) ProtoMessage() {} func (x *CreateStockAdjustReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[50] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2248,7 +3459,7 @@ func (x *CreateStockAdjustReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateStockAdjustReq.ProtoReflect.Descriptor instead. func (*CreateStockAdjustReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{28} + return file_inventory_proto_rawDescGZIP(), []int{50} } func (x *CreateStockAdjustReq) GetAdjustDate() string { @@ -2287,22 +3498,19 @@ func (x *CreateStockAdjustReq) GetDetails() []*StockAdjustDetailReq { } type StockAdjustDetailReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - AdjustQuantity string `protobuf:"bytes,2,opt,name=adjust_quantity,json=adjustQuantity,proto3" json:"adjust_quantity,omitempty"` - Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + AdjustQuantity string `protobuf:"bytes,2,opt,name=adjust_quantity,json=adjustQuantity,proto3" json:"adjust_quantity,omitempty"` + Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockAdjustDetailReq) Reset() { *x = StockAdjustDetailReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockAdjustDetailReq) String() string { @@ -2312,8 +3520,8 @@ func (x *StockAdjustDetailReq) String() string { func (*StockAdjustDetailReq) ProtoMessage() {} func (x *StockAdjustDetailReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[51] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2325,7 +3533,7 @@ func (x *StockAdjustDetailReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StockAdjustDetailReq.ProtoReflect.Descriptor instead. func (*StockAdjustDetailReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{29} + return file_inventory_proto_rawDescGZIP(), []int{51} } func (x *StockAdjustDetailReq) GetProductId() string { @@ -2350,22 +3558,19 @@ func (x *StockAdjustDetailReq) GetRemark() string { } type ApproveStockAdjustReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AdjustId string `protobuf:"bytes,1,opt,name=adjust_id,json=adjustId,proto3" json:"adjust_id,omitempty"` + Approver string `protobuf:"bytes,2,opt,name=approver,proto3" json:"approver,omitempty"` + Action int64 `protobuf:"varint,3,opt,name=action,proto3" json:"action,omitempty"` unknownFields protoimpl.UnknownFields - - AdjustId string `protobuf:"bytes,1,opt,name=adjust_id,json=adjustId,proto3" json:"adjust_id,omitempty"` - Approver string `protobuf:"bytes,2,opt,name=approver,proto3" json:"approver,omitempty"` - Action int64 `protobuf:"varint,3,opt,name=action,proto3" json:"action,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ApproveStockAdjustReq) Reset() { *x = ApproveStockAdjustReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ApproveStockAdjustReq) String() string { @@ -2375,8 +3580,8 @@ func (x *ApproveStockAdjustReq) String() string { func (*ApproveStockAdjustReq) ProtoMessage() {} func (x *ApproveStockAdjustReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[52] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2388,7 +3593,7 @@ func (x *ApproveStockAdjustReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveStockAdjustReq.ProtoReflect.Descriptor instead. func (*ApproveStockAdjustReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{30} + return file_inventory_proto_rawDescGZIP(), []int{52} } func (x *ApproveStockAdjustReq) GetAdjustId() string { @@ -2413,20 +3618,17 @@ func (x *ApproveStockAdjustReq) GetAction() int64 { } type GetStockAdjustReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AdjustId string `protobuf:"bytes,1,opt,name=adjust_id,json=adjustId,proto3" json:"adjust_id,omitempty"` unknownFields protoimpl.UnknownFields - - AdjustId string `protobuf:"bytes,1,opt,name=adjust_id,json=adjustId,proto3" json:"adjust_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetStockAdjustReq) Reset() { *x = GetStockAdjustReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetStockAdjustReq) String() string { @@ -2436,8 +3638,8 @@ func (x *GetStockAdjustReq) String() string { func (*GetStockAdjustReq) ProtoMessage() {} func (x *GetStockAdjustReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[53] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2449,7 +3651,7 @@ func (x *GetStockAdjustReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStockAdjustReq.ProtoReflect.Descriptor instead. func (*GetStockAdjustReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{31} + return file_inventory_proto_rawDescGZIP(), []int{53} } func (x *GetStockAdjustReq) GetAdjustId() string { @@ -2460,26 +3662,23 @@ func (x *GetStockAdjustReq) GetAdjustId() string { } type ListStockAdjustReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + AdjustNo string `protobuf:"bytes,3,opt,name=adjust_no,json=adjustNo,proto3" json:"adjust_no,omitempty"` + AdjustReason string `protobuf:"bytes,4,opt,name=adjust_reason,json=adjustReason,proto3" json:"adjust_reason,omitempty"` + Status int64 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + StartDate string `protobuf:"bytes,6,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` + EndDate string `protobuf:"bytes,7,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` unknownFields protoimpl.UnknownFields - - Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` - PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - AdjustNo string `protobuf:"bytes,3,opt,name=adjust_no,json=adjustNo,proto3" json:"adjust_no,omitempty"` - AdjustReason string `protobuf:"bytes,4,opt,name=adjust_reason,json=adjustReason,proto3" json:"adjust_reason,omitempty"` - Status int64 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` - StartDate string `protobuf:"bytes,6,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` - EndDate string `protobuf:"bytes,7,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListStockAdjustReq) Reset() { *x = ListStockAdjustReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListStockAdjustReq) String() string { @@ -2489,8 +3688,8 @@ func (x *ListStockAdjustReq) String() string { func (*ListStockAdjustReq) ProtoMessage() {} func (x *ListStockAdjustReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[54] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2502,7 +3701,7 @@ func (x *ListStockAdjustReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListStockAdjustReq.ProtoReflect.Descriptor instead. func (*ListStockAdjustReq) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{32} + return file_inventory_proto_rawDescGZIP(), []int{54} } func (x *ListStockAdjustReq) GetPage() int64 { @@ -2555,21 +3754,18 @@ func (x *ListStockAdjustReq) GetEndDate() string { } type ListStockAdjustResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + List []*StockAdjustInfo `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` unknownFields protoimpl.UnknownFields - - Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - List []*StockAdjustInfo `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListStockAdjustResp) Reset() { *x = ListStockAdjustResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListStockAdjustResp) String() string { @@ -2579,8 +3775,8 @@ func (x *ListStockAdjustResp) String() string { func (*ListStockAdjustResp) ProtoMessage() {} func (x *ListStockAdjustResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[55] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2592,7 +3788,7 @@ func (x *ListStockAdjustResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListStockAdjustResp.ProtoReflect.Descriptor instead. func (*ListStockAdjustResp) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{33} + return file_inventory_proto_rawDescGZIP(), []int{55} } func (x *ListStockAdjustResp) GetTotal() int64 { @@ -2610,20 +3806,17 @@ func (x *ListStockAdjustResp) GetList() []*StockAdjustInfo { } type IdResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *IdResp) Reset() { *x = IdResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *IdResp) String() string { @@ -2633,8 +3826,8 @@ func (x *IdResp) String() string { func (*IdResp) ProtoMessage() {} func (x *IdResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[56] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2646,7 +3839,7 @@ func (x *IdResp) ProtoReflect() protoreflect.Message { // Deprecated: Use IdResp.ProtoReflect.Descriptor instead. func (*IdResp) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{34} + return file_inventory_proto_rawDescGZIP(), []int{56} } func (x *IdResp) GetId() string { @@ -2657,18 +3850,16 @@ func (x *IdResp) GetId() string { } type Empty struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Empty) Reset() { *x = Empty{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_inventory_inventory_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_inventory_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Empty) String() string { @@ -2678,8 +3869,8 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_rpc_inventory_inventory_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_inventory_proto_msgTypes[57] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2691,1015 +3882,549 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_rpc_inventory_inventory_proto_rawDescGZIP(), []int{35} + return file_inventory_proto_rawDescGZIP(), []int{57} } -var File_rpc_inventory_inventory_proto protoreflect.FileDescriptor +var File_inventory_proto protoreflect.FileDescriptor -var file_rpc_inventory_inventory_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x22, 0xc7, 0x03, 0x0a, 0x0b, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, - 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, - 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, - 0x6c, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x69, 0x65, 0x63, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x75, 0x6e, 0x69, 0x74, 0x50, 0x69, - 0x65, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6c, - 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x6e, 0x69, 0x74, 0x52, 0x6f, - 0x6c, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x5f, 0x71, 0x75, 0x61, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x73, 0x74, 0x5f, 0x70, - 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x5f, 0x70, - 0x72, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x61, 0x6c, 0x65, - 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x22, 0xd7, 0x02, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, - 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, - 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, - 0x6c, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x69, 0x65, 0x63, - 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x75, 0x6e, 0x69, 0x74, 0x50, 0x69, - 0x65, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6c, - 0x6c, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x6e, 0x69, 0x74, 0x52, 0x6f, - 0x6c, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x5f, 0x71, 0x75, 0x61, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x73, 0x74, 0x5f, 0x70, - 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x5f, 0x70, - 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x61, 0x6c, 0x65, - 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xf6, - 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, - 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, - 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, - 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0a, 0x75, 0x6e, 0x69, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, - 0x0a, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x75, 0x6e, 0x69, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x51, 0x75, 0x61, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x31, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x0d, 0x47, 0x65, - 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x22, 0xc2, 0x01, 0x0a, 0x0e, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, - 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x21, - 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, - 0x53, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, - 0x6c, 0x69, 0x73, 0x74, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x37, 0x0a, 0x08, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xb2, 0x01, 0x0a, 0x11, - 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x61, 0x69, 0x6c, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x61, 0x69, - 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, - 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x4d, 0x73, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, - 0x22, 0x43, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, - 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x57, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x86, - 0x02, 0x0a, 0x0d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, - 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0c, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1a, 0x0a, 0x08, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x63, 0x6b, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x22, 0xd1, 0x01, 0x0a, 0x10, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x69, - 0x65, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x72, 0x6f, 0x6c, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x52, 0x6f, 0x6c, 0x6c, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x73, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x61, 0x6c, 0x65, - 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2a, - 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, - 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x22, 0x56, 0x0a, 0x0e, 0x53, 0x74, - 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x22, 0x3f, 0x0a, 0x0e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x6c, - 0x69, 0x73, 0x74, 0x22, 0xa8, 0x02, 0x0a, 0x0e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x49, - 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x6e, 0x6f, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x4e, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x09, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xc0, - 0x02, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x21, - 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x71, 0x75, 0x61, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, - 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x51, 0x75, 0x61, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x71, 0x75, 0x61, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x66, 0x66, - 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x66, 0x66, - 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, - 0x69, 0x66, 0x66, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, - 0x61, 0x72, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x22, 0xa0, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, - 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x38, 0x0a, 0x07, 0x64, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x52, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x22, 0x75, 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, - 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x51, 0x75, 0x61, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x82, 0x01, 0x0a, 0x13, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x38, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x22, 0x4d, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x63, 0x6b, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, - 0x2d, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x64, 0x22, 0xb1, - 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x6e, - 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x4e, 0x6f, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x64, - 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, - 0x74, 0x65, 0x22, 0x59, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2d, - 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xf3, 0x02, - 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x4e, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x61, - 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, - 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x22, 0xa4, 0x02, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, - 0x75, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, - 0x09, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x64, - 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, - 0x64, 0x6a, 0x75, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x62, 0x65, 0x66, - 0x6f, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x71, 0x75, 0x61, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x64, 0x6a, - 0x75, 0x73, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x61, - 0x66, 0x74, 0x65, 0x72, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x66, 0x74, 0x65, 0x72, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xcb, 0x01, 0x0a, 0x14, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x64, 0x61, - 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, - 0x44, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x64, 0x6a, - 0x75, 0x73, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x39, 0x0a, - 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, - 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x52, - 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x76, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x63, - 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, - 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, - 0x27, 0x0a, 0x0f, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, - 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x22, 0x68, 0x0a, 0x15, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, - 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x64, 0x6a, - 0x75, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x64, - 0x6a, 0x75, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, - 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x30, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, - 0x1b, 0x0a, 0x09, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x49, 0x64, 0x22, 0xd9, 0x01, 0x0a, - 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x6e, - 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x4e, - 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, - 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, - 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x22, 0x5b, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x18, 0x0a, 0x06, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0xa2, 0x0a, 0x0a, 0x10, 0x49, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, - 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x1b, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, - 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, - 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3e, - 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, - 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3e, - 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x18, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x19, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x4b, 0x0a, 0x0e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x12, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, - 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x4a, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4c, - 0x6f, 0x67, 0x12, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x1a, - 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x12, 0x1a, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, - 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x53, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x0d, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x45, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x12, 0x1e, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, - 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1e, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, - 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x11, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, - 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, - 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, - 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, - 0x6f, 0x63, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a, 0x11, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, - 0x74, 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x49, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x12, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, - 0x4a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, - 0x74, 0x12, 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, - 0x1a, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x6f, 0x63, - 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x50, 0x0a, 0x0f, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x12, 0x1d, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, - 0x6f, 0x63, 0x6b, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_inventory_proto_rawDesc = "" + + "\n" + + "\x0finventory.proto\x12\tinventory\"\xa5\x02\n" + + "\vProductInfo\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12!\n" + + "\fproduct_name\x18\x02 \x01(\tR\vproductName\x12\x1b\n" + + "\timage_url\x18\x03 \x01(\tR\bimageUrl\x12\x12\n" + + "\x04spec\x18\x04 \x01(\tR\x04spec\x12\x14\n" + + "\x05color\x18\x05 \x01(\tR\x05color\x12\x1f\n" + + "\vsales_price\x18\x06 \x01(\tR\n" + + "salesPrice\x12\x16\n" + + "\x06remark\x18\a \x01(\tR\x06remark\x12\x16\n" + + "\x06status\x18\b \x01(\x03R\x06status\x12\x1d\n" + + "\n" + + "created_at\x18\t \x01(\tR\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\n" + + " \x01(\tR\tupdatedAt\"\xde\x01\n" + + "\x10CreateProductReq\x12!\n" + + "\fproduct_name\x18\x01 \x01(\tR\vproductName\x12\x1b\n" + + "\timage_url\x18\x02 \x01(\tR\bimageUrl\x12\x12\n" + + "\x04spec\x18\x03 \x01(\tR\x04spec\x12\x14\n" + + "\x05color\x18\x04 \x01(\tR\x05color\x12\x1f\n" + + "\vsales_price\x18\x05 \x01(\tR\n" + + "salesPrice\x12\x16\n" + + "\x06remark\x18\x06 \x01(\tR\x06remark\x12'\n" + + "\x04pans\x18\a \x03(\v2\x13.inventory.PanInputR\x04pans\"\xd4\x01\n" + + "\x10UpdateProductReq\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12!\n" + + "\fproduct_name\x18\x02 \x01(\tR\vproductName\x12\x1b\n" + + "\timage_url\x18\x03 \x01(\tR\bimageUrl\x12\x12\n" + + "\x04spec\x18\x04 \x01(\tR\x04spec\x12\x14\n" + + "\x05color\x18\x05 \x01(\tR\x05color\x12\x1f\n" + + "\vsales_price\x18\x06 \x01(\tR\n" + + "salesPrice\x12\x16\n" + + "\x06remark\x18\a \x01(\tR\x06remark\"1\n" + + "\x10DeleteProductReq\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\".\n" + + "\rGetProductReq\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\"\xa6\x01\n" + + "\x0eListProductReq\x12\x12\n" + + "\x04page\x18\x01 \x01(\x03R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x03R\bpageSize\x12!\n" + + "\fproduct_name\x18\x03 \x01(\tR\vproductName\x12\x12\n" + + "\x04spec\x18\x04 \x01(\tR\x04spec\x12\x14\n" + + "\x05color\x18\x05 \x01(\tR\x05color\x12\x16\n" + + "\x06status\x18\x06 \x01(\x03R\x06status\"S\n" + + "\x0fListProductResp\x12\x14\n" + + "\x05total\x18\x01 \x01(\x03R\x05total\x12*\n" + + "\x04list\x18\x02 \x03(\v2\x16.inventory.ProductInfoR\x04list\"\xfb\x01\n" + + "\aPanInfo\x12\x15\n" + + "\x06pan_id\x18\x01 \x01(\tR\x05panId\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\tR\tproductId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x1a\n" + + "\bposition\x18\x04 \x01(\tR\bposition\x12\x1d\n" + + "\n" + + "sort_order\x18\x05 \x01(\x03R\tsortOrder\x12)\n" + + "\x05bolts\x18\x06 \x03(\v2\x13.inventory.BoltInfoR\x05bolts\x12\x1d\n" + + "\n" + + "bolt_count\x18\a \x01(\x03R\tboltCount\x12!\n" + + "\ftotal_length\x18\b \x01(\tR\vtotalLength\"]\n" + + "\bPanInput\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1a\n" + + "\bposition\x18\x02 \x01(\tR\bposition\x12!\n" + + "\fbolt_lengths\x18\x03 \x03(\tR\vboltLengths\"+\n" + + "\n" + + "ListPanReq\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\"5\n" + + "\vListPanResp\x12&\n" + + "\x04list\x18\x01 \x03(\v2\x12.inventory.PanInfoR\x04list\"U\n" + + "\vSavePansReq\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12'\n" + + "\x04pans\x18\x02 \x03(\v2\x13.inventory.PanInputR\x04pans\"t\n" + + "\bBoltInfo\x12\x17\n" + + "\abolt_id\x18\x01 \x01(\tR\x06boltId\x12\x15\n" + + "\x06pan_id\x18\x02 \x01(\tR\x05panId\x12\x19\n" + + "\blength_m\x18\x03 \x01(\tR\alengthM\x12\x1d\n" + + "\n" + + "sort_order\x18\x04 \x01(\x03R\tsortOrder\"$\n" + + "\vListBoltReq\x12\x15\n" + + "\x06pan_id\x18\x01 \x01(\tR\x05panId\"7\n" + + "\fListBoltResp\x12'\n" + + "\x04list\x18\x01 \x03(\v2\x13.inventory.BoltInfoR\x04list\"?\n" + + "\fSaveBoltsReq\x12\x15\n" + + "\x06pan_id\x18\x01 \x01(\tR\x05panId\x12\x18\n" + + "\alengths\x18\x02 \x03(\tR\alengths\"\xe3\x01\n" + + "\x0fProductTreeResp\x120\n" + + "\aproduct\x18\x01 \x01(\v2\x16.inventory.ProductInfoR\aproduct\x12&\n" + + "\x04pans\x18\x02 \x03(\v2\x12.inventory.PanInfoR\x04pans\x12&\n" + + "\x0ftotal_pan_count\x18\x03 \x01(\x03R\rtotalPanCount\x12(\n" + + "\x10total_bolt_count\x18\x04 \x01(\x03R\x0etotalBoltCount\x12$\n" + + "\x0etotal_length_m\x18\x05 \x01(\tR\ftotalLengthM\"\x9a\x02\n" + + "\x12ProductSummaryItem\x12!\n" + + "\fproduct_name\x18\x01 \x01(\tR\vproductName\x12\x12\n" + + "\x04spec\x18\x02 \x01(\tR\x04spec\x12\x1f\n" + + "\vcolor_count\x18\x03 \x01(\x03R\n" + + "colorCount\x12&\n" + + "\x0ftotal_pan_count\x18\x04 \x01(\x03R\rtotalPanCount\x12(\n" + + "\x10total_bolt_count\x18\x05 \x01(\x03R\x0etotalBoltCount\x12$\n" + + "\x0etotal_length_m\x18\x06 \x01(\tR\ftotalLengthM\x12\x16\n" + + "\x06colors\x18\a \x01(\tR\x06colors\x12\x1c\n" + + "\tlocations\x18\b \x01(\tR\tlocations\"\x17\n" + + "\x15ListProductSummaryReq\"K\n" + + "\x16ListProductSummaryResp\x121\n" + + "\x04list\x18\x01 \x03(\v2\x1d.inventory.ProductSummaryItemR\x04list\"\xbb\x02\n" + + "\x0fColorDetailItem\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12!\n" + + "\fproduct_name\x18\x02 \x01(\tR\vproductName\x12\x14\n" + + "\x05color\x18\x03 \x01(\tR\x05color\x12\x12\n" + + "\x04spec\x18\x04 \x01(\tR\x04spec\x12\x1b\n" + + "\timage_url\x18\x05 \x01(\tR\bimageUrl\x12\x1b\n" + + "\tpan_count\x18\x06 \x01(\x03R\bpanCount\x12\x1d\n" + + "\n" + + "bolt_count\x18\a \x01(\x03R\tboltCount\x12$\n" + + "\x0etotal_length_m\x18\b \x01(\tR\ftotalLengthM\x12\x1c\n" + + "\tlocations\x18\t \x01(\tR\tlocations\x12\x1f\n" + + "\vsales_price\x18\n" + + " \x01(\tR\n" + + "salesPrice\"7\n" + + "\x12ListColorDetailReq\x12!\n" + + "\fproduct_name\x18\x01 \x01(\tR\vproductName\"E\n" + + "\x13ListColorDetailResp\x12.\n" + + "\x04list\x18\x01 \x03(\v2\x1a.inventory.ColorDetailItemR\x04list\"\xf3\x01\n" + + "\vPanListItem\x12\x15\n" + + "\x06pan_id\x18\x01 \x01(\tR\x05panId\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\tR\tproductId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x1a\n" + + "\bposition\x18\x04 \x01(\tR\bposition\x12!\n" + + "\fproduct_name\x18\x05 \x01(\tR\vproductName\x12\x16\n" + + "\x06colors\x18\x06 \x01(\tR\x06colors\x12\x1d\n" + + "\n" + + "bolt_count\x18\a \x01(\x03R\tboltCount\x12$\n" + + "\x0etotal_length_m\x18\b \x01(\tR\ftotalLengthM\"\x80\x01\n" + + "\x0eListPanViewReq\x12\x12\n" + + "\x04page\x18\x01 \x01(\x03R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x03R\bpageSize\x12!\n" + + "\fproduct_name\x18\x03 \x01(\tR\vproductName\x12\x1a\n" + + "\bposition\x18\x04 \x01(\tR\bposition\"S\n" + + "\x0fListPanViewResp\x12\x14\n" + + "\x05total\x18\x01 \x01(\x03R\x05total\x12*\n" + + "\x04list\x18\x02 \x03(\v2\x16.inventory.PanListItemR\x04list\"\x87\x02\n" + + "\fBoltListItem\x12\x17\n" + + "\abolt_id\x18\x01 \x01(\tR\x06boltId\x12\x15\n" + + "\x06pan_id\x18\x02 \x01(\tR\x05panId\x12\x19\n" + + "\blength_m\x18\x03 \x01(\tR\alengthM\x12\x14\n" + + "\x05color\x18\x04 \x01(\tR\x05color\x12\x1d\n" + + "\n" + + "sort_order\x18\x05 \x01(\x03R\tsortOrder\x12\x19\n" + + "\bpan_name\x18\x06 \x01(\tR\apanName\x12\x1a\n" + + "\bposition\x18\a \x01(\tR\bposition\x12\x1d\n" + + "\n" + + "product_id\x18\b \x01(\tR\tproductId\x12!\n" + + "\fproduct_name\x18\t \x01(\tR\vproductName\"\x81\x01\n" + + "\x0fListBoltViewReq\x12\x12\n" + + "\x04page\x18\x01 \x01(\x03R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x03R\bpageSize\x12!\n" + + "\fproduct_name\x18\x03 \x01(\tR\vproductName\x12\x1a\n" + + "\bposition\x18\x04 \x01(\tR\bposition\"U\n" + + "\x10ListBoltViewResp\x12\x14\n" + + "\x05total\x18\x01 \x01(\x03R\x05total\x12+\n" + + "\x04list\x18\x02 \x03(\v2\x17.inventory.BoltListItemR\x04list\"\x84\x01\n" + + "\x10ImportProductReq\x127\n" + + "\bproducts\x18\x01 \x03(\v2\x1b.inventory.CreateProductReqR\bproducts\x12\x1b\n" + + "\tfile_name\x18\x02 \x01(\tR\bfileName\x12\x1a\n" + + "\boperator\x18\x03 \x01(\tR\boperator\"\xb2\x01\n" + + "\x11ImportProductResp\x12\x1f\n" + + "\vtotal_count\x18\x01 \x01(\x03R\n" + + "totalCount\x12#\n" + + "\rsuccess_count\x18\x02 \x01(\x03R\fsuccessCount\x12\x1d\n" + + "\n" + + "fail_count\x18\x03 \x01(\x03R\tfailCount\x12\x1b\n" + + "\terror_msg\x18\x04 \x01(\tR\berrorMsg\x12\x1b\n" + + "\timport_id\x18\x05 \x01(\tR\bimportId\"C\n" + + "\x10ListImportLogReq\x12\x12\n" + + "\x04page\x18\x01 \x01(\x03R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x03R\bpageSize\"W\n" + + "\x11ListImportLogResp\x12\x14\n" + + "\x05total\x18\x01 \x01(\x03R\x05total\x12,\n" + + "\x04list\x18\x02 \x03(\v2\x18.inventory.ImportLogInfoR\x04list\"\x86\x02\n" + + "\rImportLogInfo\x12\x1b\n" + + "\timport_id\x18\x01 \x01(\tR\bimportId\x12\x1b\n" + + "\tfile_name\x18\x02 \x01(\tR\bfileName\x12\x1f\n" + + "\vtotal_count\x18\x03 \x01(\x03R\n" + + "totalCount\x12#\n" + + "\rsuccess_count\x18\x04 \x01(\x03R\fsuccessCount\x12\x1d\n" + + "\n" + + "fail_count\x18\x05 \x01(\x03R\tfailCount\x12\x1b\n" + + "\terror_msg\x18\x06 \x01(\tR\berrorMsg\x12\x1a\n" + + "\boperator\x18\a \x01(\tR\boperator\x12\x1d\n" + + "\n" + + "created_at\x18\b \x01(\tR\tcreatedAt\"\x11\n" + + "\x0fStockSummaryReq\"\xcb\x01\n" + + "\x10StockSummaryResp\x12#\n" + + "\rproduct_count\x18\x01 \x01(\x03R\fproductCount\x12!\n" + + "\ftotal_pieces\x18\x02 \x01(\x03R\vtotalPieces\x12\x1d\n" + + "\n" + + "total_pans\x18\x03 \x01(\x03R\ttotalPans\x12$\n" + + "\x0etotal_length_m\x18\x04 \x01(\tR\ftotalLengthM\x12*\n" + + "\x11total_sales_value\x18\x05 \x01(\tR\x0ftotalSalesValue\"*\n" + + "\rStockGroupReq\x12\x19\n" + + "\bgroup_by\x18\x01 \x01(\tR\agroupBy\"V\n" + + "\x0eStockGroupItem\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05count\x18\x02 \x01(\x03R\x05count\x12\x1a\n" + + "\bquantity\x18\x03 \x01(\tR\bquantity\"?\n" + + "\x0eStockGroupResp\x12-\n" + + "\x04list\x18\x01 \x03(\v2\x19.inventory.StockGroupItemR\x04list\"\xa8\x02\n" + + "\x0eStockCheckInfo\x12\x19\n" + + "\bcheck_id\x18\x01 \x01(\tR\acheckId\x12\x19\n" + + "\bcheck_no\x18\x02 \x01(\tR\acheckNo\x12\x1d\n" + + "\n" + + "check_date\x18\x03 \x01(\tR\tcheckDate\x12\x18\n" + + "\achecker\x18\x04 \x01(\tR\achecker\x12\x16\n" + + "\x06status\x18\x05 \x01(\x03R\x06status\x12\x16\n" + + "\x06remark\x18\x06 \x01(\tR\x06remark\x12\x1d\n" + + "\n" + + "created_at\x18\a \x01(\tR\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\b \x01(\tR\tupdatedAt\x129\n" + + "\adetails\x18\t \x03(\v2\x1f.inventory.StockCheckDetailInfoR\adetails\"\xc0\x02\n" + + "\x14StockCheckDetailInfo\x12\x1b\n" + + "\tdetail_id\x18\x01 \x01(\tR\bdetailId\x12\x19\n" + + "\bcheck_id\x18\x02 \x01(\tR\acheckId\x12\x1d\n" + + "\n" + + "product_id\x18\x03 \x01(\tR\tproductId\x12!\n" + + "\fproduct_name\x18\x04 \x01(\tR\vproductName\x12'\n" + + "\x0fsystem_quantity\x18\x05 \x01(\tR\x0esystemQuantity\x12'\n" + + "\x0factual_quantity\x18\x06 \x01(\tR\x0eactualQuantity\x12#\n" + + "\rdiff_quantity\x18\a \x01(\tR\fdiffQuantity\x12\x1f\n" + + "\vdiff_amount\x18\b \x01(\tR\n" + + "diffAmount\x12\x16\n" + + "\x06remark\x18\t \x01(\tR\x06remark\"\xa0\x01\n" + + "\x13CreateStockCheckReq\x12\x1d\n" + + "\n" + + "check_date\x18\x01 \x01(\tR\tcheckDate\x12\x18\n" + + "\achecker\x18\x02 \x01(\tR\achecker\x12\x16\n" + + "\x06remark\x18\x03 \x01(\tR\x06remark\x128\n" + + "\adetails\x18\x04 \x03(\v2\x1e.inventory.StockCheckDetailReqR\adetails\"u\n" + + "\x13StockCheckDetailReq\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12'\n" + + "\x0factual_quantity\x18\x02 \x01(\tR\x0eactualQuantity\x12\x16\n" + + "\x06remark\x18\x03 \x01(\tR\x06remark\"\x82\x01\n" + + "\x13UpdateStockCheckReq\x12\x19\n" + + "\bcheck_id\x18\x01 \x01(\tR\acheckId\x12\x16\n" + + "\x06remark\x18\x02 \x01(\tR\x06remark\x128\n" + + "\adetails\x18\x03 \x03(\v2\x1e.inventory.StockCheckDetailReqR\adetails\"M\n" + + "\x14ConfirmStockCheckReq\x12\x19\n" + + "\bcheck_id\x18\x01 \x01(\tR\acheckId\x12\x1a\n" + + "\boperator\x18\x02 \x01(\tR\boperator\"-\n" + + "\x10GetStockCheckReq\x12\x19\n" + + "\bcheck_id\x18\x01 \x01(\tR\acheckId\"\xb1\x01\n" + + "\x11ListStockCheckReq\x12\x12\n" + + "\x04page\x18\x01 \x01(\x03R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x03R\bpageSize\x12\x19\n" + + "\bcheck_no\x18\x03 \x01(\tR\acheckNo\x12\x16\n" + + "\x06status\x18\x04 \x01(\x03R\x06status\x12\x1d\n" + + "\n" + + "start_date\x18\x05 \x01(\tR\tstartDate\x12\x19\n" + + "\bend_date\x18\x06 \x01(\tR\aendDate\"Y\n" + + "\x12ListStockCheckResp\x12\x14\n" + + "\x05total\x18\x01 \x01(\x03R\x05total\x12-\n" + + "\x04list\x18\x02 \x03(\v2\x19.inventory.StockCheckInfoR\x04list\"\xf3\x02\n" + + "\x0fStockAdjustInfo\x12\x1b\n" + + "\tadjust_id\x18\x01 \x01(\tR\badjustId\x12\x1b\n" + + "\tadjust_no\x18\x02 \x01(\tR\badjustNo\x12\x1f\n" + + "\vadjust_date\x18\x03 \x01(\tR\n" + + "adjustDate\x12#\n" + + "\radjust_reason\x18\x04 \x01(\tR\fadjustReason\x12\x1a\n" + + "\boperator\x18\x05 \x01(\tR\boperator\x12\x1a\n" + + "\bapprover\x18\x06 \x01(\tR\bapprover\x12\x16\n" + + "\x06status\x18\a \x01(\x03R\x06status\x12\x16\n" + + "\x06remark\x18\b \x01(\tR\x06remark\x12\x1d\n" + + "\n" + + "created_at\x18\t \x01(\tR\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\n" + + " \x01(\tR\tupdatedAt\x12:\n" + + "\adetails\x18\v \x03(\v2 .inventory.StockAdjustDetailInfoR\adetails\"\xa4\x02\n" + + "\x15StockAdjustDetailInfo\x12\x1b\n" + + "\tdetail_id\x18\x01 \x01(\tR\bdetailId\x12\x1b\n" + + "\tadjust_id\x18\x02 \x01(\tR\badjustId\x12\x1d\n" + + "\n" + + "product_id\x18\x03 \x01(\tR\tproductId\x12!\n" + + "\fproduct_name\x18\x04 \x01(\tR\vproductName\x12'\n" + + "\x0fbefore_quantity\x18\x05 \x01(\tR\x0ebeforeQuantity\x12'\n" + + "\x0fadjust_quantity\x18\x06 \x01(\tR\x0eadjustQuantity\x12%\n" + + "\x0eafter_quantity\x18\a \x01(\tR\rafterQuantity\x12\x16\n" + + "\x06remark\x18\b \x01(\tR\x06remark\"\xcb\x01\n" + + "\x14CreateStockAdjustReq\x12\x1f\n" + + "\vadjust_date\x18\x01 \x01(\tR\n" + + "adjustDate\x12#\n" + + "\radjust_reason\x18\x02 \x01(\tR\fadjustReason\x12\x1a\n" + + "\boperator\x18\x03 \x01(\tR\boperator\x12\x16\n" + + "\x06remark\x18\x04 \x01(\tR\x06remark\x129\n" + + "\adetails\x18\x05 \x03(\v2\x1f.inventory.StockAdjustDetailReqR\adetails\"v\n" + + "\x14StockAdjustDetailReq\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\tR\tproductId\x12'\n" + + "\x0fadjust_quantity\x18\x02 \x01(\tR\x0eadjustQuantity\x12\x16\n" + + "\x06remark\x18\x03 \x01(\tR\x06remark\"h\n" + + "\x15ApproveStockAdjustReq\x12\x1b\n" + + "\tadjust_id\x18\x01 \x01(\tR\badjustId\x12\x1a\n" + + "\bapprover\x18\x02 \x01(\tR\bapprover\x12\x16\n" + + "\x06action\x18\x03 \x01(\x03R\x06action\"0\n" + + "\x11GetStockAdjustReq\x12\x1b\n" + + "\tadjust_id\x18\x01 \x01(\tR\badjustId\"\xd9\x01\n" + + "\x12ListStockAdjustReq\x12\x12\n" + + "\x04page\x18\x01 \x01(\x03R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x03R\bpageSize\x12\x1b\n" + + "\tadjust_no\x18\x03 \x01(\tR\badjustNo\x12#\n" + + "\radjust_reason\x18\x04 \x01(\tR\fadjustReason\x12\x16\n" + + "\x06status\x18\x05 \x01(\x03R\x06status\x12\x1d\n" + + "\n" + + "start_date\x18\x06 \x01(\tR\tstartDate\x12\x19\n" + + "\bend_date\x18\a \x01(\tR\aendDate\"[\n" + + "\x13ListStockAdjustResp\x12\x14\n" + + "\x05total\x18\x01 \x01(\x03R\x05total\x12.\n" + + "\x04list\x18\x02 \x03(\v2\x1a.inventory.StockAdjustInfoR\x04list\"\x18\n" + + "\x06IdResp\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\a\n" + + "\x05Empty2\x8d\x0f\n" + + "\x10InventoryService\x12?\n" + + "\rCreateProduct\x12\x1b.inventory.CreateProductReq\x1a\x11.inventory.IdResp\x12>\n" + + "\rUpdateProduct\x12\x1b.inventory.UpdateProductReq\x1a\x10.inventory.Empty\x12>\n" + + "\rDeleteProduct\x12\x1b.inventory.DeleteProductReq\x1a\x10.inventory.Empty\x12>\n" + + "\n" + + "GetProduct\x12\x18.inventory.GetProductReq\x1a\x16.inventory.ProductInfo\x12D\n" + + "\vListProduct\x12\x19.inventory.ListProductReq\x1a\x1a.inventory.ListProductResp\x12F\n" + + "\x0eGetProductTree\x12\x18.inventory.GetProductReq\x1a\x1a.inventory.ProductTreeResp\x12Y\n" + + "\x12ListProductSummary\x12 .inventory.ListProductSummaryReq\x1a!.inventory.ListProductSummaryResp\x12P\n" + + "\x0fListColorDetail\x12\x1d.inventory.ListColorDetailReq\x1a\x1e.inventory.ListColorDetailResp\x12D\n" + + "\vListPanView\x12\x19.inventory.ListPanViewReq\x1a\x1a.inventory.ListPanViewResp\x12G\n" + + "\fListBoltView\x12\x1a.inventory.ListBoltViewReq\x1a\x1b.inventory.ListBoltViewResp\x129\n" + + "\bListPans\x12\x15.inventory.ListPanReq\x1a\x16.inventory.ListPanResp\x124\n" + + "\bSavePans\x12\x16.inventory.SavePansReq\x1a\x10.inventory.Empty\x12<\n" + + "\tListBolts\x12\x16.inventory.ListBoltReq\x1a\x17.inventory.ListBoltResp\x126\n" + + "\tSaveBolts\x12\x17.inventory.SaveBoltsReq\x1a\x10.inventory.Empty\x12K\n" + + "\x0eImportProducts\x12\x1b.inventory.ImportProductReq\x1a\x1c.inventory.ImportProductResp\x12J\n" + + "\rListImportLog\x12\x1b.inventory.ListImportLogReq\x1a\x1c.inventory.ListImportLogResp\x12J\n" + + "\x0fGetStockSummary\x12\x1a.inventory.StockSummaryReq\x1a\x1b.inventory.StockSummaryResp\x12D\n" + + "\rGetStockGroup\x12\x18.inventory.StockGroupReq\x1a\x19.inventory.StockGroupResp\x12E\n" + + "\x10CreateStockCheck\x12\x1e.inventory.CreateStockCheckReq\x1a\x11.inventory.IdResp\x12D\n" + + "\x10UpdateStockCheck\x12\x1e.inventory.UpdateStockCheckReq\x1a\x10.inventory.Empty\x12F\n" + + "\x11ConfirmStockCheck\x12\x1f.inventory.ConfirmStockCheckReq\x1a\x10.inventory.Empty\x12G\n" + + "\rGetStockCheck\x12\x1b.inventory.GetStockCheckReq\x1a\x19.inventory.StockCheckInfo\x12M\n" + + "\x0eListStockCheck\x12\x1c.inventory.ListStockCheckReq\x1a\x1d.inventory.ListStockCheckResp\x12G\n" + + "\x11CreateStockAdjust\x12\x1f.inventory.CreateStockAdjustReq\x1a\x11.inventory.IdResp\x12H\n" + + "\x12ApproveStockAdjust\x12 .inventory.ApproveStockAdjustReq\x1a\x10.inventory.Empty\x12J\n" + + "\x0eGetStockAdjust\x12\x1c.inventory.GetStockAdjustReq\x1a\x1a.inventory.StockAdjustInfo\x12P\n" + + "\x0fListStockAdjust\x12\x1d.inventory.ListStockAdjustReq\x1a\x1e.inventory.ListStockAdjustRespB\x06Z\x04./pbb\x06proto3" var ( - file_rpc_inventory_inventory_proto_rawDescOnce sync.Once - file_rpc_inventory_inventory_proto_rawDescData = file_rpc_inventory_inventory_proto_rawDesc + file_inventory_proto_rawDescOnce sync.Once + file_inventory_proto_rawDescData []byte ) -func file_rpc_inventory_inventory_proto_rawDescGZIP() []byte { - file_rpc_inventory_inventory_proto_rawDescOnce.Do(func() { - file_rpc_inventory_inventory_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_inventory_inventory_proto_rawDescData) +func file_inventory_proto_rawDescGZIP() []byte { + file_inventory_proto_rawDescOnce.Do(func() { + file_inventory_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_inventory_proto_rawDesc), len(file_inventory_proto_rawDesc))) }) - return file_rpc_inventory_inventory_proto_rawDescData + return file_inventory_proto_rawDescData } -var file_rpc_inventory_inventory_proto_msgTypes = make([]protoimpl.MessageInfo, 36) -var file_rpc_inventory_inventory_proto_goTypes = []interface{}{ - (*ProductInfo)(nil), // 0: inventory.ProductInfo - (*CreateProductReq)(nil), // 1: inventory.CreateProductReq - (*UpdateProductReq)(nil), // 2: inventory.UpdateProductReq - (*DeleteProductReq)(nil), // 3: inventory.DeleteProductReq - (*GetProductReq)(nil), // 4: inventory.GetProductReq - (*ListProductReq)(nil), // 5: inventory.ListProductReq - (*ListProductResp)(nil), // 6: inventory.ListProductResp - (*ImportProductReq)(nil), // 7: inventory.ImportProductReq - (*ImportProductResp)(nil), // 8: inventory.ImportProductResp - (*ListImportLogReq)(nil), // 9: inventory.ListImportLogReq - (*ListImportLogResp)(nil), // 10: inventory.ListImportLogResp - (*ImportLogInfo)(nil), // 11: inventory.ImportLogInfo - (*StockSummaryReq)(nil), // 12: inventory.StockSummaryReq - (*StockSummaryResp)(nil), // 13: inventory.StockSummaryResp - (*StockGroupReq)(nil), // 14: inventory.StockGroupReq - (*StockGroupItem)(nil), // 15: inventory.StockGroupItem - (*StockGroupResp)(nil), // 16: inventory.StockGroupResp - (*StockCheckInfo)(nil), // 17: inventory.StockCheckInfo - (*StockCheckDetailInfo)(nil), // 18: inventory.StockCheckDetailInfo - (*CreateStockCheckReq)(nil), // 19: inventory.CreateStockCheckReq - (*StockCheckDetailReq)(nil), // 20: inventory.StockCheckDetailReq - (*UpdateStockCheckReq)(nil), // 21: inventory.UpdateStockCheckReq - (*ConfirmStockCheckReq)(nil), // 22: inventory.ConfirmStockCheckReq - (*GetStockCheckReq)(nil), // 23: inventory.GetStockCheckReq - (*ListStockCheckReq)(nil), // 24: inventory.ListStockCheckReq - (*ListStockCheckResp)(nil), // 25: inventory.ListStockCheckResp - (*StockAdjustInfo)(nil), // 26: inventory.StockAdjustInfo - (*StockAdjustDetailInfo)(nil), // 27: inventory.StockAdjustDetailInfo - (*CreateStockAdjustReq)(nil), // 28: inventory.CreateStockAdjustReq - (*StockAdjustDetailReq)(nil), // 29: inventory.StockAdjustDetailReq - (*ApproveStockAdjustReq)(nil), // 30: inventory.ApproveStockAdjustReq - (*GetStockAdjustReq)(nil), // 31: inventory.GetStockAdjustReq - (*ListStockAdjustReq)(nil), // 32: inventory.ListStockAdjustReq - (*ListStockAdjustResp)(nil), // 33: inventory.ListStockAdjustResp - (*IdResp)(nil), // 34: inventory.IdResp - (*Empty)(nil), // 35: inventory.Empty +var file_inventory_proto_msgTypes = make([]protoimpl.MessageInfo, 58) +var file_inventory_proto_goTypes = []any{ + (*ProductInfo)(nil), // 0: inventory.ProductInfo + (*CreateProductReq)(nil), // 1: inventory.CreateProductReq + (*UpdateProductReq)(nil), // 2: inventory.UpdateProductReq + (*DeleteProductReq)(nil), // 3: inventory.DeleteProductReq + (*GetProductReq)(nil), // 4: inventory.GetProductReq + (*ListProductReq)(nil), // 5: inventory.ListProductReq + (*ListProductResp)(nil), // 6: inventory.ListProductResp + (*PanInfo)(nil), // 7: inventory.PanInfo + (*PanInput)(nil), // 8: inventory.PanInput + (*ListPanReq)(nil), // 9: inventory.ListPanReq + (*ListPanResp)(nil), // 10: inventory.ListPanResp + (*SavePansReq)(nil), // 11: inventory.SavePansReq + (*BoltInfo)(nil), // 12: inventory.BoltInfo + (*ListBoltReq)(nil), // 13: inventory.ListBoltReq + (*ListBoltResp)(nil), // 14: inventory.ListBoltResp + (*SaveBoltsReq)(nil), // 15: inventory.SaveBoltsReq + (*ProductTreeResp)(nil), // 16: inventory.ProductTreeResp + (*ProductSummaryItem)(nil), // 17: inventory.ProductSummaryItem + (*ListProductSummaryReq)(nil), // 18: inventory.ListProductSummaryReq + (*ListProductSummaryResp)(nil), // 19: inventory.ListProductSummaryResp + (*ColorDetailItem)(nil), // 20: inventory.ColorDetailItem + (*ListColorDetailReq)(nil), // 21: inventory.ListColorDetailReq + (*ListColorDetailResp)(nil), // 22: inventory.ListColorDetailResp + (*PanListItem)(nil), // 23: inventory.PanListItem + (*ListPanViewReq)(nil), // 24: inventory.ListPanViewReq + (*ListPanViewResp)(nil), // 25: inventory.ListPanViewResp + (*BoltListItem)(nil), // 26: inventory.BoltListItem + (*ListBoltViewReq)(nil), // 27: inventory.ListBoltViewReq + (*ListBoltViewResp)(nil), // 28: inventory.ListBoltViewResp + (*ImportProductReq)(nil), // 29: inventory.ImportProductReq + (*ImportProductResp)(nil), // 30: inventory.ImportProductResp + (*ListImportLogReq)(nil), // 31: inventory.ListImportLogReq + (*ListImportLogResp)(nil), // 32: inventory.ListImportLogResp + (*ImportLogInfo)(nil), // 33: inventory.ImportLogInfo + (*StockSummaryReq)(nil), // 34: inventory.StockSummaryReq + (*StockSummaryResp)(nil), // 35: inventory.StockSummaryResp + (*StockGroupReq)(nil), // 36: inventory.StockGroupReq + (*StockGroupItem)(nil), // 37: inventory.StockGroupItem + (*StockGroupResp)(nil), // 38: inventory.StockGroupResp + (*StockCheckInfo)(nil), // 39: inventory.StockCheckInfo + (*StockCheckDetailInfo)(nil), // 40: inventory.StockCheckDetailInfo + (*CreateStockCheckReq)(nil), // 41: inventory.CreateStockCheckReq + (*StockCheckDetailReq)(nil), // 42: inventory.StockCheckDetailReq + (*UpdateStockCheckReq)(nil), // 43: inventory.UpdateStockCheckReq + (*ConfirmStockCheckReq)(nil), // 44: inventory.ConfirmStockCheckReq + (*GetStockCheckReq)(nil), // 45: inventory.GetStockCheckReq + (*ListStockCheckReq)(nil), // 46: inventory.ListStockCheckReq + (*ListStockCheckResp)(nil), // 47: inventory.ListStockCheckResp + (*StockAdjustInfo)(nil), // 48: inventory.StockAdjustInfo + (*StockAdjustDetailInfo)(nil), // 49: inventory.StockAdjustDetailInfo + (*CreateStockAdjustReq)(nil), // 50: inventory.CreateStockAdjustReq + (*StockAdjustDetailReq)(nil), // 51: inventory.StockAdjustDetailReq + (*ApproveStockAdjustReq)(nil), // 52: inventory.ApproveStockAdjustReq + (*GetStockAdjustReq)(nil), // 53: inventory.GetStockAdjustReq + (*ListStockAdjustReq)(nil), // 54: inventory.ListStockAdjustReq + (*ListStockAdjustResp)(nil), // 55: inventory.ListStockAdjustResp + (*IdResp)(nil), // 56: inventory.IdResp + (*Empty)(nil), // 57: inventory.Empty } -var file_rpc_inventory_inventory_proto_depIdxs = []int32{ - 0, // 0: inventory.ListProductResp.list:type_name -> inventory.ProductInfo - 1, // 1: inventory.ImportProductReq.products:type_name -> inventory.CreateProductReq - 11, // 2: inventory.ListImportLogResp.list:type_name -> inventory.ImportLogInfo - 15, // 3: inventory.StockGroupResp.list:type_name -> inventory.StockGroupItem - 18, // 4: inventory.StockCheckInfo.details:type_name -> inventory.StockCheckDetailInfo - 20, // 5: inventory.CreateStockCheckReq.details:type_name -> inventory.StockCheckDetailReq - 20, // 6: inventory.UpdateStockCheckReq.details:type_name -> inventory.StockCheckDetailReq - 17, // 7: inventory.ListStockCheckResp.list:type_name -> inventory.StockCheckInfo - 27, // 8: inventory.StockAdjustInfo.details:type_name -> inventory.StockAdjustDetailInfo - 29, // 9: inventory.CreateStockAdjustReq.details:type_name -> inventory.StockAdjustDetailReq - 26, // 10: inventory.ListStockAdjustResp.list:type_name -> inventory.StockAdjustInfo - 1, // 11: inventory.InventoryService.CreateProduct:input_type -> inventory.CreateProductReq - 2, // 12: inventory.InventoryService.UpdateProduct:input_type -> inventory.UpdateProductReq - 3, // 13: inventory.InventoryService.DeleteProduct:input_type -> inventory.DeleteProductReq - 4, // 14: inventory.InventoryService.GetProduct:input_type -> inventory.GetProductReq - 5, // 15: inventory.InventoryService.ListProduct:input_type -> inventory.ListProductReq - 7, // 16: inventory.InventoryService.ImportProducts:input_type -> inventory.ImportProductReq - 9, // 17: inventory.InventoryService.ListImportLog:input_type -> inventory.ListImportLogReq - 12, // 18: inventory.InventoryService.GetStockSummary:input_type -> inventory.StockSummaryReq - 14, // 19: inventory.InventoryService.GetStockGroup:input_type -> inventory.StockGroupReq - 19, // 20: inventory.InventoryService.CreateStockCheck:input_type -> inventory.CreateStockCheckReq - 21, // 21: inventory.InventoryService.UpdateStockCheck:input_type -> inventory.UpdateStockCheckReq - 22, // 22: inventory.InventoryService.ConfirmStockCheck:input_type -> inventory.ConfirmStockCheckReq - 23, // 23: inventory.InventoryService.GetStockCheck:input_type -> inventory.GetStockCheckReq - 24, // 24: inventory.InventoryService.ListStockCheck:input_type -> inventory.ListStockCheckReq - 28, // 25: inventory.InventoryService.CreateStockAdjust:input_type -> inventory.CreateStockAdjustReq - 30, // 26: inventory.InventoryService.ApproveStockAdjust:input_type -> inventory.ApproveStockAdjustReq - 31, // 27: inventory.InventoryService.GetStockAdjust:input_type -> inventory.GetStockAdjustReq - 32, // 28: inventory.InventoryService.ListStockAdjust:input_type -> inventory.ListStockAdjustReq - 34, // 29: inventory.InventoryService.CreateProduct:output_type -> inventory.IdResp - 35, // 30: inventory.InventoryService.UpdateProduct:output_type -> inventory.Empty - 35, // 31: inventory.InventoryService.DeleteProduct:output_type -> inventory.Empty - 0, // 32: inventory.InventoryService.GetProduct:output_type -> inventory.ProductInfo - 6, // 33: inventory.InventoryService.ListProduct:output_type -> inventory.ListProductResp - 8, // 34: inventory.InventoryService.ImportProducts:output_type -> inventory.ImportProductResp - 10, // 35: inventory.InventoryService.ListImportLog:output_type -> inventory.ListImportLogResp - 13, // 36: inventory.InventoryService.GetStockSummary:output_type -> inventory.StockSummaryResp - 16, // 37: inventory.InventoryService.GetStockGroup:output_type -> inventory.StockGroupResp - 34, // 38: inventory.InventoryService.CreateStockCheck:output_type -> inventory.IdResp - 35, // 39: inventory.InventoryService.UpdateStockCheck:output_type -> inventory.Empty - 35, // 40: inventory.InventoryService.ConfirmStockCheck:output_type -> inventory.Empty - 17, // 41: inventory.InventoryService.GetStockCheck:output_type -> inventory.StockCheckInfo - 25, // 42: inventory.InventoryService.ListStockCheck:output_type -> inventory.ListStockCheckResp - 34, // 43: inventory.InventoryService.CreateStockAdjust:output_type -> inventory.IdResp - 35, // 44: inventory.InventoryService.ApproveStockAdjust:output_type -> inventory.Empty - 26, // 45: inventory.InventoryService.GetStockAdjust:output_type -> inventory.StockAdjustInfo - 33, // 46: inventory.InventoryService.ListStockAdjust:output_type -> inventory.ListStockAdjustResp - 29, // [29:47] is the sub-list for method output_type - 11, // [11:29] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name +var file_inventory_proto_depIdxs = []int32{ + 8, // 0: inventory.CreateProductReq.pans:type_name -> inventory.PanInput + 0, // 1: inventory.ListProductResp.list:type_name -> inventory.ProductInfo + 12, // 2: inventory.PanInfo.bolts:type_name -> inventory.BoltInfo + 7, // 3: inventory.ListPanResp.list:type_name -> inventory.PanInfo + 8, // 4: inventory.SavePansReq.pans:type_name -> inventory.PanInput + 12, // 5: inventory.ListBoltResp.list:type_name -> inventory.BoltInfo + 0, // 6: inventory.ProductTreeResp.product:type_name -> inventory.ProductInfo + 7, // 7: inventory.ProductTreeResp.pans:type_name -> inventory.PanInfo + 17, // 8: inventory.ListProductSummaryResp.list:type_name -> inventory.ProductSummaryItem + 20, // 9: inventory.ListColorDetailResp.list:type_name -> inventory.ColorDetailItem + 23, // 10: inventory.ListPanViewResp.list:type_name -> inventory.PanListItem + 26, // 11: inventory.ListBoltViewResp.list:type_name -> inventory.BoltListItem + 1, // 12: inventory.ImportProductReq.products:type_name -> inventory.CreateProductReq + 33, // 13: inventory.ListImportLogResp.list:type_name -> inventory.ImportLogInfo + 37, // 14: inventory.StockGroupResp.list:type_name -> inventory.StockGroupItem + 40, // 15: inventory.StockCheckInfo.details:type_name -> inventory.StockCheckDetailInfo + 42, // 16: inventory.CreateStockCheckReq.details:type_name -> inventory.StockCheckDetailReq + 42, // 17: inventory.UpdateStockCheckReq.details:type_name -> inventory.StockCheckDetailReq + 39, // 18: inventory.ListStockCheckResp.list:type_name -> inventory.StockCheckInfo + 49, // 19: inventory.StockAdjustInfo.details:type_name -> inventory.StockAdjustDetailInfo + 51, // 20: inventory.CreateStockAdjustReq.details:type_name -> inventory.StockAdjustDetailReq + 48, // 21: inventory.ListStockAdjustResp.list:type_name -> inventory.StockAdjustInfo + 1, // 22: inventory.InventoryService.CreateProduct:input_type -> inventory.CreateProductReq + 2, // 23: inventory.InventoryService.UpdateProduct:input_type -> inventory.UpdateProductReq + 3, // 24: inventory.InventoryService.DeleteProduct:input_type -> inventory.DeleteProductReq + 4, // 25: inventory.InventoryService.GetProduct:input_type -> inventory.GetProductReq + 5, // 26: inventory.InventoryService.ListProduct:input_type -> inventory.ListProductReq + 4, // 27: inventory.InventoryService.GetProductTree:input_type -> inventory.GetProductReq + 18, // 28: inventory.InventoryService.ListProductSummary:input_type -> inventory.ListProductSummaryReq + 21, // 29: inventory.InventoryService.ListColorDetail:input_type -> inventory.ListColorDetailReq + 24, // 30: inventory.InventoryService.ListPanView:input_type -> inventory.ListPanViewReq + 27, // 31: inventory.InventoryService.ListBoltView:input_type -> inventory.ListBoltViewReq + 9, // 32: inventory.InventoryService.ListPans:input_type -> inventory.ListPanReq + 11, // 33: inventory.InventoryService.SavePans:input_type -> inventory.SavePansReq + 13, // 34: inventory.InventoryService.ListBolts:input_type -> inventory.ListBoltReq + 15, // 35: inventory.InventoryService.SaveBolts:input_type -> inventory.SaveBoltsReq + 29, // 36: inventory.InventoryService.ImportProducts:input_type -> inventory.ImportProductReq + 31, // 37: inventory.InventoryService.ListImportLog:input_type -> inventory.ListImportLogReq + 34, // 38: inventory.InventoryService.GetStockSummary:input_type -> inventory.StockSummaryReq + 36, // 39: inventory.InventoryService.GetStockGroup:input_type -> inventory.StockGroupReq + 41, // 40: inventory.InventoryService.CreateStockCheck:input_type -> inventory.CreateStockCheckReq + 43, // 41: inventory.InventoryService.UpdateStockCheck:input_type -> inventory.UpdateStockCheckReq + 44, // 42: inventory.InventoryService.ConfirmStockCheck:input_type -> inventory.ConfirmStockCheckReq + 45, // 43: inventory.InventoryService.GetStockCheck:input_type -> inventory.GetStockCheckReq + 46, // 44: inventory.InventoryService.ListStockCheck:input_type -> inventory.ListStockCheckReq + 50, // 45: inventory.InventoryService.CreateStockAdjust:input_type -> inventory.CreateStockAdjustReq + 52, // 46: inventory.InventoryService.ApproveStockAdjust:input_type -> inventory.ApproveStockAdjustReq + 53, // 47: inventory.InventoryService.GetStockAdjust:input_type -> inventory.GetStockAdjustReq + 54, // 48: inventory.InventoryService.ListStockAdjust:input_type -> inventory.ListStockAdjustReq + 56, // 49: inventory.InventoryService.CreateProduct:output_type -> inventory.IdResp + 57, // 50: inventory.InventoryService.UpdateProduct:output_type -> inventory.Empty + 57, // 51: inventory.InventoryService.DeleteProduct:output_type -> inventory.Empty + 0, // 52: inventory.InventoryService.GetProduct:output_type -> inventory.ProductInfo + 6, // 53: inventory.InventoryService.ListProduct:output_type -> inventory.ListProductResp + 16, // 54: inventory.InventoryService.GetProductTree:output_type -> inventory.ProductTreeResp + 19, // 55: inventory.InventoryService.ListProductSummary:output_type -> inventory.ListProductSummaryResp + 22, // 56: inventory.InventoryService.ListColorDetail:output_type -> inventory.ListColorDetailResp + 25, // 57: inventory.InventoryService.ListPanView:output_type -> inventory.ListPanViewResp + 28, // 58: inventory.InventoryService.ListBoltView:output_type -> inventory.ListBoltViewResp + 10, // 59: inventory.InventoryService.ListPans:output_type -> inventory.ListPanResp + 57, // 60: inventory.InventoryService.SavePans:output_type -> inventory.Empty + 14, // 61: inventory.InventoryService.ListBolts:output_type -> inventory.ListBoltResp + 57, // 62: inventory.InventoryService.SaveBolts:output_type -> inventory.Empty + 30, // 63: inventory.InventoryService.ImportProducts:output_type -> inventory.ImportProductResp + 32, // 64: inventory.InventoryService.ListImportLog:output_type -> inventory.ListImportLogResp + 35, // 65: inventory.InventoryService.GetStockSummary:output_type -> inventory.StockSummaryResp + 38, // 66: inventory.InventoryService.GetStockGroup:output_type -> inventory.StockGroupResp + 56, // 67: inventory.InventoryService.CreateStockCheck:output_type -> inventory.IdResp + 57, // 68: inventory.InventoryService.UpdateStockCheck:output_type -> inventory.Empty + 57, // 69: inventory.InventoryService.ConfirmStockCheck:output_type -> inventory.Empty + 39, // 70: inventory.InventoryService.GetStockCheck:output_type -> inventory.StockCheckInfo + 47, // 71: inventory.InventoryService.ListStockCheck:output_type -> inventory.ListStockCheckResp + 56, // 72: inventory.InventoryService.CreateStockAdjust:output_type -> inventory.IdResp + 57, // 73: inventory.InventoryService.ApproveStockAdjust:output_type -> inventory.Empty + 48, // 74: inventory.InventoryService.GetStockAdjust:output_type -> inventory.StockAdjustInfo + 55, // 75: inventory.InventoryService.ListStockAdjust:output_type -> inventory.ListStockAdjustResp + 49, // [49:76] is the sub-list for method output_type + 22, // [22:49] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } -func init() { file_rpc_inventory_inventory_proto_init() } -func file_rpc_inventory_inventory_proto_init() { - if File_rpc_inventory_inventory_proto != nil { +func init() { file_inventory_proto_init() } +func file_inventory_proto_init() { + if File_inventory_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_rpc_inventory_inventory_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateProductReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateProductReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteProductReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProductReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListProductReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListProductResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportProductReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportProductResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListImportLogReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListImportLogResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportLogInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockSummaryReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockSummaryResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockGroupReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockGroupItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockGroupResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockCheckInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockCheckDetailInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateStockCheckReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockCheckDetailReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateStockCheckReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfirmStockCheckReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetStockCheckReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStockCheckReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStockCheckResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockAdjustInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockAdjustDetailInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateStockAdjustReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockAdjustDetailReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApproveStockAdjustReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetStockAdjustReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStockAdjustReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStockAdjustResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IdResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_inventory_inventory_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_rpc_inventory_inventory_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_inventory_proto_rawDesc), len(file_inventory_proto_rawDesc)), NumEnums: 0, - NumMessages: 36, + NumMessages: 58, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_rpc_inventory_inventory_proto_goTypes, - DependencyIndexes: file_rpc_inventory_inventory_proto_depIdxs, - MessageInfos: file_rpc_inventory_inventory_proto_msgTypes, + GoTypes: file_inventory_proto_goTypes, + DependencyIndexes: file_inventory_proto_depIdxs, + MessageInfos: file_inventory_proto_msgTypes, }.Build() - File_rpc_inventory_inventory_proto = out.File - file_rpc_inventory_inventory_proto_rawDesc = nil - file_rpc_inventory_inventory_proto_goTypes = nil - file_rpc_inventory_inventory_proto_depIdxs = nil + File_inventory_proto = out.File + file_inventory_proto_goTypes = nil + file_inventory_proto_depIdxs = nil } diff --git a/rpc/inventory/pb/inventory_grpc.pb.go b/rpc/inventory/pb/inventory_grpc.pb.go index d19b950..4afbe23 100644 --- a/rpc/inventory/pb/inventory_grpc.pb.go +++ b/rpc/inventory/pb/inventory_grpc.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.3 -// source: rpc/inventory/inventory.proto +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: inventory.proto package pb @@ -15,19 +15,64 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + InventoryService_CreateProduct_FullMethodName = "/inventory.InventoryService/CreateProduct" + InventoryService_UpdateProduct_FullMethodName = "/inventory.InventoryService/UpdateProduct" + InventoryService_DeleteProduct_FullMethodName = "/inventory.InventoryService/DeleteProduct" + InventoryService_GetProduct_FullMethodName = "/inventory.InventoryService/GetProduct" + InventoryService_ListProduct_FullMethodName = "/inventory.InventoryService/ListProduct" + InventoryService_GetProductTree_FullMethodName = "/inventory.InventoryService/GetProductTree" + InventoryService_ListProductSummary_FullMethodName = "/inventory.InventoryService/ListProductSummary" + InventoryService_ListColorDetail_FullMethodName = "/inventory.InventoryService/ListColorDetail" + InventoryService_ListPanView_FullMethodName = "/inventory.InventoryService/ListPanView" + InventoryService_ListBoltView_FullMethodName = "/inventory.InventoryService/ListBoltView" + InventoryService_ListPans_FullMethodName = "/inventory.InventoryService/ListPans" + InventoryService_SavePans_FullMethodName = "/inventory.InventoryService/SavePans" + InventoryService_ListBolts_FullMethodName = "/inventory.InventoryService/ListBolts" + InventoryService_SaveBolts_FullMethodName = "/inventory.InventoryService/SaveBolts" + InventoryService_ImportProducts_FullMethodName = "/inventory.InventoryService/ImportProducts" + InventoryService_ListImportLog_FullMethodName = "/inventory.InventoryService/ListImportLog" + InventoryService_GetStockSummary_FullMethodName = "/inventory.InventoryService/GetStockSummary" + InventoryService_GetStockGroup_FullMethodName = "/inventory.InventoryService/GetStockGroup" + InventoryService_CreateStockCheck_FullMethodName = "/inventory.InventoryService/CreateStockCheck" + InventoryService_UpdateStockCheck_FullMethodName = "/inventory.InventoryService/UpdateStockCheck" + InventoryService_ConfirmStockCheck_FullMethodName = "/inventory.InventoryService/ConfirmStockCheck" + InventoryService_GetStockCheck_FullMethodName = "/inventory.InventoryService/GetStockCheck" + InventoryService_ListStockCheck_FullMethodName = "/inventory.InventoryService/ListStockCheck" + InventoryService_CreateStockAdjust_FullMethodName = "/inventory.InventoryService/CreateStockAdjust" + InventoryService_ApproveStockAdjust_FullMethodName = "/inventory.InventoryService/ApproveStockAdjust" + InventoryService_GetStockAdjust_FullMethodName = "/inventory.InventoryService/GetStockAdjust" + InventoryService_ListStockAdjust_FullMethodName = "/inventory.InventoryService/ListStockAdjust" +) // InventoryServiceClient is the client API for InventoryService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type InventoryServiceClient interface { - // Product + // Product CRUD CreateProduct(ctx context.Context, in *CreateProductReq, opts ...grpc.CallOption) (*IdResp, error) UpdateProduct(ctx context.Context, in *UpdateProductReq, opts ...grpc.CallOption) (*Empty, error) DeleteProduct(ctx context.Context, in *DeleteProductReq, opts ...grpc.CallOption) (*Empty, error) GetProduct(ctx context.Context, in *GetProductReq, opts ...grpc.CallOption) (*ProductInfo, error) ListProduct(ctx context.Context, in *ListProductReq, opts ...grpc.CallOption) (*ListProductResp, error) + // Product Tree (panel 3) + GetProductTree(ctx context.Context, in *GetProductReq, opts ...grpc.CallOption) (*ProductTreeResp, error) + // Product Summary (panel 1) + ListProductSummary(ctx context.Context, in *ListProductSummaryReq, opts ...grpc.CallOption) (*ListProductSummaryResp, error) + // Color Detail (panel 2) + ListColorDetail(ctx context.Context, in *ListColorDetailReq, opts ...grpc.CallOption) (*ListColorDetailResp, error) + // Pan / Bolt list views (dimension panels) + ListPanView(ctx context.Context, in *ListPanViewReq, opts ...grpc.CallOption) (*ListPanViewResp, error) + ListBoltView(ctx context.Context, in *ListBoltViewReq, opts ...grpc.CallOption) (*ListBoltViewResp, error) + // Pan CRUD + ListPans(ctx context.Context, in *ListPanReq, opts ...grpc.CallOption) (*ListPanResp, error) + SavePans(ctx context.Context, in *SavePansReq, opts ...grpc.CallOption) (*Empty, error) + // Bolt CRUD + ListBolts(ctx context.Context, in *ListBoltReq, opts ...grpc.CallOption) (*ListBoltResp, error) + SaveBolts(ctx context.Context, in *SaveBoltsReq, opts ...grpc.CallOption) (*Empty, error) // Import ImportProducts(ctx context.Context, in *ImportProductReq, opts ...grpc.CallOption) (*ImportProductResp, error) ListImportLog(ctx context.Context, in *ListImportLogReq, opts ...grpc.CallOption) (*ListImportLogResp, error) @@ -56,8 +101,9 @@ func NewInventoryServiceClient(cc grpc.ClientConnInterface) InventoryServiceClie } func (c *inventoryServiceClient) CreateProduct(ctx context.Context, in *CreateProductReq, opts ...grpc.CallOption) (*IdResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(IdResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/CreateProduct", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_CreateProduct_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -65,8 +111,9 @@ func (c *inventoryServiceClient) CreateProduct(ctx context.Context, in *CreatePr } func (c *inventoryServiceClient) UpdateProduct(ctx context.Context, in *UpdateProductReq, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/UpdateProduct", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_UpdateProduct_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -74,8 +121,9 @@ func (c *inventoryServiceClient) UpdateProduct(ctx context.Context, in *UpdatePr } func (c *inventoryServiceClient) DeleteProduct(ctx context.Context, in *DeleteProductReq, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/DeleteProduct", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_DeleteProduct_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +131,9 @@ func (c *inventoryServiceClient) DeleteProduct(ctx context.Context, in *DeletePr } func (c *inventoryServiceClient) GetProduct(ctx context.Context, in *GetProductReq, opts ...grpc.CallOption) (*ProductInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ProductInfo) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/GetProduct", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_GetProduct_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -92,8 +141,99 @@ func (c *inventoryServiceClient) GetProduct(ctx context.Context, in *GetProductR } func (c *inventoryServiceClient) ListProduct(ctx context.Context, in *ListProductReq, opts ...grpc.CallOption) (*ListProductResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListProductResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/ListProduct", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_ListProduct_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) GetProductTree(ctx context.Context, in *GetProductReq, opts ...grpc.CallOption) (*ProductTreeResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ProductTreeResp) + err := c.cc.Invoke(ctx, InventoryService_GetProductTree_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) ListProductSummary(ctx context.Context, in *ListProductSummaryReq, opts ...grpc.CallOption) (*ListProductSummaryResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListProductSummaryResp) + err := c.cc.Invoke(ctx, InventoryService_ListProductSummary_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) ListColorDetail(ctx context.Context, in *ListColorDetailReq, opts ...grpc.CallOption) (*ListColorDetailResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListColorDetailResp) + err := c.cc.Invoke(ctx, InventoryService_ListColorDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) ListPanView(ctx context.Context, in *ListPanViewReq, opts ...grpc.CallOption) (*ListPanViewResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListPanViewResp) + err := c.cc.Invoke(ctx, InventoryService_ListPanView_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) ListBoltView(ctx context.Context, in *ListBoltViewReq, opts ...grpc.CallOption) (*ListBoltViewResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListBoltViewResp) + err := c.cc.Invoke(ctx, InventoryService_ListBoltView_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) ListPans(ctx context.Context, in *ListPanReq, opts ...grpc.CallOption) (*ListPanResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListPanResp) + err := c.cc.Invoke(ctx, InventoryService_ListPans_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) SavePans(ctx context.Context, in *SavePansReq, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, InventoryService_SavePans_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) ListBolts(ctx context.Context, in *ListBoltReq, opts ...grpc.CallOption) (*ListBoltResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListBoltResp) + err := c.cc.Invoke(ctx, InventoryService_ListBolts_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryServiceClient) SaveBolts(ctx context.Context, in *SaveBoltsReq, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, InventoryService_SaveBolts_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -101,8 +241,9 @@ func (c *inventoryServiceClient) ListProduct(ctx context.Context, in *ListProduc } func (c *inventoryServiceClient) ImportProducts(ctx context.Context, in *ImportProductReq, opts ...grpc.CallOption) (*ImportProductResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ImportProductResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/ImportProducts", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_ImportProducts_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -110,8 +251,9 @@ func (c *inventoryServiceClient) ImportProducts(ctx context.Context, in *ImportP } func (c *inventoryServiceClient) ListImportLog(ctx context.Context, in *ListImportLogReq, opts ...grpc.CallOption) (*ListImportLogResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListImportLogResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/ListImportLog", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_ListImportLog_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -119,8 +261,9 @@ func (c *inventoryServiceClient) ListImportLog(ctx context.Context, in *ListImpo } func (c *inventoryServiceClient) GetStockSummary(ctx context.Context, in *StockSummaryReq, opts ...grpc.CallOption) (*StockSummaryResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StockSummaryResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/GetStockSummary", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_GetStockSummary_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -128,8 +271,9 @@ func (c *inventoryServiceClient) GetStockSummary(ctx context.Context, in *StockS } func (c *inventoryServiceClient) GetStockGroup(ctx context.Context, in *StockGroupReq, opts ...grpc.CallOption) (*StockGroupResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StockGroupResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/GetStockGroup", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_GetStockGroup_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -137,8 +281,9 @@ func (c *inventoryServiceClient) GetStockGroup(ctx context.Context, in *StockGro } func (c *inventoryServiceClient) CreateStockCheck(ctx context.Context, in *CreateStockCheckReq, opts ...grpc.CallOption) (*IdResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(IdResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/CreateStockCheck", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_CreateStockCheck_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -146,8 +291,9 @@ func (c *inventoryServiceClient) CreateStockCheck(ctx context.Context, in *Creat } func (c *inventoryServiceClient) UpdateStockCheck(ctx context.Context, in *UpdateStockCheckReq, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/UpdateStockCheck", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_UpdateStockCheck_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -155,8 +301,9 @@ func (c *inventoryServiceClient) UpdateStockCheck(ctx context.Context, in *Updat } func (c *inventoryServiceClient) ConfirmStockCheck(ctx context.Context, in *ConfirmStockCheckReq, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/ConfirmStockCheck", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_ConfirmStockCheck_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -164,8 +311,9 @@ func (c *inventoryServiceClient) ConfirmStockCheck(ctx context.Context, in *Conf } func (c *inventoryServiceClient) GetStockCheck(ctx context.Context, in *GetStockCheckReq, opts ...grpc.CallOption) (*StockCheckInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StockCheckInfo) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/GetStockCheck", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_GetStockCheck_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -173,8 +321,9 @@ func (c *inventoryServiceClient) GetStockCheck(ctx context.Context, in *GetStock } func (c *inventoryServiceClient) ListStockCheck(ctx context.Context, in *ListStockCheckReq, opts ...grpc.CallOption) (*ListStockCheckResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListStockCheckResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/ListStockCheck", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_ListStockCheck_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -182,8 +331,9 @@ func (c *inventoryServiceClient) ListStockCheck(ctx context.Context, in *ListSto } func (c *inventoryServiceClient) CreateStockAdjust(ctx context.Context, in *CreateStockAdjustReq, opts ...grpc.CallOption) (*IdResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(IdResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/CreateStockAdjust", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_CreateStockAdjust_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -191,8 +341,9 @@ func (c *inventoryServiceClient) CreateStockAdjust(ctx context.Context, in *Crea } func (c *inventoryServiceClient) ApproveStockAdjust(ctx context.Context, in *ApproveStockAdjustReq, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/ApproveStockAdjust", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_ApproveStockAdjust_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -200,8 +351,9 @@ func (c *inventoryServiceClient) ApproveStockAdjust(ctx context.Context, in *App } func (c *inventoryServiceClient) GetStockAdjust(ctx context.Context, in *GetStockAdjustReq, opts ...grpc.CallOption) (*StockAdjustInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StockAdjustInfo) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/GetStockAdjust", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_GetStockAdjust_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -209,8 +361,9 @@ func (c *inventoryServiceClient) GetStockAdjust(ctx context.Context, in *GetStoc } func (c *inventoryServiceClient) ListStockAdjust(ctx context.Context, in *ListStockAdjustReq, opts ...grpc.CallOption) (*ListStockAdjustResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListStockAdjustResp) - err := c.cc.Invoke(ctx, "/inventory.InventoryService/ListStockAdjust", in, out, opts...) + err := c.cc.Invoke(ctx, InventoryService_ListStockAdjust_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -219,14 +372,29 @@ func (c *inventoryServiceClient) ListStockAdjust(ctx context.Context, in *ListSt // InventoryServiceServer is the server API for InventoryService service. // All implementations must embed UnimplementedInventoryServiceServer -// for forward compatibility +// for forward compatibility. type InventoryServiceServer interface { - // Product + // Product CRUD CreateProduct(context.Context, *CreateProductReq) (*IdResp, error) UpdateProduct(context.Context, *UpdateProductReq) (*Empty, error) DeleteProduct(context.Context, *DeleteProductReq) (*Empty, error) GetProduct(context.Context, *GetProductReq) (*ProductInfo, error) ListProduct(context.Context, *ListProductReq) (*ListProductResp, error) + // Product Tree (panel 3) + GetProductTree(context.Context, *GetProductReq) (*ProductTreeResp, error) + // Product Summary (panel 1) + ListProductSummary(context.Context, *ListProductSummaryReq) (*ListProductSummaryResp, error) + // Color Detail (panel 2) + ListColorDetail(context.Context, *ListColorDetailReq) (*ListColorDetailResp, error) + // Pan / Bolt list views (dimension panels) + ListPanView(context.Context, *ListPanViewReq) (*ListPanViewResp, error) + ListBoltView(context.Context, *ListBoltViewReq) (*ListBoltViewResp, error) + // Pan CRUD + ListPans(context.Context, *ListPanReq) (*ListPanResp, error) + SavePans(context.Context, *SavePansReq) (*Empty, error) + // Bolt CRUD + ListBolts(context.Context, *ListBoltReq) (*ListBoltResp, error) + SaveBolts(context.Context, *SaveBoltsReq) (*Empty, error) // Import ImportProducts(context.Context, *ImportProductReq) (*ImportProductResp, error) ListImportLog(context.Context, *ListImportLogReq) (*ListImportLogResp, error) @@ -247,9 +415,12 @@ type InventoryServiceServer interface { mustEmbedUnimplementedInventoryServiceServer() } -// UnimplementedInventoryServiceServer must be embedded to have forward compatible implementations. -type UnimplementedInventoryServiceServer struct { -} +// UnimplementedInventoryServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedInventoryServiceServer struct{} func (UnimplementedInventoryServiceServer) CreateProduct(context.Context, *CreateProductReq) (*IdResp, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateProduct not implemented") @@ -266,6 +437,33 @@ func (UnimplementedInventoryServiceServer) GetProduct(context.Context, *GetProdu func (UnimplementedInventoryServiceServer) ListProduct(context.Context, *ListProductReq) (*ListProductResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListProduct not implemented") } +func (UnimplementedInventoryServiceServer) GetProductTree(context.Context, *GetProductReq) (*ProductTreeResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProductTree not implemented") +} +func (UnimplementedInventoryServiceServer) ListProductSummary(context.Context, *ListProductSummaryReq) (*ListProductSummaryResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListProductSummary not implemented") +} +func (UnimplementedInventoryServiceServer) ListColorDetail(context.Context, *ListColorDetailReq) (*ListColorDetailResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListColorDetail not implemented") +} +func (UnimplementedInventoryServiceServer) ListPanView(context.Context, *ListPanViewReq) (*ListPanViewResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPanView not implemented") +} +func (UnimplementedInventoryServiceServer) ListBoltView(context.Context, *ListBoltViewReq) (*ListBoltViewResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBoltView not implemented") +} +func (UnimplementedInventoryServiceServer) ListPans(context.Context, *ListPanReq) (*ListPanResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPans not implemented") +} +func (UnimplementedInventoryServiceServer) SavePans(context.Context, *SavePansReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SavePans not implemented") +} +func (UnimplementedInventoryServiceServer) ListBolts(context.Context, *ListBoltReq) (*ListBoltResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBolts not implemented") +} +func (UnimplementedInventoryServiceServer) SaveBolts(context.Context, *SaveBoltsReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SaveBolts not implemented") +} func (UnimplementedInventoryServiceServer) ImportProducts(context.Context, *ImportProductReq) (*ImportProductResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ImportProducts not implemented") } @@ -306,6 +504,7 @@ func (UnimplementedInventoryServiceServer) ListStockAdjust(context.Context, *Lis return nil, status.Errorf(codes.Unimplemented, "method ListStockAdjust not implemented") } func (UnimplementedInventoryServiceServer) mustEmbedUnimplementedInventoryServiceServer() {} +func (UnimplementedInventoryServiceServer) testEmbeddedByValue() {} // UnsafeInventoryServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to InventoryServiceServer will @@ -315,6 +514,13 @@ type UnsafeInventoryServiceServer interface { } func RegisterInventoryServiceServer(s grpc.ServiceRegistrar, srv InventoryServiceServer) { + // If the following call pancis, it indicates UnimplementedInventoryServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&InventoryService_ServiceDesc, srv) } @@ -328,7 +534,7 @@ func _InventoryService_CreateProduct_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/CreateProduct", + FullMethod: InventoryService_CreateProduct_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).CreateProduct(ctx, req.(*CreateProductReq)) @@ -346,7 +552,7 @@ func _InventoryService_UpdateProduct_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/UpdateProduct", + FullMethod: InventoryService_UpdateProduct_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).UpdateProduct(ctx, req.(*UpdateProductReq)) @@ -364,7 +570,7 @@ func _InventoryService_DeleteProduct_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/DeleteProduct", + FullMethod: InventoryService_DeleteProduct_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).DeleteProduct(ctx, req.(*DeleteProductReq)) @@ -382,7 +588,7 @@ func _InventoryService_GetProduct_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/GetProduct", + FullMethod: InventoryService_GetProduct_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).GetProduct(ctx, req.(*GetProductReq)) @@ -400,7 +606,7 @@ func _InventoryService_ListProduct_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/ListProduct", + FullMethod: InventoryService_ListProduct_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).ListProduct(ctx, req.(*ListProductReq)) @@ -408,6 +614,168 @@ func _InventoryService_ListProduct_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _InventoryService_GetProductTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProductReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).GetProductTree(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_GetProductTree_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).GetProductTree(ctx, req.(*GetProductReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryService_ListProductSummary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListProductSummaryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).ListProductSummary(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_ListProductSummary_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).ListProductSummary(ctx, req.(*ListProductSummaryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryService_ListColorDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListColorDetailReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).ListColorDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_ListColorDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).ListColorDetail(ctx, req.(*ListColorDetailReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryService_ListPanView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPanViewReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).ListPanView(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_ListPanView_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).ListPanView(ctx, req.(*ListPanViewReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryService_ListBoltView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBoltViewReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).ListBoltView(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_ListBoltView_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).ListBoltView(ctx, req.(*ListBoltViewReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryService_ListPans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPanReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).ListPans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_ListPans_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).ListPans(ctx, req.(*ListPanReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryService_SavePans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SavePansReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).SavePans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_SavePans_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).SavePans(ctx, req.(*SavePansReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryService_ListBolts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBoltReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).ListBolts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_ListBolts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).ListBolts(ctx, req.(*ListBoltReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryService_SaveBolts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveBoltsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryServiceServer).SaveBolts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InventoryService_SaveBolts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryServiceServer).SaveBolts(ctx, req.(*SaveBoltsReq)) + } + return interceptor(ctx, in, info, handler) +} + func _InventoryService_ImportProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ImportProductReq) if err := dec(in); err != nil { @@ -418,7 +786,7 @@ func _InventoryService_ImportProducts_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/ImportProducts", + FullMethod: InventoryService_ImportProducts_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).ImportProducts(ctx, req.(*ImportProductReq)) @@ -436,7 +804,7 @@ func _InventoryService_ListImportLog_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/ListImportLog", + FullMethod: InventoryService_ListImportLog_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).ListImportLog(ctx, req.(*ListImportLogReq)) @@ -454,7 +822,7 @@ func _InventoryService_GetStockSummary_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/GetStockSummary", + FullMethod: InventoryService_GetStockSummary_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).GetStockSummary(ctx, req.(*StockSummaryReq)) @@ -472,7 +840,7 @@ func _InventoryService_GetStockGroup_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/GetStockGroup", + FullMethod: InventoryService_GetStockGroup_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).GetStockGroup(ctx, req.(*StockGroupReq)) @@ -490,7 +858,7 @@ func _InventoryService_CreateStockCheck_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/CreateStockCheck", + FullMethod: InventoryService_CreateStockCheck_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).CreateStockCheck(ctx, req.(*CreateStockCheckReq)) @@ -508,7 +876,7 @@ func _InventoryService_UpdateStockCheck_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/UpdateStockCheck", + FullMethod: InventoryService_UpdateStockCheck_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).UpdateStockCheck(ctx, req.(*UpdateStockCheckReq)) @@ -526,7 +894,7 @@ func _InventoryService_ConfirmStockCheck_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/ConfirmStockCheck", + FullMethod: InventoryService_ConfirmStockCheck_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).ConfirmStockCheck(ctx, req.(*ConfirmStockCheckReq)) @@ -544,7 +912,7 @@ func _InventoryService_GetStockCheck_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/GetStockCheck", + FullMethod: InventoryService_GetStockCheck_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).GetStockCheck(ctx, req.(*GetStockCheckReq)) @@ -562,7 +930,7 @@ func _InventoryService_ListStockCheck_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/ListStockCheck", + FullMethod: InventoryService_ListStockCheck_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).ListStockCheck(ctx, req.(*ListStockCheckReq)) @@ -580,7 +948,7 @@ func _InventoryService_CreateStockAdjust_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/CreateStockAdjust", + FullMethod: InventoryService_CreateStockAdjust_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).CreateStockAdjust(ctx, req.(*CreateStockAdjustReq)) @@ -598,7 +966,7 @@ func _InventoryService_ApproveStockAdjust_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/ApproveStockAdjust", + FullMethod: InventoryService_ApproveStockAdjust_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).ApproveStockAdjust(ctx, req.(*ApproveStockAdjustReq)) @@ -616,7 +984,7 @@ func _InventoryService_GetStockAdjust_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/GetStockAdjust", + FullMethod: InventoryService_GetStockAdjust_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).GetStockAdjust(ctx, req.(*GetStockAdjustReq)) @@ -634,7 +1002,7 @@ func _InventoryService_ListStockAdjust_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/inventory.InventoryService/ListStockAdjust", + FullMethod: InventoryService_ListStockAdjust_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InventoryServiceServer).ListStockAdjust(ctx, req.(*ListStockAdjustReq)) @@ -669,6 +1037,42 @@ var InventoryService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListProduct", Handler: _InventoryService_ListProduct_Handler, }, + { + MethodName: "GetProductTree", + Handler: _InventoryService_GetProductTree_Handler, + }, + { + MethodName: "ListProductSummary", + Handler: _InventoryService_ListProductSummary_Handler, + }, + { + MethodName: "ListColorDetail", + Handler: _InventoryService_ListColorDetail_Handler, + }, + { + MethodName: "ListPanView", + Handler: _InventoryService_ListPanView_Handler, + }, + { + MethodName: "ListBoltView", + Handler: _InventoryService_ListBoltView_Handler, + }, + { + MethodName: "ListPans", + Handler: _InventoryService_ListPans_Handler, + }, + { + MethodName: "SavePans", + Handler: _InventoryService_SavePans_Handler, + }, + { + MethodName: "ListBolts", + Handler: _InventoryService_ListBolts_Handler, + }, + { + MethodName: "SaveBolts", + Handler: _InventoryService_SaveBolts_Handler, + }, { MethodName: "ImportProducts", Handler: _InventoryService_ImportProducts_Handler, @@ -723,5 +1127,5 @@ var InventoryService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "rpc/inventory/inventory.proto", + Metadata: "inventory.proto", } diff --git a/rpc/system/internal/logic/createrolelogic.go b/rpc/system/internal/logic/createrolelogic.go index 680ef4e..e3e7336 100644 --- a/rpc/system/internal/logic/createrolelogic.go +++ b/rpc/system/internal/logic/createrolelogic.go @@ -4,6 +4,7 @@ import ( "context" "muyu-apiserver/model" + "muyu-apiserver/pkg/tenantctx" "muyu-apiserver/pkg/uid" "muyu-apiserver/rpc/system/internal/svc" "muyu-apiserver/rpc/system/pb" @@ -28,9 +29,11 @@ func NewCreateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create } func (l *CreateRoleLogic) CreateRole(in *pb.CreateRoleReq) (*pb.IdResp, error) { + tenantId := tenantctx.ExtractTenantId(l.ctx) roleId := uid.Generate() _, err := l.svcCtx.RoleModel.Insert(l.ctx, &model.SysRole{ + TenantId: tenantId, RoleId: roleId, RoleName: in.RoleName, RoleKey: in.RoleKey, diff --git a/worker/graphsync/go.sum b/worker/graphsync/go.sum new file mode 100644 index 0000000..4804e3c --- /dev/null +++ b/worker/graphsync/go.sum @@ -0,0 +1,96 @@ +github.com/IBM/sarama v1.43.3 h1:Yj6L2IaNvb2mRBop39N7mmJAHBVY3dTPncr3qGVkxPA= +github.com/IBM/sarama v1.43.3/go.mod h1:FVIRaLrhK3Cla/9FfRF5X9Zua2KpS3SYIXxhac1H+FQ= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= +github.com/eapache/go-resiliency v1.7.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= +github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= +github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= +github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= +github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/neo4j/neo4j-go-driver/v5 v5.28.0 h1:chDT68PHNa8JZRmjSkGzAbk1weLWo4rMtDvccvpobg0= +github.com/neo4j/neo4j-go-driver/v5 v5.28.0/go.mod h1:Vff8OwT7QpLm7L2yYr85XNWe9Rbqlbeb9asNXJTHO4k= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=