From a89c3af49d0be3e635ef13b3bd3dd9410e4d6d46 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 03 八月 2023 20:03:12 +0800 Subject: [PATCH] 服务单管理 --- model/severity.go | 114 + router/serviceType.go | 17 service/serviceOrder.go | 66 service/priorityLevel.go | 66 service/serviceType.go | 66 docs/swagger.yaml | 750 +++++++++ router/priorityLevel.go | 17 model/request/serviceOrder.go | 22 model/serviceType.go | 114 + api/v1/serviceType.go | 109 + model/request/severity.go | 22 router/faq.go | 17 constvar/severity.go | 12 constvar/priorityLevel.go | 12 constvar/faq.go | 12 router/severity.go | 17 router/serviceOrder.go | 17 model/request/priorityLevel.go | 22 api/v1/serviceOrder.go | 109 + docs/docs.go | 1144 ++++++++++++++ model/priorityLevel.go | 114 + docs/swagger.json | 1144 ++++++++++++++ service/severity.go | 66 model/serviceOrder.go | 163 ++ api/v1/priorityLevel.go | 106 + api/v1/faq.go | 106 + constvar/serviceOrder.go | 12 model/request/faq.go | 22 router/index.go | 5 constvar/serviceType.go | 12 api/v1/severity.go | 109 + model/faq.go | 114 + model/request/serviceType.go | 22 service/faq.go | 66 34 files changed, 4,778 insertions(+), 8 deletions(-) diff --git a/api/v1/faq.go b/api/v1/faq.go new file mode 100644 index 0000000..9995d36 --- /dev/null +++ b/api/v1/faq.go @@ -0,0 +1,106 @@ +package v1 + +import ( + "aps_crm/model/request" + "aps_crm/model/response" + "aps_crm/pkg/contextx" + "aps_crm/pkg/ecode" + "aps_crm/service" + "github.com/gin-gonic/gin" + "strconv" +) + +type FaqApi struct{} + +// Add +// @Tags 甯歌闂绠$悊 +// @Summary 娣诲姞甯歌闂 +// @Produce application/json +// @Param object body request.AddFaq true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/faq/add [post] +func (s *FaqApi) Add(c *gin.Context) { + var params request.AddFaq + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + errCode := service.NewFaqService().AddFaq(¶ms.Faq) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Delete +// @Tags 甯歌闂绠$悊 +// @Summary 鍒犻櫎甯歌闂 +// @Produce application/json +// @Param id path int true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/faq/delete/{id} [delete] +func (s *FaqApi) Delete(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + id, _ := strconv.Atoi(c.Param("id")) + errCode := service.NewFaqService().DeleteFaq(id) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Update +// @Tags 甯歌闂绠$悊 +// @Summary 鏇存柊甯歌闂 +// @Produce application/json +// @Param object body request.UpdateFaq true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/faq/update [put] +func (s *FaqApi) Update(c *gin.Context) { + var params request.UpdateFaq + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + errCode := service.NewFaqService().UpdateFaq(¶ms.Faq) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// List +// @Tags 甯歌闂绠$悊 +// @Summary 鑾峰彇甯歌闂鍒楄〃 +// @Produce application/json +// @Success 200 {object} response.ListResponse{data=[]model.Faq} +// @Router /api/faq/list [get] +func (s *FaqApi) List(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + faq, total, errCode := service.NewFaqService().GetFaqList() + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ListResponse{ + Data: faq, + Count: total, + }) +} diff --git a/api/v1/priorityLevel.go b/api/v1/priorityLevel.go new file mode 100644 index 0000000..18ddfd4 --- /dev/null +++ b/api/v1/priorityLevel.go @@ -0,0 +1,106 @@ +package v1 + +import ( + "aps_crm/model/request" + "aps_crm/model/response" + "aps_crm/pkg/contextx" + "aps_crm/pkg/ecode" + "aps_crm/service" + "github.com/gin-gonic/gin" + "strconv" +) + +type PriorityLevelApi struct{} + +// Add +// @Tags 浼樺厛绾у埆绠$悊 +// @Summary 娣诲姞浼樺厛绾у埆 +// @Produce application/json +// @Param object body request.AddPriorityLevel true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/priorityLevel/add [post] +func (s *PriorityLevelApi) Add(c *gin.Context) { + var params request.AddPriorityLevel + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + errCode := service.NewPriorityLevelService().AddPriorityLevel(¶ms.PriorityLevel) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Delete +// @Tags 浼樺厛绾у埆绠$悊 +// @Summary 鍒犻櫎浼樺厛绾у埆 +// @Produce application/json +// @Param id path int true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/priorityLevel/delete/{id} [delete] +func (s *PriorityLevelApi) Delete(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + id, _ := strconv.Atoi(c.Param("id")) + errCode := service.NewPriorityLevelService().DeletePriorityLevel(id) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Update +// @Tags 浼樺厛绾у埆绠$悊 +// @Summary 鏇存柊浼樺厛绾у埆 +// @Produce application/json +// @Param object body request.UpdatePriorityLevel true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/priorityLevel/update [put] +func (s *PriorityLevelApi) Update(c *gin.Context) { + var params request.UpdatePriorityLevel + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + errCode := service.NewPriorityLevelService().UpdatePriorityLevel(¶ms.PriorityLevel) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// List +// @Tags 浼樺厛绾у埆绠$悊 +// @Summary 鑾峰彇浼樺厛绾у埆鍒楄〃 +// @Produce application/json +// @Success 200 {object} response.ListResponse{data=[]model.PriorityLevel} +// @Router /api/priorityLevel/list [get] +func (s *PriorityLevelApi) List(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + priorityLevel, total, errCode := service.NewPriorityLevelService().GetPriorityLevelList() + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ListResponse{ + Data: priorityLevel, + Count: total, + }) +} diff --git a/api/v1/serviceOrder.go b/api/v1/serviceOrder.go new file mode 100644 index 0000000..3beabbd --- /dev/null +++ b/api/v1/serviceOrder.go @@ -0,0 +1,109 @@ +package v1 + +import ( + "aps_crm/model" + "aps_crm/model/request" + "aps_crm/model/response" + "aps_crm/pkg/contextx" + "aps_crm/pkg/ecode" + "aps_crm/service" + "github.com/gin-gonic/gin" + "strconv" +) + +type ServiceOrderApi struct{} + +// Add +// @Tags 鏈嶅姟鍗曠鐞� +// @Summary 娣诲姞鏈嶅姟鍗� +// @Produce application/json +// @Param object body request.AddServiceOrder true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/serviceOrder/add [post] +func (s *ServiceOrderApi) Add(c *gin.Context) { + var params request.AddServiceOrder + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + serviceOrder := new(model.ServiceOrder) + + errCode := service.NewServiceOrderService().AddServiceOrder(serviceOrder) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Delete +// @Tags 鏈嶅姟鍗曠鐞� +// @Summary 鍒犻櫎鏈嶅姟鍗� +// @Produce application/json +// @Param id path int true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/serviceOrder/delete/{id} [delete] +func (s *ServiceOrderApi) Delete(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + id, _ := strconv.Atoi(c.Param("id")) + errCode := service.NewServiceOrderService().DeleteServiceOrder(id) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Update +// @Tags 鏈嶅姟鍗曠鐞� +// @Summary 鏇存柊鏈嶅姟鍗� +// @Produce application/json +// @Param object body request.UpdateServiceOrder true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/serviceOrder/update [put] +func (s *ServiceOrderApi) Update(c *gin.Context) { + var params request.UpdateServiceOrder + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + errCode := service.NewServiceOrderService().UpdateServiceOrder(¶ms.ServiceOrder) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// List +// @Tags 鏈嶅姟鍗曠鐞� +// @Summary 鑾峰彇鏈嶅姟鍗曞垪琛� +// @Produce application/json +// @Success 200 {object} response.ListResponse{data=[]model.ServiceOrder} +// @Router /api/serviceOrder/list [get] +func (s *ServiceOrderApi) List(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + serviceOrder, total, errCode := service.NewServiceOrderService().GetServiceOrderList() + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ListResponse{ + Data: serviceOrder, + Count: total, + }) +} diff --git a/api/v1/serviceType.go b/api/v1/serviceType.go new file mode 100644 index 0000000..5e4ba9f --- /dev/null +++ b/api/v1/serviceType.go @@ -0,0 +1,109 @@ +package v1 + +import ( + "aps_crm/model" + "aps_crm/model/request" + "aps_crm/model/response" + "aps_crm/pkg/contextx" + "aps_crm/pkg/ecode" + "aps_crm/service" + "github.com/gin-gonic/gin" + "strconv" +) + +type ServiceTypeApi struct{} + +// Add +// @Tags 鏈嶅姟绫诲瀷绠$悊 +// @Summary 娣诲姞鏈嶅姟绫诲瀷 +// @Produce application/json +// @Param object body request.AddServiceType true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/serviceType/add [post] +func (s *ServiceTypeApi) Add(c *gin.Context) { + var params request.AddServiceType + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + serviceType := new(model.ServiceType) + + errCode := service.NewServiceTypeService().AddServiceType(serviceType) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Delete +// @Tags 鏈嶅姟绫诲瀷绠$悊 +// @Summary 鍒犻櫎鏈嶅姟绫诲瀷 +// @Produce application/json +// @Param id path int true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/serviceType/delete/{id} [delete] +func (s *ServiceTypeApi) Delete(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + id, _ := strconv.Atoi(c.Param("id")) + errCode := service.NewServiceTypeService().DeleteServiceType(id) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Update +// @Tags 鏈嶅姟绫诲瀷绠$悊 +// @Summary 鏇存柊鏈嶅姟绫诲瀷 +// @Produce application/json +// @Param object body request.UpdateServiceType true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/serviceType/update [put] +func (s *ServiceTypeApi) Update(c *gin.Context) { + var params request.UpdateServiceType + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + errCode := service.NewServiceTypeService().UpdateServiceType(¶ms.ServiceType) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// List +// @Tags 鏈嶅姟绫诲瀷绠$悊 +// @Summary 鑾峰彇鏈嶅姟绫诲瀷鍒楄〃 +// @Produce application/json +// @Success 200 {object} response.ListResponse{data=[]model.ServiceType} +// @Router /api/serviceType/list [get] +func (s *ServiceTypeApi) List(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + serviceType, total, errCode := service.NewServiceTypeService().GetServiceTypeList() + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ListResponse{ + Data: serviceType, + Count: total, + }) +} diff --git a/api/v1/severity.go b/api/v1/severity.go new file mode 100644 index 0000000..e7f5e7a --- /dev/null +++ b/api/v1/severity.go @@ -0,0 +1,109 @@ +package v1 + +import ( + "aps_crm/model" + "aps_crm/model/request" + "aps_crm/model/response" + "aps_crm/pkg/contextx" + "aps_crm/pkg/ecode" + "aps_crm/service" + "github.com/gin-gonic/gin" + "strconv" +) + +type SeverityApi struct{} + +// Add +// @Tags 涓ラ噸绋嬪害绠$悊 +// @Summary 娣诲姞涓ラ噸绋嬪害 +// @Produce application/json +// @Param object body request.AddSeverity true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/severity/add [post] +func (s *SeverityApi) Add(c *gin.Context) { + var params request.AddSeverity + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + severity := new(model.Severity) + + errCode := service.NewSeverityService().AddSeverity(severity) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Delete +// @Tags 涓ラ噸绋嬪害绠$悊 +// @Summary 鍒犻櫎涓ラ噸绋嬪害 +// @Produce application/json +// @Param id path int true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/severity/delete/{id} [delete] +func (s *SeverityApi) Delete(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + id, _ := strconv.Atoi(c.Param("id")) + errCode := service.NewSeverityService().DeleteSeverity(id) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// Update +// @Tags 涓ラ噸绋嬪害绠$悊 +// @Summary 鏇存柊涓ラ噸绋嬪害 +// @Produce application/json +// @Param object body request.UpdateSeverity true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/severity/update [put] +func (s *SeverityApi) Update(c *gin.Context) { + var params request.UpdateSeverity + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + errCode := service.NewSeverityService().UpdateSeverity(¶ms.Severity) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} + +// List +// @Tags 涓ラ噸绋嬪害绠$悊 +// @Summary 鑾峰彇涓ラ噸绋嬪害鍒楄〃 +// @Produce application/json +// @Success 200 {object} response.ListResponse{data=[]model.Severity} +// @Router /api/severity/list [get] +func (s *SeverityApi) List(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } + + severity, total, errCode := service.NewSeverityService().GetSeverityList() + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ListResponse{ + Data: severity, + Count: total, + }) +} diff --git a/constvar/faq.go b/constvar/faq.go new file mode 100644 index 0000000..df1e10f --- /dev/null +++ b/constvar/faq.go @@ -0,0 +1,12 @@ +package constvar +type FaqQueryClass string + +const ( + FaqQueryClassExpireLessThen60Days FaqQueryClass = "" +) + +type FaqKeywordType string + +const ( + FaqKeywordCustomerName FaqKeywordType = "" +) diff --git a/constvar/priorityLevel.go b/constvar/priorityLevel.go new file mode 100644 index 0000000..fab4303 --- /dev/null +++ b/constvar/priorityLevel.go @@ -0,0 +1,12 @@ +package constvar +type PriorityLevelQueryClass string + +const ( + PriorityLevelQueryClassExpireLessThen60Days PriorityLevelQueryClass = "" +) + +type PriorityLevelKeywordType string + +const ( + PriorityLevelKeywordCustomerName PriorityLevelKeywordType = "" +) diff --git a/constvar/serviceOrder.go b/constvar/serviceOrder.go new file mode 100644 index 0000000..959e402 --- /dev/null +++ b/constvar/serviceOrder.go @@ -0,0 +1,12 @@ +package constvar +type ServiceOrderQueryClass string + +const ( + ServiceOrderQueryClassExpireLessThen60Days ServiceOrderQueryClass = "" +) + +type ServiceOrderKeywordType string + +const ( + ServiceOrderKeywordCustomerName ServiceOrderKeywordType = "" +) diff --git a/constvar/serviceType.go b/constvar/serviceType.go new file mode 100644 index 0000000..3a8c856 --- /dev/null +++ b/constvar/serviceType.go @@ -0,0 +1,12 @@ +package constvar +type ServiceTypeQueryClass string + +const ( + ServiceTypeQueryClassExpireLessThen60Days ServiceTypeQueryClass = "" +) + +type ServiceTypeKeywordType string + +const ( + ServiceTypeKeywordCustomerName ServiceTypeKeywordType = "" +) diff --git a/constvar/severity.go b/constvar/severity.go new file mode 100644 index 0000000..f9781c7 --- /dev/null +++ b/constvar/severity.go @@ -0,0 +1,12 @@ +package constvar +type SeverityQueryClass string + +const ( + SeverityQueryClassExpireLessThen60Days SeverityQueryClass = "" +) + +type SeverityKeywordType string + +const ( + SeverityKeywordCustomerName SeverityKeywordType = "" +) diff --git a/docs/docs.go b/docs/docs.go index 9e3d7b1..041b0a8 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -2074,6 +2074,128 @@ } } }, + "/api/faq/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "甯歌闂绠$悊" + ], + "summary": "娣诲姞甯歌闂", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddFaq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/faq/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "甯歌闂绠$悊" + ], + "summary": "鍒犻櫎甯歌闂", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/faq/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "甯歌闂绠$悊" + ], + "summary": "鑾峰彇甯歌闂鍒楄〃", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Faq" + } + } + } + } + ] + } + } + } + } + }, + "/api/faq/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "甯歌闂绠$悊" + ], + "summary": "鏇存柊甯歌闂", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateFaq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, "/api/followRecord/add": { "post": { "produces": [ @@ -3252,6 +3374,128 @@ "required": true, "schema": { "$ref": "#/definitions/request.UpdatePossibilities" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/priorityLevel/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "浼樺厛绾у埆绠$悊" + ], + "summary": "娣诲姞浼樺厛绾у埆", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddPriorityLevel" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/priorityLevel/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "浼樺厛绾у埆绠$悊" + ], + "summary": "鍒犻櫎浼樺厛绾у埆", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/priorityLevel/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "浼樺厛绾у埆绠$悊" + ], + "summary": "鑾峰彇浼樺厛绾у埆鍒楄〃", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.PriorityLevel" + } + } + } + } + ] + } + } + } + } + }, + "/api/priorityLevel/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "浼樺厛绾у埆绠$悊" + ], + "summary": "鏇存柊浼樺厛绾у埆", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdatePriorityLevel" } } ], @@ -6286,6 +6530,372 @@ } } }, + "/api/serviceOrder/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟鍗曠鐞�" + ], + "summary": "娣诲姞鏈嶅姟鍗�", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddServiceOrder" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceOrder/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟鍗曠鐞�" + ], + "summary": "鍒犻櫎鏈嶅姟鍗�", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceOrder/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟鍗曠鐞�" + ], + "summary": "鑾峰彇鏈嶅姟鍗曞垪琛�", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ServiceOrder" + } + } + } + } + ] + } + } + } + } + }, + "/api/serviceOrder/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟鍗曠鐞�" + ], + "summary": "鏇存柊鏈嶅姟鍗�", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateServiceOrder" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceType/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟绫诲瀷绠$悊" + ], + "summary": "娣诲姞鏈嶅姟绫诲瀷", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddServiceType" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceType/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟绫诲瀷绠$悊" + ], + "summary": "鍒犻櫎鏈嶅姟绫诲瀷", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceType/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟绫诲瀷绠$悊" + ], + "summary": "鑾峰彇鏈嶅姟绫诲瀷鍒楄〃", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ServiceType" + } + } + } + } + ] + } + } + } + } + }, + "/api/serviceType/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟绫诲瀷绠$悊" + ], + "summary": "鏇存柊鏈嶅姟绫诲瀷", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateServiceType" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/severity/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "涓ラ噸绋嬪害绠$悊" + ], + "summary": "娣诲姞涓ラ噸绋嬪害", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddSeverity" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/severity/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "涓ラ噸绋嬪害绠$悊" + ], + "summary": "鍒犻櫎涓ラ噸绋嬪害", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/severity/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "涓ラ噸绋嬪害绠$悊" + ], + "summary": "鑾峰彇涓ラ噸绋嬪害鍒楄〃", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Severity" + } + } + } + } + ] + } + } + } + } + }, + "/api/severity/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "涓ラ噸绋嬪害绠$悊" + ], + "summary": "鏇存柊涓ラ噸绋嬪害", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateSeverity" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, "/api/solveRate/add": { "post": { "produces": [ @@ -7231,9 +7841,6 @@ "code": { "type": "integer" }, - "count": { - "type": "integer" - }, "data": {}, "msg": { "type": "string" @@ -7715,6 +8322,17 @@ } } }, + "model.Faq": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "model.FollowRecord": { "type": "object", "properties": { @@ -7951,6 +8569,17 @@ } }, "model.Possibility": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "model.PriorityLevel": { "type": "object", "properties": { "id": { @@ -8668,6 +9297,156 @@ } } }, + "model.ServiceOrder": { + "type": "object", + "properties": { + "address": { + "description": "涓婇棬鍦板潃", + "type": "string" + }, + "appointment_time": { + "description": "棰勭害涓婇棬鏃堕棿", + "type": "string" + }, + "car_fare": { + "description": "浜ら�氳垂", + "type": "number" + }, + "charge_amount": { + "description": "鏀惰垂閲戦", + "type": "number" + }, + "client": { + "$ref": "#/definitions/model.Client" + }, + "client_id": { + "description": "瀹㈡埛id", + "type": "integer" + }, + "contract": { + "$ref": "#/definitions/model.Contract" + }, + "contract_id": { + "description": "鍚堝悓id", + "type": "integer" + }, + "expect_time": { + "description": "甯屾湜澶勭悊鏃堕棿", + "type": "string" + }, + "faq": { + "$ref": "#/definitions/model.Faq" + }, + "id": { + "type": "integer" + }, + "linkman_id": { + "description": "鑱旂郴浜篿d", + "type": "integer" + }, + "order": { + "$ref": "#/definitions/model.OrderManage" + }, + "order_id": { + "description": "閿�鍞鍗昳d", + "type": "integer" + }, + "priorityLevel": { + "$ref": "#/definitions/model.PriorityLevel" + }, + "priority_level_id": { + "description": "浼樺厛绾у埆", + "type": "integer" + }, + "problem_desc": { + "description": "闂鎻忚堪", + "type": "string" + }, + "problem_id": { + "description": "甯歌闂id", + "type": "integer" + }, + "product": { + "$ref": "#/definitions/model.Product" + }, + "product_id": { + "description": "浜у搧id", + "type": "integer" + }, + "real_time": { + "description": "瀹為檯澶勭悊鏃堕棿", + "type": "string" + }, + "remark": { + "description": "澶囨敞", + "type": "string" + }, + "sale_leads": { + "description": "閿�鍞満浼歩d", + "type": "integer" + }, + "serviceType": { + "$ref": "#/definitions/model.ServiceType" + }, + "service_man_id": { + "description": "鏈嶅姟浜哄憳", + "type": "integer" + }, + "service_number": { + "description": "鏈嶅姟鍗曠紪鍙�", + "type": "string" + }, + "service_type_id": { + "description": "鏈嶅姟鏂瑰紡", + "type": "integer" + }, + "severity": { + "$ref": "#/definitions/model.Severity" + }, + "solution": { + "description": "瑙e喅鏂规硶", + "type": "string" + }, + "solution_remark": { + "description": "鍐呴儴澶囨敞", + "type": "string" + }, + "status": { + "description": "澶勭悊鐘舵��", + "type": "integer" + }, + "subject": { + "description": "涓婚", + "type": "string" + }, + "time_spent_id": { + "description": "鑺辫垂鏃堕棿", + "type": "integer" + } + } + }, + "model.ServiceType": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "model.Severity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "model.SolveRate": { "type": "object", "properties": { @@ -9110,6 +9889,17 @@ } } }, + "request.AddFaq": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "request.AddFollowRecord": { "type": "object", "required": [ @@ -9234,6 +10024,17 @@ "name" ], "properties": { + "name": { + "type": "string" + } + } + }, + "request.AddPriorityLevel": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, "name": { "type": "string" } @@ -9808,6 +10609,156 @@ }, "timelyRate": { "type": "integer" + } + } + }, + "request.AddServiceOrder": { + "type": "object", + "properties": { + "address": { + "description": "涓婇棬鍦板潃", + "type": "string" + }, + "appointment_time": { + "description": "棰勭害涓婇棬鏃堕棿", + "type": "string" + }, + "car_fare": { + "description": "浜ら�氳垂", + "type": "number" + }, + "charge_amount": { + "description": "鏀惰垂閲戦", + "type": "number" + }, + "client": { + "$ref": "#/definitions/model.Client" + }, + "client_id": { + "description": "瀹㈡埛id", + "type": "integer" + }, + "contract": { + "$ref": "#/definitions/model.Contract" + }, + "contract_id": { + "description": "鍚堝悓id", + "type": "integer" + }, + "expect_time": { + "description": "甯屾湜澶勭悊鏃堕棿", + "type": "string" + }, + "faq": { + "$ref": "#/definitions/model.Faq" + }, + "id": { + "type": "integer" + }, + "linkman_id": { + "description": "鑱旂郴浜篿d", + "type": "integer" + }, + "order": { + "$ref": "#/definitions/model.OrderManage" + }, + "order_id": { + "description": "閿�鍞鍗昳d", + "type": "integer" + }, + "priorityLevel": { + "$ref": "#/definitions/model.PriorityLevel" + }, + "priority_level_id": { + "description": "浼樺厛绾у埆", + "type": "integer" + }, + "problem_desc": { + "description": "闂鎻忚堪", + "type": "string" + }, + "problem_id": { + "description": "甯歌闂id", + "type": "integer" + }, + "product": { + "$ref": "#/definitions/model.Product" + }, + "product_id": { + "description": "浜у搧id", + "type": "integer" + }, + "real_time": { + "description": "瀹為檯澶勭悊鏃堕棿", + "type": "string" + }, + "remark": { + "description": "澶囨敞", + "type": "string" + }, + "sale_leads": { + "description": "閿�鍞満浼歩d", + "type": "integer" + }, + "serviceType": { + "$ref": "#/definitions/model.ServiceType" + }, + "service_man_id": { + "description": "鏈嶅姟浜哄憳", + "type": "integer" + }, + "service_number": { + "description": "鏈嶅姟鍗曠紪鍙�", + "type": "string" + }, + "service_type_id": { + "description": "鏈嶅姟鏂瑰紡", + "type": "integer" + }, + "severity": { + "$ref": "#/definitions/model.Severity" + }, + "solution": { + "description": "瑙e喅鏂规硶", + "type": "string" + }, + "solution_remark": { + "description": "鍐呴儴澶囨敞", + "type": "string" + }, + "status": { + "description": "澶勭悊鐘舵��", + "type": "integer" + }, + "subject": { + "description": "涓婚", + "type": "string" + }, + "time_spent_id": { + "description": "鑺辫垂鏃堕棿", + "type": "integer" + } + } + }, + "request.AddServiceType": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "request.AddSeverity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" } } }, @@ -11203,6 +12154,17 @@ } } }, + "request.UpdateFaq": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "request.UpdateFollowRecord": { "type": "object", "required": [ @@ -11425,6 +12387,17 @@ "id", "name" ], + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "request.UpdatePriorityLevel": { + "type": "object", "properties": { "id": { "type": "integer" @@ -12294,6 +13267,156 @@ } } }, + "request.UpdateServiceOrder": { + "type": "object", + "properties": { + "address": { + "description": "涓婇棬鍦板潃", + "type": "string" + }, + "appointment_time": { + "description": "棰勭害涓婇棬鏃堕棿", + "type": "string" + }, + "car_fare": { + "description": "浜ら�氳垂", + "type": "number" + }, + "charge_amount": { + "description": "鏀惰垂閲戦", + "type": "number" + }, + "client": { + "$ref": "#/definitions/model.Client" + }, + "client_id": { + "description": "瀹㈡埛id", + "type": "integer" + }, + "contract": { + "$ref": "#/definitions/model.Contract" + }, + "contract_id": { + "description": "鍚堝悓id", + "type": "integer" + }, + "expect_time": { + "description": "甯屾湜澶勭悊鏃堕棿", + "type": "string" + }, + "faq": { + "$ref": "#/definitions/model.Faq" + }, + "id": { + "type": "integer" + }, + "linkman_id": { + "description": "鑱旂郴浜篿d", + "type": "integer" + }, + "order": { + "$ref": "#/definitions/model.OrderManage" + }, + "order_id": { + "description": "閿�鍞鍗昳d", + "type": "integer" + }, + "priorityLevel": { + "$ref": "#/definitions/model.PriorityLevel" + }, + "priority_level_id": { + "description": "浼樺厛绾у埆", + "type": "integer" + }, + "problem_desc": { + "description": "闂鎻忚堪", + "type": "string" + }, + "problem_id": { + "description": "甯歌闂id", + "type": "integer" + }, + "product": { + "$ref": "#/definitions/model.Product" + }, + "product_id": { + "description": "浜у搧id", + "type": "integer" + }, + "real_time": { + "description": "瀹為檯澶勭悊鏃堕棿", + "type": "string" + }, + "remark": { + "description": "澶囨敞", + "type": "string" + }, + "sale_leads": { + "description": "閿�鍞満浼歩d", + "type": "integer" + }, + "serviceType": { + "$ref": "#/definitions/model.ServiceType" + }, + "service_man_id": { + "description": "鏈嶅姟浜哄憳", + "type": "integer" + }, + "service_number": { + "description": "鏈嶅姟鍗曠紪鍙�", + "type": "string" + }, + "service_type_id": { + "description": "鏈嶅姟鏂瑰紡", + "type": "integer" + }, + "severity": { + "$ref": "#/definitions/model.Severity" + }, + "solution": { + "description": "瑙e喅鏂规硶", + "type": "string" + }, + "solution_remark": { + "description": "鍐呴儴澶囨敞", + "type": "string" + }, + "status": { + "description": "澶勭悊鐘舵��", + "type": "integer" + }, + "subject": { + "description": "涓婚", + "type": "string" + }, + "time_spent_id": { + "description": "鑺辫垂鏃堕棿", + "type": "integer" + } + } + }, + "request.UpdateServiceType": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "request.UpdateSeverity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "request.UpdateSolveRate": { "type": "object", "required": [ @@ -12882,6 +14005,21 @@ } } }, + "response.ListResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "data": {}, + "msg": { + "type": "string" + } + } + }, "response.LoginResponse": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 4c31b17..92d8014 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -2062,6 +2062,128 @@ } } }, + "/api/faq/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "甯歌闂绠$悊" + ], + "summary": "娣诲姞甯歌闂", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddFaq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/faq/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "甯歌闂绠$悊" + ], + "summary": "鍒犻櫎甯歌闂", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/faq/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "甯歌闂绠$悊" + ], + "summary": "鑾峰彇甯歌闂鍒楄〃", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Faq" + } + } + } + } + ] + } + } + } + } + }, + "/api/faq/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "甯歌闂绠$悊" + ], + "summary": "鏇存柊甯歌闂", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateFaq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, "/api/followRecord/add": { "post": { "produces": [ @@ -3240,6 +3362,128 @@ "required": true, "schema": { "$ref": "#/definitions/request.UpdatePossibilities" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/priorityLevel/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "浼樺厛绾у埆绠$悊" + ], + "summary": "娣诲姞浼樺厛绾у埆", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddPriorityLevel" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/priorityLevel/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "浼樺厛绾у埆绠$悊" + ], + "summary": "鍒犻櫎浼樺厛绾у埆", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/priorityLevel/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "浼樺厛绾у埆绠$悊" + ], + "summary": "鑾峰彇浼樺厛绾у埆鍒楄〃", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.PriorityLevel" + } + } + } + } + ] + } + } + } + } + }, + "/api/priorityLevel/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "浼樺厛绾у埆绠$悊" + ], + "summary": "鏇存柊浼樺厛绾у埆", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdatePriorityLevel" } } ], @@ -6274,6 +6518,372 @@ } } }, + "/api/serviceOrder/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟鍗曠鐞�" + ], + "summary": "娣诲姞鏈嶅姟鍗�", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddServiceOrder" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceOrder/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟鍗曠鐞�" + ], + "summary": "鍒犻櫎鏈嶅姟鍗�", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceOrder/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟鍗曠鐞�" + ], + "summary": "鑾峰彇鏈嶅姟鍗曞垪琛�", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ServiceOrder" + } + } + } + } + ] + } + } + } + } + }, + "/api/serviceOrder/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟鍗曠鐞�" + ], + "summary": "鏇存柊鏈嶅姟鍗�", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateServiceOrder" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceType/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟绫诲瀷绠$悊" + ], + "summary": "娣诲姞鏈嶅姟绫诲瀷", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddServiceType" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceType/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟绫诲瀷绠$悊" + ], + "summary": "鍒犻櫎鏈嶅姟绫诲瀷", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/serviceType/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟绫诲瀷绠$悊" + ], + "summary": "鑾峰彇鏈嶅姟绫诲瀷鍒楄〃", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ServiceType" + } + } + } + } + ] + } + } + } + } + }, + "/api/serviceType/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "鏈嶅姟绫诲瀷绠$悊" + ], + "summary": "鏇存柊鏈嶅姟绫诲瀷", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateServiceType" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/severity/add": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "涓ラ噸绋嬪害绠$悊" + ], + "summary": "娣诲姞涓ラ噸绋嬪害", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddSeverity" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/severity/delete/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "涓ラ噸绋嬪害绠$悊" + ], + "summary": "鍒犻櫎涓ラ噸绋嬪害", + "parameters": [ + { + "type": "integer", + "description": "鏌ヨ鍙傛暟", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/severity/list": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "涓ラ噸绋嬪害绠$悊" + ], + "summary": "鑾峰彇涓ラ噸绋嬪害鍒楄〃", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.ListResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Severity" + } + } + } + } + ] + } + } + } + } + }, + "/api/severity/update": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "涓ラ噸绋嬪害绠$悊" + ], + "summary": "鏇存柊涓ラ噸绋嬪害", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateSeverity" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, "/api/solveRate/add": { "post": { "produces": [ @@ -7219,9 +7829,6 @@ "code": { "type": "integer" }, - "count": { - "type": "integer" - }, "data": {}, "msg": { "type": "string" @@ -7703,6 +8310,17 @@ } } }, + "model.Faq": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "model.FollowRecord": { "type": "object", "properties": { @@ -7939,6 +8557,17 @@ } }, "model.Possibility": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "model.PriorityLevel": { "type": "object", "properties": { "id": { @@ -8656,6 +9285,156 @@ } } }, + "model.ServiceOrder": { + "type": "object", + "properties": { + "address": { + "description": "涓婇棬鍦板潃", + "type": "string" + }, + "appointment_time": { + "description": "棰勭害涓婇棬鏃堕棿", + "type": "string" + }, + "car_fare": { + "description": "浜ら�氳垂", + "type": "number" + }, + "charge_amount": { + "description": "鏀惰垂閲戦", + "type": "number" + }, + "client": { + "$ref": "#/definitions/model.Client" + }, + "client_id": { + "description": "瀹㈡埛id", + "type": "integer" + }, + "contract": { + "$ref": "#/definitions/model.Contract" + }, + "contract_id": { + "description": "鍚堝悓id", + "type": "integer" + }, + "expect_time": { + "description": "甯屾湜澶勭悊鏃堕棿", + "type": "string" + }, + "faq": { + "$ref": "#/definitions/model.Faq" + }, + "id": { + "type": "integer" + }, + "linkman_id": { + "description": "鑱旂郴浜篿d", + "type": "integer" + }, + "order": { + "$ref": "#/definitions/model.OrderManage" + }, + "order_id": { + "description": "閿�鍞鍗昳d", + "type": "integer" + }, + "priorityLevel": { + "$ref": "#/definitions/model.PriorityLevel" + }, + "priority_level_id": { + "description": "浼樺厛绾у埆", + "type": "integer" + }, + "problem_desc": { + "description": "闂鎻忚堪", + "type": "string" + }, + "problem_id": { + "description": "甯歌闂id", + "type": "integer" + }, + "product": { + "$ref": "#/definitions/model.Product" + }, + "product_id": { + "description": "浜у搧id", + "type": "integer" + }, + "real_time": { + "description": "瀹為檯澶勭悊鏃堕棿", + "type": "string" + }, + "remark": { + "description": "澶囨敞", + "type": "string" + }, + "sale_leads": { + "description": "閿�鍞満浼歩d", + "type": "integer" + }, + "serviceType": { + "$ref": "#/definitions/model.ServiceType" + }, + "service_man_id": { + "description": "鏈嶅姟浜哄憳", + "type": "integer" + }, + "service_number": { + "description": "鏈嶅姟鍗曠紪鍙�", + "type": "string" + }, + "service_type_id": { + "description": "鏈嶅姟鏂瑰紡", + "type": "integer" + }, + "severity": { + "$ref": "#/definitions/model.Severity" + }, + "solution": { + "description": "瑙e喅鏂规硶", + "type": "string" + }, + "solution_remark": { + "description": "鍐呴儴澶囨敞", + "type": "string" + }, + "status": { + "description": "澶勭悊鐘舵��", + "type": "integer" + }, + "subject": { + "description": "涓婚", + "type": "string" + }, + "time_spent_id": { + "description": "鑺辫垂鏃堕棿", + "type": "integer" + } + } + }, + "model.ServiceType": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "model.Severity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "model.SolveRate": { "type": "object", "properties": { @@ -9098,6 +9877,17 @@ } } }, + "request.AddFaq": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "request.AddFollowRecord": { "type": "object", "required": [ @@ -9222,6 +10012,17 @@ "name" ], "properties": { + "name": { + "type": "string" + } + } + }, + "request.AddPriorityLevel": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, "name": { "type": "string" } @@ -9796,6 +10597,156 @@ }, "timelyRate": { "type": "integer" + } + } + }, + "request.AddServiceOrder": { + "type": "object", + "properties": { + "address": { + "description": "涓婇棬鍦板潃", + "type": "string" + }, + "appointment_time": { + "description": "棰勭害涓婇棬鏃堕棿", + "type": "string" + }, + "car_fare": { + "description": "浜ら�氳垂", + "type": "number" + }, + "charge_amount": { + "description": "鏀惰垂閲戦", + "type": "number" + }, + "client": { + "$ref": "#/definitions/model.Client" + }, + "client_id": { + "description": "瀹㈡埛id", + "type": "integer" + }, + "contract": { + "$ref": "#/definitions/model.Contract" + }, + "contract_id": { + "description": "鍚堝悓id", + "type": "integer" + }, + "expect_time": { + "description": "甯屾湜澶勭悊鏃堕棿", + "type": "string" + }, + "faq": { + "$ref": "#/definitions/model.Faq" + }, + "id": { + "type": "integer" + }, + "linkman_id": { + "description": "鑱旂郴浜篿d", + "type": "integer" + }, + "order": { + "$ref": "#/definitions/model.OrderManage" + }, + "order_id": { + "description": "閿�鍞鍗昳d", + "type": "integer" + }, + "priorityLevel": { + "$ref": "#/definitions/model.PriorityLevel" + }, + "priority_level_id": { + "description": "浼樺厛绾у埆", + "type": "integer" + }, + "problem_desc": { + "description": "闂鎻忚堪", + "type": "string" + }, + "problem_id": { + "description": "甯歌闂id", + "type": "integer" + }, + "product": { + "$ref": "#/definitions/model.Product" + }, + "product_id": { + "description": "浜у搧id", + "type": "integer" + }, + "real_time": { + "description": "瀹為檯澶勭悊鏃堕棿", + "type": "string" + }, + "remark": { + "description": "澶囨敞", + "type": "string" + }, + "sale_leads": { + "description": "閿�鍞満浼歩d", + "type": "integer" + }, + "serviceType": { + "$ref": "#/definitions/model.ServiceType" + }, + "service_man_id": { + "description": "鏈嶅姟浜哄憳", + "type": "integer" + }, + "service_number": { + "description": "鏈嶅姟鍗曠紪鍙�", + "type": "string" + }, + "service_type_id": { + "description": "鏈嶅姟鏂瑰紡", + "type": "integer" + }, + "severity": { + "$ref": "#/definitions/model.Severity" + }, + "solution": { + "description": "瑙e喅鏂规硶", + "type": "string" + }, + "solution_remark": { + "description": "鍐呴儴澶囨敞", + "type": "string" + }, + "status": { + "description": "澶勭悊鐘舵��", + "type": "integer" + }, + "subject": { + "description": "涓婚", + "type": "string" + }, + "time_spent_id": { + "description": "鑺辫垂鏃堕棿", + "type": "integer" + } + } + }, + "request.AddServiceType": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "request.AddSeverity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" } } }, @@ -11191,6 +12142,17 @@ } } }, + "request.UpdateFaq": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "request.UpdateFollowRecord": { "type": "object", "required": [ @@ -11413,6 +12375,17 @@ "id", "name" ], + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "request.UpdatePriorityLevel": { + "type": "object", "properties": { "id": { "type": "integer" @@ -12282,6 +13255,156 @@ } } }, + "request.UpdateServiceOrder": { + "type": "object", + "properties": { + "address": { + "description": "涓婇棬鍦板潃", + "type": "string" + }, + "appointment_time": { + "description": "棰勭害涓婇棬鏃堕棿", + "type": "string" + }, + "car_fare": { + "description": "浜ら�氳垂", + "type": "number" + }, + "charge_amount": { + "description": "鏀惰垂閲戦", + "type": "number" + }, + "client": { + "$ref": "#/definitions/model.Client" + }, + "client_id": { + "description": "瀹㈡埛id", + "type": "integer" + }, + "contract": { + "$ref": "#/definitions/model.Contract" + }, + "contract_id": { + "description": "鍚堝悓id", + "type": "integer" + }, + "expect_time": { + "description": "甯屾湜澶勭悊鏃堕棿", + "type": "string" + }, + "faq": { + "$ref": "#/definitions/model.Faq" + }, + "id": { + "type": "integer" + }, + "linkman_id": { + "description": "鑱旂郴浜篿d", + "type": "integer" + }, + "order": { + "$ref": "#/definitions/model.OrderManage" + }, + "order_id": { + "description": "閿�鍞鍗昳d", + "type": "integer" + }, + "priorityLevel": { + "$ref": "#/definitions/model.PriorityLevel" + }, + "priority_level_id": { + "description": "浼樺厛绾у埆", + "type": "integer" + }, + "problem_desc": { + "description": "闂鎻忚堪", + "type": "string" + }, + "problem_id": { + "description": "甯歌闂id", + "type": "integer" + }, + "product": { + "$ref": "#/definitions/model.Product" + }, + "product_id": { + "description": "浜у搧id", + "type": "integer" + }, + "real_time": { + "description": "瀹為檯澶勭悊鏃堕棿", + "type": "string" + }, + "remark": { + "description": "澶囨敞", + "type": "string" + }, + "sale_leads": { + "description": "閿�鍞満浼歩d", + "type": "integer" + }, + "serviceType": { + "$ref": "#/definitions/model.ServiceType" + }, + "service_man_id": { + "description": "鏈嶅姟浜哄憳", + "type": "integer" + }, + "service_number": { + "description": "鏈嶅姟鍗曠紪鍙�", + "type": "string" + }, + "service_type_id": { + "description": "鏈嶅姟鏂瑰紡", + "type": "integer" + }, + "severity": { + "$ref": "#/definitions/model.Severity" + }, + "solution": { + "description": "瑙e喅鏂规硶", + "type": "string" + }, + "solution_remark": { + "description": "鍐呴儴澶囨敞", + "type": "string" + }, + "status": { + "description": "澶勭悊鐘舵��", + "type": "integer" + }, + "subject": { + "description": "涓婚", + "type": "string" + }, + "time_spent_id": { + "description": "鑺辫垂鏃堕棿", + "type": "integer" + } + } + }, + "request.UpdateServiceType": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "request.UpdateSeverity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, "request.UpdateSolveRate": { "type": "object", "required": [ @@ -12870,6 +13993,21 @@ } } }, + "response.ListResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "data": {}, + "msg": { + "type": "string" + } + } + }, "response.LoginResponse": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 04894d5..e8359e8 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -129,8 +129,6 @@ properties: code: type: integer - count: - type: integer data: {} msg: type: string @@ -447,6 +445,13 @@ name: type: string type: object + model.Faq: + properties: + id: + type: integer + name: + type: string + type: object model.FollowRecord: properties: client: @@ -602,6 +607,13 @@ type: integer type: object model.Possibility: + properties: + id: + type: integer + name: + type: string + type: object + model.PriorityLevel: properties: id: type: integer @@ -1071,6 +1083,113 @@ timelyRateId: type: integer type: object + model.ServiceOrder: + properties: + address: + description: 涓婇棬鍦板潃 + type: string + appointment_time: + description: 棰勭害涓婇棬鏃堕棿 + type: string + car_fare: + description: 浜ら�氳垂 + type: number + charge_amount: + description: 鏀惰垂閲戦 + type: number + client: + $ref: '#/definitions/model.Client' + client_id: + description: 瀹㈡埛id + type: integer + contract: + $ref: '#/definitions/model.Contract' + contract_id: + description: 鍚堝悓id + type: integer + expect_time: + description: 甯屾湜澶勭悊鏃堕棿 + type: string + faq: + $ref: '#/definitions/model.Faq' + id: + type: integer + linkman_id: + description: 鑱旂郴浜篿d + type: integer + order: + $ref: '#/definitions/model.OrderManage' + order_id: + description: 閿�鍞鍗昳d + type: integer + priority_level_id: + description: 浼樺厛绾у埆 + type: integer + priorityLevel: + $ref: '#/definitions/model.PriorityLevel' + problem_desc: + description: 闂鎻忚堪 + type: string + problem_id: + description: 甯歌闂id + type: integer + product: + $ref: '#/definitions/model.Product' + product_id: + description: 浜у搧id + type: integer + real_time: + description: 瀹為檯澶勭悊鏃堕棿 + type: string + remark: + description: 澶囨敞 + type: string + sale_leads: + description: 閿�鍞満浼歩d + type: integer + service_man_id: + description: 鏈嶅姟浜哄憳 + type: integer + service_number: + description: 鏈嶅姟鍗曠紪鍙� + type: string + service_type_id: + description: 鏈嶅姟鏂瑰紡 + type: integer + serviceType: + $ref: '#/definitions/model.ServiceType' + severity: + $ref: '#/definitions/model.Severity' + solution: + description: 瑙e喅鏂规硶 + type: string + solution_remark: + description: 鍐呴儴澶囨敞 + type: string + status: + description: 澶勭悊鐘舵�� + type: integer + subject: + description: 涓婚 + type: string + time_spent_id: + description: 鑺辫垂鏃堕棿 + type: integer + type: object + model.ServiceType: + properties: + id: + type: integer + name: + type: string + type: object + model.Severity: + properties: + id: + type: integer + name: + type: string + type: object model.SolveRate: properties: id: @@ -1372,6 +1491,13 @@ required: - name type: object + request.AddFaq: + properties: + id: + type: integer + name: + type: string + type: object request.AddFollowRecord: properties: follow_record: @@ -1454,6 +1580,13 @@ type: string required: - name + type: object + request.AddPriorityLevel: + properties: + id: + type: integer + name: + type: string type: object request.AddProvince: properties: @@ -1837,6 +1970,113 @@ type: integer timelyRate: type: integer + type: object + request.AddServiceOrder: + properties: + address: + description: 涓婇棬鍦板潃 + type: string + appointment_time: + description: 棰勭害涓婇棬鏃堕棿 + type: string + car_fare: + description: 浜ら�氳垂 + type: number + charge_amount: + description: 鏀惰垂閲戦 + type: number + client: + $ref: '#/definitions/model.Client' + client_id: + description: 瀹㈡埛id + type: integer + contract: + $ref: '#/definitions/model.Contract' + contract_id: + description: 鍚堝悓id + type: integer + expect_time: + description: 甯屾湜澶勭悊鏃堕棿 + type: string + faq: + $ref: '#/definitions/model.Faq' + id: + type: integer + linkman_id: + description: 鑱旂郴浜篿d + type: integer + order: + $ref: '#/definitions/model.OrderManage' + order_id: + description: 閿�鍞鍗昳d + type: integer + priority_level_id: + description: 浼樺厛绾у埆 + type: integer + priorityLevel: + $ref: '#/definitions/model.PriorityLevel' + problem_desc: + description: 闂鎻忚堪 + type: string + problem_id: + description: 甯歌闂id + type: integer + product: + $ref: '#/definitions/model.Product' + product_id: + description: 浜у搧id + type: integer + real_time: + description: 瀹為檯澶勭悊鏃堕棿 + type: string + remark: + description: 澶囨敞 + type: string + sale_leads: + description: 閿�鍞満浼歩d + type: integer + service_man_id: + description: 鏈嶅姟浜哄憳 + type: integer + service_number: + description: 鏈嶅姟鍗曠紪鍙� + type: string + service_type_id: + description: 鏈嶅姟鏂瑰紡 + type: integer + serviceType: + $ref: '#/definitions/model.ServiceType' + severity: + $ref: '#/definitions/model.Severity' + solution: + description: 瑙e喅鏂规硶 + type: string + solution_remark: + description: 鍐呴儴澶囨敞 + type: string + status: + description: 澶勭悊鐘舵�� + type: integer + subject: + description: 涓婚 + type: string + time_spent_id: + description: 鑺辫垂鏃堕棿 + type: integer + type: object + request.AddServiceType: + properties: + id: + type: integer + name: + type: string + type: object + request.AddSeverity: + properties: + id: + type: integer + name: + type: string type: object request.AddSolveRate: properties: @@ -2787,6 +3027,13 @@ $ref: '#/definitions/request.UpdateEnterpriseScale' type: array type: object + request.UpdateFaq: + properties: + id: + type: integer + name: + type: string + type: object request.UpdateFollowRecord: properties: follow_record: @@ -2937,6 +3184,13 @@ required: - id - name + type: object + request.UpdatePriorityLevel: + properties: + id: + type: integer + name: + type: string type: object request.UpdateProvince: properties: @@ -3513,6 +3767,113 @@ timelyRate: type: integer type: object + request.UpdateServiceOrder: + properties: + address: + description: 涓婇棬鍦板潃 + type: string + appointment_time: + description: 棰勭害涓婇棬鏃堕棿 + type: string + car_fare: + description: 浜ら�氳垂 + type: number + charge_amount: + description: 鏀惰垂閲戦 + type: number + client: + $ref: '#/definitions/model.Client' + client_id: + description: 瀹㈡埛id + type: integer + contract: + $ref: '#/definitions/model.Contract' + contract_id: + description: 鍚堝悓id + type: integer + expect_time: + description: 甯屾湜澶勭悊鏃堕棿 + type: string + faq: + $ref: '#/definitions/model.Faq' + id: + type: integer + linkman_id: + description: 鑱旂郴浜篿d + type: integer + order: + $ref: '#/definitions/model.OrderManage' + order_id: + description: 閿�鍞鍗昳d + type: integer + priority_level_id: + description: 浼樺厛绾у埆 + type: integer + priorityLevel: + $ref: '#/definitions/model.PriorityLevel' + problem_desc: + description: 闂鎻忚堪 + type: string + problem_id: + description: 甯歌闂id + type: integer + product: + $ref: '#/definitions/model.Product' + product_id: + description: 浜у搧id + type: integer + real_time: + description: 瀹為檯澶勭悊鏃堕棿 + type: string + remark: + description: 澶囨敞 + type: string + sale_leads: + description: 閿�鍞満浼歩d + type: integer + service_man_id: + description: 鏈嶅姟浜哄憳 + type: integer + service_number: + description: 鏈嶅姟鍗曠紪鍙� + type: string + service_type_id: + description: 鏈嶅姟鏂瑰紡 + type: integer + serviceType: + $ref: '#/definitions/model.ServiceType' + severity: + $ref: '#/definitions/model.Severity' + solution: + description: 瑙e喅鏂规硶 + type: string + solution_remark: + description: 鍐呴儴澶囨敞 + type: string + status: + description: 澶勭悊鐘舵�� + type: integer + subject: + description: 涓婚 + type: string + time_spent_id: + description: 鑺辫垂鏃堕棿 + type: integer + type: object + request.UpdateServiceType: + properties: + id: + type: integer + name: + type: string + type: object + request.UpdateSeverity: + properties: + id: + type: integer + name: + type: string + type: object request.UpdateSolveRate: properties: id: @@ -3908,6 +4269,16 @@ items: $ref: '#/definitions/model.IsVisit' type: array + type: object + response.ListResponse: + properties: + code: + type: integer + count: + type: integer + data: {} + msg: + type: string type: object response.LoginResponse: properties: @@ -5446,6 +5817,81 @@ summary: 鏇存柊浼佷笟瑙勬ā tags: - EnterpriseScale + /api/faq/add: + post: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.AddFaq' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 娣诲姞甯歌闂 + tags: + - 甯歌闂绠$悊 + /api/faq/delete/{id}: + delete: + parameters: + - description: 鏌ヨ鍙傛暟 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鍒犻櫎甯歌闂 + tags: + - 甯歌闂绠$悊 + /api/faq/list: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.ListResponse' + - properties: + data: + items: + $ref: '#/definitions/model.Faq' + type: array + type: object + summary: 鑾峰彇甯歌闂鍒楄〃 + tags: + - 甯歌闂绠$悊 + /api/faq/update: + put: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.UpdateFaq' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鏇存柊甯歌闂 + tags: + - 甯歌闂绠$悊 /api/followRecord/add: post: parameters: @@ -6173,6 +6619,81 @@ summary: 鏇存柊鍟嗘満鍙兘鎬� tags: - Possibility + /api/priorityLevel/add: + post: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.AddPriorityLevel' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 娣诲姞浼樺厛绾у埆 + tags: + - 浼樺厛绾у埆绠$悊 + /api/priorityLevel/delete/{id}: + delete: + parameters: + - description: 鏌ヨ鍙傛暟 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鍒犻櫎浼樺厛绾у埆 + tags: + - 浼樺厛绾у埆绠$悊 + /api/priorityLevel/list: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.ListResponse' + - properties: + data: + items: + $ref: '#/definitions/model.PriorityLevel' + type: array + type: object + summary: 鑾峰彇浼樺厛绾у埆鍒楄〃 + tags: + - 浼樺厛绾у埆绠$悊 + /api/priorityLevel/update: + put: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.UpdatePriorityLevel' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鏇存柊浼樺厛绾у埆 + tags: + - 浼樺厛绾у埆绠$悊 /api/province/add: post: parameters: @@ -8033,6 +8554,231 @@ summary: 鏇存柊鏈嶅姟璺熻繘 tags: - ServiceFollowup + /api/serviceOrder/add: + post: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.AddServiceOrder' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 娣诲姞鏈嶅姟鍗� + tags: + - 鏈嶅姟鍗曠鐞� + /api/serviceOrder/delete/{id}: + delete: + parameters: + - description: 鏌ヨ鍙傛暟 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鍒犻櫎鏈嶅姟鍗� + tags: + - 鏈嶅姟鍗曠鐞� + /api/serviceOrder/list: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.ListResponse' + - properties: + data: + items: + $ref: '#/definitions/model.ServiceOrder' + type: array + type: object + summary: 鑾峰彇鏈嶅姟鍗曞垪琛� + tags: + - 鏈嶅姟鍗曠鐞� + /api/serviceOrder/update: + put: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.UpdateServiceOrder' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鏇存柊鏈嶅姟鍗� + tags: + - 鏈嶅姟鍗曠鐞� + /api/serviceType/add: + post: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.AddServiceType' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 娣诲姞鏈嶅姟绫诲瀷 + tags: + - 鏈嶅姟绫诲瀷绠$悊 + /api/serviceType/delete/{id}: + delete: + parameters: + - description: 鏌ヨ鍙傛暟 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鍒犻櫎鏈嶅姟绫诲瀷 + tags: + - 鏈嶅姟绫诲瀷绠$悊 + /api/serviceType/list: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.ListResponse' + - properties: + data: + items: + $ref: '#/definitions/model.ServiceType' + type: array + type: object + summary: 鑾峰彇鏈嶅姟绫诲瀷鍒楄〃 + tags: + - 鏈嶅姟绫诲瀷绠$悊 + /api/serviceType/update: + put: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.UpdateServiceType' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鏇存柊鏈嶅姟绫诲瀷 + tags: + - 鏈嶅姟绫诲瀷绠$悊 + /api/severity/add: + post: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.AddSeverity' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 娣诲姞涓ラ噸绋嬪害 + tags: + - 涓ラ噸绋嬪害绠$悊 + /api/severity/delete/{id}: + delete: + parameters: + - description: 鏌ヨ鍙傛暟 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鍒犻櫎涓ラ噸绋嬪害 + tags: + - 涓ラ噸绋嬪害绠$悊 + /api/severity/list: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.ListResponse' + - properties: + data: + items: + $ref: '#/definitions/model.Severity' + type: array + type: object + summary: 鑾峰彇涓ラ噸绋嬪害鍒楄〃 + tags: + - 涓ラ噸绋嬪害绠$悊 + /api/severity/update: + put: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.UpdateSeverity' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 鏇存柊涓ラ噸绋嬪害 + tags: + - 涓ラ噸绋嬪害绠$悊 /api/solveRate/add: post: parameters: diff --git a/model/faq.go b/model/faq.go new file mode 100644 index 0000000..9fe3184 --- /dev/null +++ b/model/faq.go @@ -0,0 +1,114 @@ +package model + +import ( + "aps_crm/constvar" + "aps_crm/pkg/mysqlx" + "errors" + "fmt" + "gorm.io/gorm" +) + +type ( + // Faq 甯歌闂 + Faq struct { + Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` + Name string `json:"name" gorm:"column:name"` + } + + // FaqSearch 甯歌闂鎼滅储鏉′欢 + FaqSearch struct { + Faq + Orm *gorm.DB + QueryClass constvar.FaqQueryClass + KeywordType constvar.FaqKeywordType + Keyword string + PageNum int + PageSize int + } +) + +func (Faq) TableName() string { + return "faq" +} + +func NewFaqSearch() *FaqSearch { + return &FaqSearch{ + Orm: mysqlx.GetDB(), + } +} + +func (slf *FaqSearch) build() *gorm.DB { + var db = slf.Orm.Model(&Faq{}) + if slf.Id != 0 { + db = db.Where("id = ?", slf.Id) + } + + return db +} + +func (slf *FaqSearch) Create(record *Faq) error { + var db = slf.build() + return db.Create(record).Error +} + +func (slf *FaqSearch) Delete() error { + var db = slf.build() + return db.Delete(&Faq{}).Error +} + +func (slf *FaqSearch) Update(record *Faq) error { + var db = slf.build() + return db.Updates(record).Error +} + +func (slf *FaqSearch) FindAll() ([]*Faq, error) { + var db = slf.build() + var record = make([]*Faq, 0) + err := db.Find(&record).Error + return record, err +} + +func (slf *FaqSearch) SetId(id int) *FaqSearch { + slf.Id = id + return slf +} + +func (slf *FaqSearch) First() (*Faq, error) { + var db = slf.build() + var record = new(Faq) + err := db.First(record).Error + return record, err +} + +func (slf *FaqSearch) Updates(values interface{}) error { + var db = slf.build() + return db.Updates(values).Error +} + +func (slf *FaqSearch) Save(record *Faq) error { + if record.Id == 0 { + return errors.New("id涓虹┖") + } + var db = slf.build() + + if err := db.Save(record).Error; err != nil { + return fmt.Errorf("save err: %v, record: %+v", err, record) + } + + return nil +} + +func (slf *FaqSearch) Find() ([]*Faq, int64, error) { + var db = slf.build() + var records = make([]*Faq, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Find(&records).Error + return records, total, err +} \ No newline at end of file diff --git a/model/priorityLevel.go b/model/priorityLevel.go new file mode 100644 index 0000000..be5b783 --- /dev/null +++ b/model/priorityLevel.go @@ -0,0 +1,114 @@ +package model + +import ( + "aps_crm/constvar" + "aps_crm/pkg/mysqlx" + "errors" + "fmt" + "gorm.io/gorm" +) + +type ( + // PriorityLevel 浼樺厛绾у埆 + PriorityLevel struct { + Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` + Name string `json:"name" gorm:"column:name"` + } + + // PriorityLevelSearch 浼樺厛绾у埆鎼滅储鏉′欢 + PriorityLevelSearch struct { + PriorityLevel + Orm *gorm.DB + QueryClass constvar.PriorityLevelQueryClass + KeywordType constvar.PriorityLevelKeywordType + Keyword string + PageNum int + PageSize int + } +) + +func (PriorityLevel) TableName() string { + return "priority_level" +} + +func NewPriorityLevelSearch() *PriorityLevelSearch { + return &PriorityLevelSearch{ + Orm: mysqlx.GetDB(), + } +} + +func (slf *PriorityLevelSearch) build() *gorm.DB { + var db = slf.Orm.Model(&PriorityLevel{}) + if slf.Id != 0 { + db = db.Where("id = ?", slf.Id) + } + + return db +} + +func (slf *PriorityLevelSearch) Create(record *PriorityLevel) error { + var db = slf.build() + return db.Create(record).Error +} + +func (slf *PriorityLevelSearch) Delete() error { + var db = slf.build() + return db.Delete(&PriorityLevel{}).Error +} + +func (slf *PriorityLevelSearch) Update(record *PriorityLevel) error { + var db = slf.build() + return db.Updates(record).Error +} + +func (slf *PriorityLevelSearch) FindAll() ([]*PriorityLevel, error) { + var db = slf.build() + var record = make([]*PriorityLevel, 0) + err := db.Find(&record).Error + return record, err +} + +func (slf *PriorityLevelSearch) SetId(id int) *PriorityLevelSearch { + slf.Id = id + return slf +} + +func (slf *PriorityLevelSearch) First() (*PriorityLevel, error) { + var db = slf.build() + var record = new(PriorityLevel) + err := db.First(record).Error + return record, err +} + +func (slf *PriorityLevelSearch) Updates(values interface{}) error { + var db = slf.build() + return db.Updates(values).Error +} + +func (slf *PriorityLevelSearch) Save(record *PriorityLevel) error { + if record.Id == 0 { + return errors.New("id涓虹┖") + } + var db = slf.build() + + if err := db.Save(record).Error; err != nil { + return fmt.Errorf("save err: %v, record: %+v", err, record) + } + + return nil +} + +func (slf *PriorityLevelSearch) Find() ([]*PriorityLevel, int64, error) { + var db = slf.build() + var records = make([]*PriorityLevel, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Find(&records).Error + return records, total, err +} \ No newline at end of file diff --git a/model/request/faq.go b/model/request/faq.go new file mode 100644 index 0000000..a7d18b7 --- /dev/null +++ b/model/request/faq.go @@ -0,0 +1,22 @@ +package request + +import ( + "aps_crm/constvar" + "aps_crm/model" +) + +type AddFaq struct { + model.Faq +} + +type UpdateFaq struct { + Id int `json:"id"` + model.Faq +} + +type GetFaqList struct { + PageInfo + QueryClass constvar.FaqQueryClass `json:"queryClass"` + KeywordType constvar.FaqKeywordType `json:"keywordType"` + Keyword string `json:"keyword"` +} diff --git a/model/request/priorityLevel.go b/model/request/priorityLevel.go new file mode 100644 index 0000000..64701ba --- /dev/null +++ b/model/request/priorityLevel.go @@ -0,0 +1,22 @@ +package request + +import ( + "aps_crm/constvar" + "aps_crm/model" +) + +type AddPriorityLevel struct { + model.PriorityLevel +} + +type UpdatePriorityLevel struct { + Id int `json:"id"` + model.PriorityLevel +} + +type GetPriorityLevelList struct { + PageInfo + QueryClass constvar.PriorityLevelQueryClass `json:"queryClass"` + KeywordType constvar.PriorityLevelKeywordType `json:"keywordType"` + Keyword string `json:"keyword"` +} diff --git a/model/request/serviceOrder.go b/model/request/serviceOrder.go new file mode 100644 index 0000000..d89e900 --- /dev/null +++ b/model/request/serviceOrder.go @@ -0,0 +1,22 @@ +package request + +import ( + "aps_crm/constvar" + "aps_crm/model" +) + +type AddServiceOrder struct { + model.ServiceOrder +} + +type UpdateServiceOrder struct { + Id int `json:"id"` + model.ServiceOrder +} + +type GetServiceOrderList struct { + PageInfo + QueryClass constvar.ServiceOrderQueryClass `json:"queryClass"` + KeywordType constvar.ServiceOrderKeywordType `json:"keywordType"` + Keyword string `json:"keyword"` +} diff --git a/model/request/serviceType.go b/model/request/serviceType.go new file mode 100644 index 0000000..2eee204 --- /dev/null +++ b/model/request/serviceType.go @@ -0,0 +1,22 @@ +package request + +import ( + "aps_crm/constvar" + "aps_crm/model" +) + +type AddServiceType struct { + model.ServiceType +} + +type UpdateServiceType struct { + Id int `json:"id"` + model.ServiceType +} + +type GetServiceTypeList struct { + PageInfo + QueryClass constvar.ServiceTypeQueryClass `json:"queryClass"` + KeywordType constvar.ServiceTypeKeywordType `json:"keywordType"` + Keyword string `json:"keyword"` +} diff --git a/model/request/severity.go b/model/request/severity.go new file mode 100644 index 0000000..70c5eb7 --- /dev/null +++ b/model/request/severity.go @@ -0,0 +1,22 @@ +package request + +import ( + "aps_crm/constvar" + "aps_crm/model" +) + +type AddSeverity struct { + model.Severity +} + +type UpdateSeverity struct { + Id int `json:"id"` + model.Severity +} + +type GetSeverityList struct { + PageInfo + QueryClass constvar.SeverityQueryClass `json:"queryClass"` + KeywordType constvar.SeverityKeywordType `json:"keywordType"` + Keyword string `json:"keyword"` +} diff --git a/model/serviceOrder.go b/model/serviceOrder.go new file mode 100644 index 0000000..d8de6eb --- /dev/null +++ b/model/serviceOrder.go @@ -0,0 +1,163 @@ +package model + +import ( + "aps_crm/constvar" + "aps_crm/pkg/mysqlx" + "errors" + "fmt" + "gorm.io/gorm" +) + +type ( + // ServiceOrder 鏈嶅姟鍗� + ServiceOrder struct { + Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` + ServiceNumber string `gorm:"service_number" json:"service_number"` // 鏈嶅姟鍗曠紪鍙� + ClientId int `gorm:"client_id" json:"client_id"` // 瀹㈡埛id + Client Client `gorm:"foreignKey:ClientId"` + ContractId int `gorm:"contract_id" json:"contract_id"` // 鍚堝悓id + Contract Contract `gorm:"foreignKey:ContractId"` + OrderId int `gorm:"order_id" json:"order_id"` // 閿�鍞鍗昳d + Order OrderManage `gorm:"foreignKey:OrderId"` + Subject string `gorm:"subject" json:"subject"` // 涓婚 + ProductId int `gorm:"product_id" json:"product_id"` // 浜у搧id + Product Product `gorm:"foreignKey:ProductId"` + ServiceTypeId int `gorm:"service_type_id" json:"service_type_id"` // 鏈嶅姟鏂瑰紡 + ServiceType ServiceType `gorm:"foreignKey:ServiceTypeId"` + ServiceManId int `gorm:"service_man_id" json:"service_man_id"` // 鏈嶅姟浜哄憳 + LinkmanId int `gorm:"linkman_id" json:"linkman_id"` // 鑱旂郴浜篿d + Address string `gorm:"address" json:"address"` // 涓婇棬鍦板潃 + PriorityLevelId int `gorm:"priority_level_id" json:"priority_level_id"` // 浼樺厛绾у埆 + PriorityLevel PriorityLevel `gorm:"foreignKey:PriorityLevelId"` + AppointmentTime string `gorm:"appointment_time" json:"appointment_time"` // 棰勭害涓婇棬鏃堕棿 + SaleLeads int `gorm:"sale_leads" json:"sale_leads"` // 閿�鍞満浼歩d + SeverityId int `gorm:"severity_id" json:"severity"` // 涓ラ噸绋嬪害 + Severity Severity `gorm:"foreignKey:SeverityId"` + Status int `gorm:"status" json:"status"` // 澶勭悊鐘舵�� + ExpectTime string `gorm:"expect_time" json:"expect_time"` // 甯屾湜澶勭悊鏃堕棿 + RealTime string `gorm:"real_time" json:"real_time"` // 瀹為檯澶勭悊鏃堕棿 + CarFare float64 `gorm:"car_fare" json:"car_fare"` // 浜ら�氳垂 + ChargeAmount float64 `gorm:"charge_amount" json:"charge_amount"` // 鏀惰垂閲戦 + TimeSpentId int `gorm:"time_spent_id" json:"time_spent_id"` // 鑺辫垂鏃堕棿 + FaqId int `gorm:"problem_id" json:"problem_id"` // 甯歌闂id + Faq Faq `gorm:"foreignKey:FaqId"` + ProblemDesc string `gorm:"problem_desc" json:"problem_desc"` // 闂鎻忚堪 + Solution string `gorm:"solution" json:"solution"` // 瑙e喅鏂规硶 + SolutionRemark string `gorm:"solution_remark" json:"solution_remark"` // 鍐呴儴澶囨敞 + Remark string `gorm:"remark" json:"remark"` // 澶囨敞 + } + + // ServiceOrderSearch 鏈嶅姟鍗曟悳绱㈡潯浠� + ServiceOrderSearch struct { + ServiceOrder + Orm *gorm.DB + QueryClass constvar.ServiceOrderQueryClass + KeywordType constvar.ServiceOrderKeywordType + Keyword string + PageNum int + PageSize int + Preload bool + } +) + +func (ServiceOrder) TableName() string { + return "service_order" +} + +func NewServiceOrderSearch() *ServiceOrderSearch { + return &ServiceOrderSearch{ + Orm: mysqlx.GetDB(), + } +} + +func (slf *ServiceOrderSearch) build() *gorm.DB { + var db = slf.Orm.Model(&ServiceOrder{}) + if slf.Id != 0 { + db = db.Where("id = ?", slf.Id) + } + if slf.Preload { + db = db.Model(&ServiceOrder{}). + Preload("Client"). + Preload("Contract"). + Preload("OrderManage"). + Preload("Product"). + Preload("ServiceType"). + Preload("PriorityLevel"). + Preload("Severity"). + Preload("Faq") + } + + return db +} + +func (slf *ServiceOrderSearch) Create(record *ServiceOrder) error { + var db = slf.build() + return db.Create(record).Error +} + +func (slf *ServiceOrderSearch) Delete() error { + var db = slf.build() + return db.Delete(&ServiceOrder{}).Error +} + +func (slf *ServiceOrderSearch) Update(record *ServiceOrder) error { + var db = slf.build() + return db.Updates(record).Error +} + +func (slf *ServiceOrderSearch) FindAll() ([]*ServiceOrder, error) { + var db = slf.build() + var record = make([]*ServiceOrder, 0) + err := db.Find(&record).Error + return record, err +} + +func (slf *ServiceOrderSearch) SetId(id int) *ServiceOrderSearch { + slf.Id = id + return slf +} + +func (slf *ServiceOrderSearch) SetPreload(preload bool) *ServiceOrderSearch { + slf.Preload = preload + return slf +} + +func (slf *ServiceOrderSearch) First() (*ServiceOrder, error) { + var db = slf.build() + var record = new(ServiceOrder) + err := db.First(record).Error + return record, err +} + +func (slf *ServiceOrderSearch) Updates(values interface{}) error { + var db = slf.build() + return db.Updates(values).Error +} + +func (slf *ServiceOrderSearch) Save(record *ServiceOrder) error { + if record.Id == 0 { + return errors.New("id涓虹┖") + } + var db = slf.build() + + if err := db.Save(record).Error; err != nil { + return fmt.Errorf("save err: %v, record: %+v", err, record) + } + + return nil +} + +func (slf *ServiceOrderSearch) Find() ([]*ServiceOrder, int64, error) { + var db = slf.build() + var records = make([]*ServiceOrder, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Find(&records).Error + return records, total, err +} diff --git a/model/serviceType.go b/model/serviceType.go new file mode 100644 index 0000000..7e6f686 --- /dev/null +++ b/model/serviceType.go @@ -0,0 +1,114 @@ +package model + +import ( + "aps_crm/constvar" + "aps_crm/pkg/mysqlx" + "errors" + "fmt" + "gorm.io/gorm" +) + +type ( + // ServiceType 鏈嶅姟绫诲瀷 + ServiceType struct { + Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` + Name string `json:"name" gorm:"column:name"` + } + + // ServiceTypeSearch 鏈嶅姟绫诲瀷鎼滅储鏉′欢 + ServiceTypeSearch struct { + ServiceType + Orm *gorm.DB + QueryClass constvar.ServiceTypeQueryClass + KeywordType constvar.ServiceTypeKeywordType + Keyword string + PageNum int + PageSize int + } +) + +func (ServiceType) TableName() string { + return "service_type" +} + +func NewServiceTypeSearch() *ServiceTypeSearch { + return &ServiceTypeSearch{ + Orm: mysqlx.GetDB(), + } +} + +func (slf *ServiceTypeSearch) build() *gorm.DB { + var db = slf.Orm.Model(&ServiceType{}) + if slf.Id != 0 { + db = db.Where("id = ?", slf.Id) + } + + return db +} + +func (slf *ServiceTypeSearch) Create(record *ServiceType) error { + var db = slf.build() + return db.Create(record).Error +} + +func (slf *ServiceTypeSearch) Delete() error { + var db = slf.build() + return db.Delete(&ServiceType{}).Error +} + +func (slf *ServiceTypeSearch) Update(record *ServiceType) error { + var db = slf.build() + return db.Updates(record).Error +} + +func (slf *ServiceTypeSearch) FindAll() ([]*ServiceType, error) { + var db = slf.build() + var record = make([]*ServiceType, 0) + err := db.Find(&record).Error + return record, err +} + +func (slf *ServiceTypeSearch) SetId(id int) *ServiceTypeSearch { + slf.Id = id + return slf +} + +func (slf *ServiceTypeSearch) First() (*ServiceType, error) { + var db = slf.build() + var record = new(ServiceType) + err := db.First(record).Error + return record, err +} + +func (slf *ServiceTypeSearch) Updates(values interface{}) error { + var db = slf.build() + return db.Updates(values).Error +} + +func (slf *ServiceTypeSearch) Save(record *ServiceType) error { + if record.Id == 0 { + return errors.New("id涓虹┖") + } + var db = slf.build() + + if err := db.Save(record).Error; err != nil { + return fmt.Errorf("save err: %v, record: %+v", err, record) + } + + return nil +} + +func (slf *ServiceTypeSearch) Find() ([]*ServiceType, int64, error) { + var db = slf.build() + var records = make([]*ServiceType, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Find(&records).Error + return records, total, err +} \ No newline at end of file diff --git a/model/severity.go b/model/severity.go new file mode 100644 index 0000000..0fb1bc0 --- /dev/null +++ b/model/severity.go @@ -0,0 +1,114 @@ +package model + +import ( + "aps_crm/constvar" + "aps_crm/pkg/mysqlx" + "errors" + "fmt" + "gorm.io/gorm" +) + +type ( + // Severity 涓ラ噸绋嬪害 + Severity struct { + Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` + Name string `json:"name" gorm:"column:name"` + } + + // SeveritySearch 涓ラ噸绋嬪害鎼滅储鏉′欢 + SeveritySearch struct { + Severity + Orm *gorm.DB + QueryClass constvar.SeverityQueryClass + KeywordType constvar.SeverityKeywordType + Keyword string + PageNum int + PageSize int + } +) + +func (Severity) TableName() string { + return "severity" +} + +func NewSeveritySearch() *SeveritySearch { + return &SeveritySearch{ + Orm: mysqlx.GetDB(), + } +} + +func (slf *SeveritySearch) build() *gorm.DB { + var db = slf.Orm.Model(&Severity{}) + if slf.Id != 0 { + db = db.Where("id = ?", slf.Id) + } + + return db +} + +func (slf *SeveritySearch) Create(record *Severity) error { + var db = slf.build() + return db.Create(record).Error +} + +func (slf *SeveritySearch) Delete() error { + var db = slf.build() + return db.Delete(&Severity{}).Error +} + +func (slf *SeveritySearch) Update(record *Severity) error { + var db = slf.build() + return db.Updates(record).Error +} + +func (slf *SeveritySearch) FindAll() ([]*Severity, error) { + var db = slf.build() + var record = make([]*Severity, 0) + err := db.Find(&record).Error + return record, err +} + +func (slf *SeveritySearch) SetId(id int) *SeveritySearch { + slf.Id = id + return slf +} + +func (slf *SeveritySearch) First() (*Severity, error) { + var db = slf.build() + var record = new(Severity) + err := db.First(record).Error + return record, err +} + +func (slf *SeveritySearch) Updates(values interface{}) error { + var db = slf.build() + return db.Updates(values).Error +} + +func (slf *SeveritySearch) Save(record *Severity) error { + if record.Id == 0 { + return errors.New("id涓虹┖") + } + var db = slf.build() + + if err := db.Save(record).Error; err != nil { + return fmt.Errorf("save err: %v, record: %+v", err, record) + } + + return nil +} + +func (slf *SeveritySearch) Find() ([]*Severity, int64, error) { + var db = slf.build() + var records = make([]*Severity, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Find(&records).Error + return records, total, err +} \ No newline at end of file diff --git a/router/faq.go b/router/faq.go new file mode 100644 index 0000000..7d13fd1 --- /dev/null +++ b/router/faq.go @@ -0,0 +1,17 @@ +package router + +import ( + v1 "aps_crm/api/v1" + "github.com/gin-gonic/gin" +) + +func InitFaqRouter(router *gin.RouterGroup) { + FaqRouter := router.Group("faq") + FaqApi := v1.FaqApi{} + { + FaqRouter.POST("add", FaqApi.Add) // 娣诲姞甯歌闂 + FaqRouter.DELETE("delete/:id", FaqApi.Delete) // 鍒犻櫎甯歌闂 + FaqRouter.PUT("update", FaqApi.Update) // 鏇存柊甯歌闂 + FaqRouter.GET("list", FaqApi.List) // 鑾峰彇甯歌闂鍒楄〃 + } +} diff --git a/router/index.go b/router/index.go index a05ce9f..506b4ab 100644 --- a/router/index.go +++ b/router/index.go @@ -159,6 +159,11 @@ routerGroup.InitQuotationStatusRouter(PrivateGroup) routerGroup.InitCurrencyRouter(PrivateGroup) routerGroup.InitAssignRouter(PrivateGroup) + InitServiceOrderRouter(PrivateGroup) + InitFaqRouter(PrivateGroup) + InitPriorityLevelRouter(PrivateGroup) + InitServiceTypeRouter(PrivateGroup) + InitSeverityRouter(PrivateGroup) } return Router } diff --git a/router/priorityLevel.go b/router/priorityLevel.go new file mode 100644 index 0000000..1adf38d --- /dev/null +++ b/router/priorityLevel.go @@ -0,0 +1,17 @@ +package router + +import ( + v1 "aps_crm/api/v1" + "github.com/gin-gonic/gin" +) + +func InitPriorityLevelRouter(router *gin.RouterGroup) { + PriorityLevelRouter := router.Group("priorityLevel") + PriorityLevelApi := v1.PriorityLevelApi{} + { + PriorityLevelRouter.POST("add", PriorityLevelApi.Add) // 娣诲姞浼樺厛绾у埆 + PriorityLevelRouter.DELETE("delete/:id", PriorityLevelApi.Delete) // 鍒犻櫎浼樺厛绾у埆 + PriorityLevelRouter.PUT("update", PriorityLevelApi.Update) // 鏇存柊浼樺厛绾у埆 + PriorityLevelRouter.GET("list", PriorityLevelApi.List) // 鑾峰彇浼樺厛绾у埆鍒楄〃 + } +} diff --git a/router/serviceOrder.go b/router/serviceOrder.go new file mode 100644 index 0000000..8efdc84 --- /dev/null +++ b/router/serviceOrder.go @@ -0,0 +1,17 @@ +package router + +import ( + v1 "aps_crm/api/v1" + "github.com/gin-gonic/gin" +) + +func InitServiceOrderRouter(router *gin.RouterGroup) { + ServiceOrderRouter := router.Group("serviceOrder") + ServiceOrderApi := v1.ServiceOrderApi{} + { + ServiceOrderRouter.POST("add", ServiceOrderApi.Add) // 娣诲姞鏈嶅姟鍗� + ServiceOrderRouter.DELETE("delete/:id", ServiceOrderApi.Delete) // 鍒犻櫎鏈嶅姟鍗� + ServiceOrderRouter.PUT("update", ServiceOrderApi.Update) // 鏇存柊鏈嶅姟鍗� + ServiceOrderRouter.GET("list", ServiceOrderApi.List) // 鑾峰彇鏈嶅姟鍗曞垪琛� + } +} diff --git a/router/serviceType.go b/router/serviceType.go new file mode 100644 index 0000000..e373530 --- /dev/null +++ b/router/serviceType.go @@ -0,0 +1,17 @@ +package router + +import ( + v1 "aps_crm/api/v1" + "github.com/gin-gonic/gin" +) + +func InitServiceTypeRouter(router *gin.RouterGroup) { + ServiceTypeRouter := router.Group("serviceType") + ServiceTypeApi := v1.ServiceTypeApi{} + { + ServiceTypeRouter.POST("add", ServiceTypeApi.Add) // 娣诲姞鏈嶅姟绫诲瀷 + ServiceTypeRouter.DELETE("delete/:id", ServiceTypeApi.Delete) // 鍒犻櫎鏈嶅姟绫诲瀷 + ServiceTypeRouter.PUT("update", ServiceTypeApi.Update) // 鏇存柊鏈嶅姟绫诲瀷 + ServiceTypeRouter.GET("list", ServiceTypeApi.List) // 鑾峰彇鏈嶅姟绫诲瀷鍒楄〃 + } +} diff --git a/router/severity.go b/router/severity.go new file mode 100644 index 0000000..78e6dfc --- /dev/null +++ b/router/severity.go @@ -0,0 +1,17 @@ +package router + +import ( + v1 "aps_crm/api/v1" + "github.com/gin-gonic/gin" +) + +func InitSeverityRouter(router *gin.RouterGroup) { + SeverityRouter := router.Group("severity") + SeverityApi := v1.SeverityApi{} + { + SeverityRouter.POST("add", SeverityApi.Add) // 娣诲姞涓ラ噸绋嬪害 + SeverityRouter.DELETE("delete/:id", SeverityApi.Delete) // 鍒犻櫎涓ラ噸绋嬪害 + SeverityRouter.PUT("update", SeverityApi.Update) // 鏇存柊涓ラ噸绋嬪害 + SeverityRouter.GET("list", SeverityApi.List) // 鑾峰彇涓ラ噸绋嬪害鍒楄〃 + } +} diff --git a/service/faq.go b/service/faq.go new file mode 100644 index 0000000..5374143 --- /dev/null +++ b/service/faq.go @@ -0,0 +1,66 @@ +package service + +import ( + "aps_crm/model" + "aps_crm/model/request" + "aps_crm/pkg/ecode" +) + +type FaqService struct{} + +func NewFaqService() FaqService { + return FaqService{} +} + +func (FaqService) AddFaq(Faq *model.Faq) int { + err := model.NewFaqSearch().Create(Faq) + if err != nil { + return ecode.DBErr + } + + return ecode.OK +} + +func (FaqService) DeleteFaq(id int) int { + err := model.NewFaqSearch().SetId(id).Delete() + if err != nil { + return ecode.DBErr + } + return ecode.OK +} + +func (FaqService) GetFaqList() ([]*model.Faq, int64, int) { + list, total, err := model.NewFaqSearch().Find() + if err != nil { + return nil, 0, ecode.DBErr + } + + return list, total, ecode.OK +} + +func (FaqService) UpdateFaqs(Faqs []*request.UpdateFaq) int { + for _, v := range Faqs { + // check Faq exist + _, err := model.NewFaqSearch().SetId(v.Id).First() + if err != nil { + return ecode.DBErr + } + + err = model.NewFaqSearch().SetId(v.Id).Updates(map[string]interface{}{ + + }) + if err != nil { + return ecode.DBErr + } + } + + return ecode.OK +} + +func (FaqService) UpdateFaq(faq *model.Faq) int { + err := model.NewFaqSearch().Save(faq) + if err != nil { + return ecode.DBErr + } + return ecode.OK +} diff --git a/service/priorityLevel.go b/service/priorityLevel.go new file mode 100644 index 0000000..ad487a2 --- /dev/null +++ b/service/priorityLevel.go @@ -0,0 +1,66 @@ +package service + +import ( + "aps_crm/model" + "aps_crm/model/request" + "aps_crm/pkg/ecode" +) + +type PriorityLevelService struct{} + +func NewPriorityLevelService() PriorityLevelService { + return PriorityLevelService{} +} + +func (PriorityLevelService) AddPriorityLevel(PriorityLevel *model.PriorityLevel) int { + err := model.NewPriorityLevelSearch().Create(PriorityLevel) + if err != nil { + return ecode.DBErr + } + + return ecode.OK +} + +func (PriorityLevelService) DeletePriorityLevel(id int) int { + err := model.NewPriorityLevelSearch().SetId(id).Delete() + if err != nil { + return ecode.DBErr + } + return ecode.OK +} + +func (PriorityLevelService) GetPriorityLevelList() ([]*model.PriorityLevel, int64, int) { + list, total, err := model.NewPriorityLevelSearch().Find() + if err != nil { + return nil, 0, ecode.DBErr + } + + return list, total, ecode.OK +} + +func (PriorityLevelService) UpdatePriorityLevels(PriorityLevels []*request.UpdatePriorityLevel) int { + for _, v := range PriorityLevels { + // check PriorityLevel exist + _, err := model.NewPriorityLevelSearch().SetId(v.Id).First() + if err != nil { + return ecode.DBErr + } + + err = model.NewPriorityLevelSearch().SetId(v.Id).Updates(map[string]interface{}{ + + }) + if err != nil { + return ecode.DBErr + } + } + + return ecode.OK +} + +func (PriorityLevelService) UpdatePriorityLevel(priorityLevel *model.PriorityLevel) int { + err := model.NewPriorityLevelSearch().Save(priorityLevel) + if err != nil { + return ecode.DBErr + } + return ecode.OK +} diff --git a/service/serviceOrder.go b/service/serviceOrder.go new file mode 100644 index 0000000..2c2e80d --- /dev/null +++ b/service/serviceOrder.go @@ -0,0 +1,66 @@ +package service + +import ( + "aps_crm/model" + "aps_crm/model/request" + "aps_crm/pkg/ecode" +) + +type ServiceOrderService struct{} + +func NewServiceOrderService() ServiceOrderService { + return ServiceOrderService{} +} + +func (ServiceOrderService) AddServiceOrder(ServiceOrder *model.ServiceOrder) int { + err := model.NewServiceOrderSearch().Create(ServiceOrder) + if err != nil { + return ecode.DBErr + } + + return ecode.OK +} + +func (ServiceOrderService) DeleteServiceOrder(id int) int { + err := model.NewServiceOrderSearch().SetId(id).Delete() + if err != nil { + return ecode.DBErr + } + return ecode.OK +} + +func (ServiceOrderService) GetServiceOrderList() ([]*model.ServiceOrder, int64, int) { + list, total, err := model.NewServiceOrderSearch().Find() + if err != nil { + return nil, 0, ecode.DBErr + } + + return list, total, ecode.OK +} + +func (ServiceOrderService) UpdateServiceOrders(ServiceOrders []*request.UpdateServiceOrder) int { + for _, v := range ServiceOrders { + // check ServiceOrder exist + _, err := model.NewServiceOrderSearch().SetId(v.Id).First() + if err != nil { + return ecode.DBErr + } + + err = model.NewServiceOrderSearch().SetId(v.Id).Updates(map[string]interface{}{ + + }) + if err != nil { + return ecode.DBErr + } + } + + return ecode.OK +} + +func (ServiceOrderService) UpdateServiceOrder(serviceOrder *model.ServiceOrder) int { + err := model.NewServiceOrderSearch().Save(serviceOrder) + if err != nil { + return ecode.DBErr + } + return ecode.OK +} diff --git a/service/serviceType.go b/service/serviceType.go new file mode 100644 index 0000000..e20b1f4 --- /dev/null +++ b/service/serviceType.go @@ -0,0 +1,66 @@ +package service + +import ( + "aps_crm/model" + "aps_crm/model/request" + "aps_crm/pkg/ecode" +) + +type ServiceTypeService struct{} + +func NewServiceTypeService() ServiceTypeService { + return ServiceTypeService{} +} + +func (ServiceTypeService) AddServiceType(ServiceType *model.ServiceType) int { + err := model.NewServiceTypeSearch().Create(ServiceType) + if err != nil { + return ecode.DBErr + } + + return ecode.OK +} + +func (ServiceTypeService) DeleteServiceType(id int) int { + err := model.NewServiceTypeSearch().SetId(id).Delete() + if err != nil { + return ecode.DBErr + } + return ecode.OK +} + +func (ServiceTypeService) GetServiceTypeList() ([]*model.ServiceType, int64, int) { + list, total, err := model.NewServiceTypeSearch().Find() + if err != nil { + return nil, 0, ecode.DBErr + } + + return list, total, ecode.OK +} + +func (ServiceTypeService) UpdateServiceTypes(ServiceTypes []*request.UpdateServiceType) int { + for _, v := range ServiceTypes { + // check ServiceType exist + _, err := model.NewServiceTypeSearch().SetId(v.Id).First() + if err != nil { + return ecode.DBErr + } + + err = model.NewServiceTypeSearch().SetId(v.Id).Updates(map[string]interface{}{ + + }) + if err != nil { + return ecode.DBErr + } + } + + return ecode.OK +} + +func (ServiceTypeService) UpdateServiceType(serviceType *model.ServiceType) int { + err := model.NewServiceTypeSearch().Save(serviceType) + if err != nil { + return ecode.DBErr + } + return ecode.OK +} diff --git a/service/severity.go b/service/severity.go new file mode 100644 index 0000000..d2562ec --- /dev/null +++ b/service/severity.go @@ -0,0 +1,66 @@ +package service + +import ( + "aps_crm/model" + "aps_crm/model/request" + "aps_crm/pkg/ecode" +) + +type SeverityService struct{} + +func NewSeverityService() SeverityService { + return SeverityService{} +} + +func (SeverityService) AddSeverity(Severity *model.Severity) int { + err := model.NewSeveritySearch().Create(Severity) + if err != nil { + return ecode.DBErr + } + + return ecode.OK +} + +func (SeverityService) DeleteSeverity(id int) int { + err := model.NewSeveritySearch().SetId(id).Delete() + if err != nil { + return ecode.DBErr + } + return ecode.OK +} + +func (SeverityService) GetSeverityList() ([]*model.Severity, int64, int) { + list, total, err := model.NewSeveritySearch().Find() + if err != nil { + return nil, 0, ecode.DBErr + } + + return list, total, ecode.OK +} + +func (SeverityService) UpdateSeveritys(Severitys []*request.UpdateSeverity) int { + for _, v := range Severitys { + // check Severity exist + _, err := model.NewSeveritySearch().SetId(v.Id).First() + if err != nil { + return ecode.DBErr + } + + err = model.NewSeveritySearch().SetId(v.Id).Updates(map[string]interface{}{ + + }) + if err != nil { + return ecode.DBErr + } + } + + return ecode.OK +} + +func (SeverityService) UpdateSeverity(severity *model.Severity) int { + err := model.NewSeveritySearch().Save(severity) + if err != nil { + return ecode.DBErr + } + return ecode.OK +} -- Gitblit v1.8.0