New file |
| | |
| | | package v1 |
| | | |
| | | import ( |
| | | "apsClient/model/request" |
| | | _ "apsClient/model/response" |
| | | "apsClient/pkg/contextx" |
| | | "apsClient/pkg/logx" |
| | | "apsClient/pkg/safe" |
| | | "apsClient/service" |
| | | "github.com/gin-gonic/gin" |
| | | ) |
| | | |
| | | type NoticeApi struct{} |
| | | |
| | | // TaskStart |
| | | // @Tags Base |
| | | // @Summary 任务开启通知 |
| | | // @Produce application/json |
| | | // @Param object body request.TaskInfo true "查询参数" |
| | | // @Success 200 {object} contextx.Response{data=response.LoginResponse} "成功" |
| | | // @Router /v1/notice/task/start [post] |
| | | func (slf *NoticeApi) TaskStart(c *gin.Context) { |
| | | var params request.TaskInfo |
| | | ctx, ok := contextx.NewContext(c, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | safe.Go(func() { |
| | | resp, err := service.ProcessModel{}.GetProcessModel(service.GetProcessModelParams{ |
| | | WorkOrder: params.WorkOrder, |
| | | OrderId: params.OrderId, |
| | | Product: params.Product, |
| | | Procedure: params.Procedure, |
| | | Device: params.Device, |
| | | }) |
| | | if err != nil { |
| | | logx.Errorf("TaskStart Notice GetProcessModel error: %v", err.Error()) |
| | | return |
| | | } |
| | | logx.Infof("TaskStart Notice GetProcessModel: %+v", resp) |
| | | }) |
| | | |
| | | ctx.Ok() |
| | | } |
| | |
| | | "alHost": "172.20.11.128", |
| | | "host": "172.20.11.127", |
| | | "ip": "172.20.11.127" |
| | | }, |
| | | "Services":{ |
| | | "apsServer": "http://127.0.0.1:9081" |
| | | } |
| | | } |
| | | |
| | |
| | | IP string // tmp ip |
| | | } |
| | | |
| | | Services struct { |
| | | ApsServer string |
| | | } |
| | | |
| | | config struct { |
| | | // 系统配置 |
| | | System System |
| | |
| | | |
| | | // k8s配置 |
| | | K8s K8s |
| | | |
| | | //Services Address |
| | | Services Services |
| | | } |
| | | ) |
| | | |
| | |
| | | UserTypePrimary // 主账户 |
| | | UserTypeSub // 子账户 |
| | | ) |
| | | |
| | | const ( |
| | | ApsServerHost = "" |
| | | ) |
| | |
| | | "host": "{{.Host}}", |
| | | "basePath": "{{.BasePath}}", |
| | | "paths": { |
| | | "/api/base/login": { |
| | | "/v1/notice/task/start": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | "tags": [ |
| | | "Base" |
| | | ], |
| | | "summary": "用户登录", |
| | | "summary": "任务开启通知", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.Login" |
| | | "$ref": "#/definitions/request.TaskInfo" |
| | | } |
| | | } |
| | | ], |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.Login": { |
| | | "request.TaskInfo": { |
| | | "type": "object", |
| | | "properties": { |
| | | "captcha": { |
| | | "description": "验证码", |
| | | "device": { |
| | | "description": "设备", |
| | | "type": "string" |
| | | }, |
| | | "captchaId": { |
| | | "description": "验证码ID", |
| | | "orderId": { |
| | | "description": "订单号", |
| | | "type": "string" |
| | | }, |
| | | "password": { |
| | | "description": "密码", |
| | | "description": "产品", |
| | | "type": "string" |
| | | }, |
| | | "username": { |
| | | "description": "用户名", |
| | | "procedure": { |
| | | "description": "工序", |
| | | "type": "string" |
| | | }, |
| | | "workOrder": { |
| | | "description": "工单", |
| | | "type": "string" |
| | | } |
| | | } |
| | |
| | | "contact": {} |
| | | }, |
| | | "paths": { |
| | | "/api/base/login": { |
| | | "/v1/notice/task/start": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | "tags": [ |
| | | "Base" |
| | | ], |
| | | "summary": "用户登录", |
| | | "summary": "任务开启通知", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.Login" |
| | | "$ref": "#/definitions/request.TaskInfo" |
| | | } |
| | | } |
| | | ], |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.Login": { |
| | | "request.TaskInfo": { |
| | | "type": "object", |
| | | "properties": { |
| | | "captcha": { |
| | | "description": "验证码", |
| | | "device": { |
| | | "description": "设备", |
| | | "type": "string" |
| | | }, |
| | | "captchaId": { |
| | | "description": "验证码ID", |
| | | "orderId": { |
| | | "description": "订单号", |
| | | "type": "string" |
| | | }, |
| | | "password": { |
| | | "description": "密码", |
| | | "description": "产品", |
| | | "type": "string" |
| | | }, |
| | | "username": { |
| | | "description": "用户名", |
| | | "procedure": { |
| | | "description": "工序", |
| | | "type": "string" |
| | | }, |
| | | "workOrder": { |
| | | "description": "工单", |
| | | "type": "string" |
| | | } |
| | | } |
| | |
| | | username: |
| | | type: string |
| | | type: object |
| | | request.Login: |
| | | request.TaskInfo: |
| | | properties: |
| | | captcha: |
| | | description: 验证码 |
| | | device: |
| | | description: 设备 |
| | | type: string |
| | | captchaId: |
| | | description: 验证码ID |
| | | orderId: |
| | | description: 订单号 |
| | | type: string |
| | | password: |
| | | description: 密码 |
| | | description: 产品 |
| | | type: string |
| | | username: |
| | | description: 用户名 |
| | | procedure: |
| | | description: 工序 |
| | | type: string |
| | | workOrder: |
| | | description: 工单 |
| | | type: string |
| | | type: object |
| | | response.LoginResponse: |
| | |
| | | info: |
| | | contact: {} |
| | | paths: |
| | | /api/base/login: |
| | | /v1/notice/task/start: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.Login' |
| | | $ref: '#/definitions/request.TaskInfo' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | |
| | | data: |
| | | $ref: '#/definitions/response.LoginResponse' |
| | | type: object |
| | | summary: 用户登录 |
| | | summary: 任务开启通知 |
| | | tags: |
| | | - Base |
| | | swagger: "2.0" |
| | |
| | | [2023-08-14 20:10:31] [error] [main.main:22] model Init err:Error 1067 (42000): Invalid default value for 'nick_name' |
| | | [2023-08-14 20:10:43] [error] [gorm.io/gorm/migrator.Migrator.CreateTable.func1:281] trace {"error": "Error 1067 (42000): Invalid default value for 'nick_name'", "elapsed": 0.0010015, "rows": 0, "sql": "CREATE TABLE `user` (`id` varchar(255) COMMENT '用户ID',`username` varchar(255) COMMENT '用户登录名',`user_type` int(11) COMMENT '用户类型 1超级管理员 2主账户 3子账户',`password` varchar(255) COMMENT '用户登录密码',`nick_name` varchar(255) DEFAULT '系统用户' COMMENT '用户昵称',`header_image` mediumtext COMMENT '用户头像',`phone` varchar(255) COMMENT '用户手机号',`enable` tinyint(1) COMMENT '用户是否被冻结',`parent_id` varchar(255) COMMENT '父用户ID',`parent_name` varchar(255) COMMENT '父用户名称',`company_name` varchar(255) COMMENT '公司名称',`company_email` varchar(255) COMMENT '公司邮箱',`company_contact` varchar(255) COMMENT '公司联系人姓名',`company_province` varchar(255) COMMENT '公司所在省',`company_city` varchar(255) COMMENT '公司所在市',`company_trade` varchar(255) COMMENT '公司行业',`pos` varchar(255) COMMENT '岗位',`modified_pwd` tinyint(1) COMMENT '是否改过密码',`create_time` bigint(20) COMMENT '创建时间',`update_time` bigint(20) COMMENT '更新时间',`ip` varchar(255) COMMENT '集群Ip',`port` varchar(255) COMMENT '端口号',`status` int(11) COMMENT '用户审核状态 0:禁用',`company_logo` mediumtext COMMENT '公司logo',`system_name` varchar(255) COMMENT '系统名称',PRIMARY KEY (`id`),INDEX `idx_user_username` (`username`))"} |
| | | [2023-08-14 20:10:43] [error] [main.main:22] model Init err:Error 1067 (42000): Invalid default value for 'nick_name' |
| | | [2023-08-15 10:34:05] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: Post "/api-s/v1/processParams/info": unsupported protocol scheme "" |
| | | [2023-08-15 10:38:12] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: Post "/api-s/v1/processParams/info": unsupported protocol scheme "" |
| | | [2023-08-15 10:38:23] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: Post "/api-s/v1/processParams/info": unsupported protocol scheme "" |
| | | [2023-08-15 10:38:28] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: Post "/api-s/v1/processParams/info": unsupported protocol scheme "" |
| | | [2023-08-15 10:38:55] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: parse "127.0.0.1:9081/api-s/v1/processParams/info": first path segment in URL cannot contain colon |
| | | [2023-08-15 10:40:21] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: parse "127.0.0.1:9081/api-s/v1/processParams/info": first path segment in URL cannot contain colon |
| | | [2023-08-15 10:42:38] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: invalid character 'p' after top-level value |
| | | [2023-08-15 10:43:02] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: Post "http://127.0.0.1:9081/api-s/v1/processParams/info": EOF |
| | | [2023-08-15 10:48:32] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: json: cannot unmarshal number into Go struct field GetProcessModelResponse.Code of type string |
| | | [2023-08-15 10:49:36] [error] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:37] TaskStart Notice GetProcessModel error: json: cannot unmarshal number into Go struct field GetProcessModelResponse.Code of type string |
| | |
| | | [2023-08-14 20:10:43] [debug] [gorm.io/gorm/migrator.Migrator.HasTable.func1:309] trace {"elapsed": 0.0020024, "rows": 1, "sql": "SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'aps_client%' ORDER BY SCHEMA_NAME='aps_client' DESC,SCHEMA_NAME limit 1"} |
| | | [2023-08-14 20:10:43] [debug] [gorm.io/gorm/migrator.Migrator.HasTable.func1:310] trace {"elapsed": 0.0010035, "rows": -1, "sql": "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'aps_client' AND table_name = 'user' AND table_type = 'BASE TABLE'"} |
| | | [2023-08-14 20:11:04] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:32:54] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:33:18] [info] [main.shutdown:42] apsClient exited... |
| | | [2023-08-15 10:33:20] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:34:05] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:37:58] [info] [main.shutdown:42] apsClient exited... |
| | | [2023-08-15 10:38:01] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:38:12] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:38:23] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:38:28] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:38:50] [info] [main.shutdown:42] apsClient exited... |
| | | [2023-08-15 10:38:52] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:38:55] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:39:11] [info] [main.shutdown:42] apsClient exited... |
| | | [2023-08-15 10:39:19] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:39:26] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:40:21] [info] [main.shutdown:42] apsClient exited... |
| | | [2023-08-15 10:40:22] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:40:26] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:42:41] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:43:07] [info] [main.shutdown:42] apsClient exited... |
| | | [2023-08-15 10:43:09] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:44:44] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:44:44] [info] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:40] TaskStart Notice GetProcessModel: &{Number: OrderId: Product: Procedure: WorkOrder: Device: ParamsMap:map[]} |
| | | [2023-08-15 10:45:37] [info] [main.shutdown:42] apsClient exited... |
| | | [2023-08-15 10:45:39] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:45:42] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:48:20] [info] [apsClient/api/v1.(*NoticeApi).TaskStart.func1:40] TaskStart Notice GetProcessModel: &{Number: OrderId: Product: Procedure: WorkOrder: Device: ParamsMap:map[]} |
| | | [2023-08-15 10:48:20] [info] [main.shutdown:42] apsClient exited... |
| | | [2023-08-15 10:48:23] [info] [main.main:27] apsClient start serve... |
| | | [2023-08-15 10:48:25] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:48:45] [info] [apsClient/pkg/contextx.NewContext.func1:38] 192.168.20.120 | POST /v1/notice/task/start | uid: | &{OrderId:string Product:string Procedure:string WorkOrder:string Device:string} |
| | | [2023-08-15 10:49:54] [info] [main.shutdown:42] apsClient exited... |
| | |
| | | type GetById struct { |
| | | ID uint `json:"id"` // 主键ID |
| | | } |
| | | |
| | | type GetByUserId struct { |
| | | UserId string `json:"userId"` // 用户ID |
| | | } |
New file |
| | |
| | | package request |
| | | |
| | | // TaskInfo 任务开启通知请求参数 |
| | | type TaskInfo struct { |
| | | OrderId string `json:"orderId"` // 订单号 |
| | | Product string `json:"password"` // 产品 |
| | | Procedure string `json:"procedure"` // 工序 |
| | | WorkOrder string `json:"workOrder"` // 工单 |
| | | Device string `json:"device"` // 设备 |
| | | } |
| | |
| | | const ( |
| | | OK = 200 |
| | | |
| | | UnknownErr = 2001 // 未知错误 |
| | | DBErr = 2002 // db错误 |
| | | RedisErr = 2003 // redis错误 |
| | | ParamsErr = 2004 // 请求参数错误 |
| | | UserNotExist = 2005 // 用户不存在 |
| | | PasswordErr = 2006 // 密码错误 |
| | | UserForbidden = 2007 // 用户被禁用 |
| | | CaptchaGenerateFailed = 2008 // 验证码生成失败 |
| | | CaptchaErr = 2009 // 验证码错误 |
| | | CreateTokenErr = 2010 // 创建token失败 |
| | | JWTInBlackList = 2011 // JWT在白名单 |
| | | JWTDisabled = 2012 // JWT失效 |
| | | JWTEmpty = 2013 // JWT为空 |
| | | JWTExpire = 2014 // JWT过期 |
| | | JWTParseErr = 2015 // JWT解析失败 |
| | | UserNameExistErr = 2016 // 用户名已存在 |
| | | ChildrenExistErr = 2017 // 存在子菜单 |
| | | MenuNotExist = 2018 // 菜单不存在 |
| | | MenuNameExistErr = 2019 // 菜单名已存在 |
| | | DeviceIPExistErr = 2020 // 该设备IP已存在 |
| | | DeviceInstallRancherErr = 2021 // 安装rancher失败 |
| | | ClusterNameExistErr = 2022 // 該集群已經存在 |
| | | CreateDatabaseErr = 2023 // 创建数据库错误 |
| | | CreateDatabaseUserErr = 2024 // 创建数据库用户错误 |
| | | CreateClusterErr = 2025 // 创建集群失败 |
| | | GetClusterErr = 2026 // 获取集群失败 |
| | | GetClusterKubeConfigErr = 2027 // 获取kube config失败 |
| | | ClusterInstallDockerErr = 2028 // 安装docker失败 |
| | | ClusterInstallKubectlErr = 2029 // 安装kubectl失败 |
| | | ClusterDeployKubernetesRolesErr = 2030 // 部署kubernetes角色失败 |
| | | ClusterGetNodeCommandErr = 2031 // 获取node command失败 |
| | | UserHasCluster = 2032 // 删除用户失败,该用户下存在集群 |
| | | NoPowerErr = 2033 // 没有权限 |
| | | UploadImageErr = 2034 // 上传图像失败 |
| | | UnknownErr = 2001 // 未知错误 |
| | | DBErr = 2002 // db错误 |
| | | RedisErr = 2003 // redis错误 |
| | | ParamsErr = 2004 // 请求参数错误 |
| | | ) |
| | |
| | | package ecode |
| | | |
| | | var MsgFlags = map[int]string{ |
| | | UnknownErr: "未知错误", |
| | | DBErr: "db错误", |
| | | RedisErr: "redis错误", |
| | | ParamsErr: "请求参数错误", |
| | | UserNotExist: "用户不存在", |
| | | PasswordErr: "密码错误", |
| | | UserForbidden: "用户被禁用", |
| | | CaptchaGenerateFailed: "验证码生成失败", |
| | | CaptchaErr: "验证码错误", |
| | | CreateTokenErr: "创建token失败", |
| | | JWTInBlackList: "JWT在白名单", |
| | | JWTDisabled: "JWT失效", |
| | | JWTEmpty: "JWT为空", |
| | | JWTExpire: "JWT过期", |
| | | JWTParseErr: "JWT解析失败", |
| | | UserNameExistErr: "用户名已存在", |
| | | ChildrenExistErr: "存在子菜单", |
| | | MenuNotExist: "菜单不存在", |
| | | MenuNameExistErr: "菜单名已存在", |
| | | UnknownErr: "未知错误", |
| | | DBErr: "db错误", |
| | | RedisErr: "redis错误", |
| | | ParamsErr: "请求参数错误", |
| | | } |
| | | |
| | | func GetMsg(errCode int) (errMsg string) { |
| | |
| | | import ( |
| | | "bytes" |
| | | "encoding/json" |
| | | "io/ioutil" |
| | | "errors" |
| | | "io" |
| | | "net/http" |
| | | "time" |
| | | ) |
| | |
| | | } |
| | | defer resp.Body.Close() |
| | | |
| | | respBytes, err := ioutil.ReadAll(resp.Body) |
| | | respBytes, err := io.ReadAll(resp.Body) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | return respBytes, nil |
| | | } |
| | | |
| | | func SendPostAndParseJson(url string, post, response interface{}) (err error) { |
| | | if response == nil { |
| | | return errors.New("response is not set") |
| | | } |
| | | |
| | | respBytes, err := SendPost(http.Header{}, url, post) |
| | | if err != nil { |
| | | return err |
| | | } |
| | | return json.Unmarshal(respBytes, &response) |
| | | } |
| | |
| | | package router |
| | | |
| | | import ( |
| | | v1 "apsClient/api/v1" |
| | | "apsClient/conf" |
| | | _ "apsClient/docs" |
| | | "github.com/gin-contrib/cors" |
| | |
| | | c.JSON(http.StatusOK, "ok") |
| | | }) |
| | | } |
| | | |
| | | v1Group := Router.Group("v1") |
| | | |
| | | // 接收通知 |
| | | noticeApi := new(v1.NoticeApi) |
| | | noticeGroup := v1Group.Group("notice") |
| | | { |
| | | noticeGroup.POST("task/start", noticeApi.TaskStart) // 任务开启通知 |
| | | } |
| | | |
| | | return Router |
| | | } |
New file |
| | |
| | | package service |
| | | |
| | | import ( |
| | | "apsClient/conf" |
| | | "apsClient/pkg/httpx" |
| | | ) |
| | | |
| | | type ProcessModel struct{} |
| | | |
| | | const ( |
| | | GetProcessModelUrl = "/api-s/v1/processParams/info" |
| | | ) |
| | | |
| | | type GetProcessModelParams struct { |
| | | WorkOrder string `json:"workOrder,omitempty" form:"workOrder"` //工序编号 |
| | | OrderId string `json:"orderId"` // 订单号 |
| | | Product string `json:"password"` // 产品 |
| | | Procedure string `json:"procedure"` // 工序 |
| | | Device string `json:"device"` // 设备 |
| | | } |
| | | type GetProcessModel struct { |
| | | Number string `json:"number"` //工艺模型编号 |
| | | OrderId string `json:"orderId"` //订单id |
| | | Product string `json:"product"` //产品名称 |
| | | Procedure string `json:"procedure"` //工序 |
| | | WorkOrder string `json:"workOrder"` //工单 |
| | | Device string `json:"device"` //设备 |
| | | ParamsMap map[string]interface{} `json:"paramsMap"` |
| | | } |
| | | |
| | | type GetProcessModelResponse struct { |
| | | Code int |
| | | Msg string |
| | | Data GetProcessModel |
| | | } |
| | | |
| | | // GetProcessModel 获取工艺模型 |
| | | func (slf ProcessModel) GetProcessModel(params GetProcessModelParams) (GetProcessModel GetProcessModel, err error) { |
| | | resp := new(GetProcessModelResponse) |
| | | err = httpx.SendPostAndParseJson(conf.Conf.Services.ApsServer+GetProcessModelUrl, params, resp) |
| | | return resp.Data, err |
| | | } |