zhangqian
2023-08-05 f04def67f695e69591ccdd73bb339c6f402b477c
update
25个文件已修改
719 ■■■■■ 已修改文件
api/v1/faq.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/faultType.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/priorityLevel.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/serviceType.go 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/severity.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/timeSpent.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/faq.go 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/faultType.go 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/priorityLevel.go 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/serviceOrder.go 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/serviceOrder.go 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/serviceType.go 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/severity.go 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/timeSpent.go 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/serviceType.go 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/faq.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/faultType.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/priorityLevel.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/serviceOrder.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/serviceType.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/severity.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/timeSpent.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/faq.go
@@ -71,6 +71,10 @@
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.Faq.Id = params.Id
    errCode := service.NewFaqService().UpdateFaq(&params.Faq)
    if errCode != ecode.OK {
api/v1/faultType.go
@@ -71,6 +71,10 @@
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.FaultType.Id = params.Id
    errCode := service.NewFaultTypeService().UpdateFaultType(&params.FaultType)
    if errCode != ecode.OK {
api/v1/priorityLevel.go
@@ -71,6 +71,10 @@
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.PriorityLevel.Id = params.Id
    errCode := service.NewPriorityLevelService().UpdatePriorityLevel(&params.PriorityLevel)
    if errCode != ecode.OK {
api/v1/serviceType.go
@@ -13,8 +13,8 @@
type ServiceTypeApi struct{}
// Add
// @Tags        服务类型管理
// @Summary    添加服务类型
// @Tags        服务方式管理
// @Summary    添加服务方式
// @Produce    application/json
// @Param        object    body        request.AddServiceType    true    "查询参数"
// @Success    200        {object}    contextx.Response{}
@@ -36,8 +36,8 @@
}
// Delete
// @Tags        服务类型管理
// @Summary    删除服务类型
// @Tags        服务方式管理
// @Summary    删除服务方式
// @Produce    application/json
// @Param        id    path        int    true    "查询参数"
// @Success    200    {object}    contextx.Response{}
@@ -59,8 +59,8 @@
}
// Update
// @Tags        服务类型管理
// @Summary    更新服务类型
// @Tags        服务方式管理
// @Summary    更新服务方式
// @Produce    application/json
// @Param        object    body        request.UpdateServiceType    true    "查询参数"
// @Success    200        {object}    contextx.Response{}
@@ -71,6 +71,10 @@
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.ServiceType.Id = params.Id
    errCode := service.NewServiceTypeService().UpdateServiceType(&params.ServiceType)
    if errCode != ecode.OK {
@@ -82,8 +86,8 @@
}
// List
// @Tags        服务类型管理
// @Summary    获取服务类型列表
// @Tags        服务方式管理
// @Summary    获取服务方式列表
// @Produce    application/json
// @Success    200    {object}    response.ListResponse{data=[]model.ServiceType}
// @Router        /api/serviceType/list [get]
api/v1/severity.go
@@ -71,6 +71,10 @@
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.Severity.Id = params.Id
    errCode := service.NewSeverityService().UpdateSeverity(&params.Severity)
    if errCode != ecode.OK {
api/v1/timeSpent.go
@@ -71,6 +71,10 @@
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.TimeSpent.Id = params.Id
    errCode := service.NewTimeSpentService().UpdateTimeSpent(&params.TimeSpent)
    if errCode != ecode.OK {
docs/docs.go
@@ -6780,9 +6780,9 @@
                    "application/json"
                ],
                "tags": [
                    "服务类型管理"
                    "服务方式管理"
                ],
                "summary": "添加服务类型",
                "summary": "添加服务方式",
                "parameters": [
                    {
                        "description": "查询参数",
@@ -6810,9 +6810,9 @@
                    "application/json"
                ],
                "tags": [
                    "服务类型管理"
                    "服务方式管理"
                ],
                "summary": "删除服务类型",
                "summary": "删除服务方式",
                "parameters": [
                    {
                        "type": "integer",
@@ -6838,9 +6838,9 @@
                    "application/json"
                ],
                "tags": [
                    "服务类型管理"
                    "服务方式管理"
                ],
                "summary": "获取服务类型列表",
                "summary": "获取服务方式列表",
                "responses": {
                    "200": {
                        "description": "OK",
@@ -6872,9 +6872,9 @@
                    "application/json"
                ],
                "tags": [
                    "服务类型管理"
                    "服务方式管理"
                ],
                "summary": "更新服务类型",
                "summary": "更新服务方式",
                "parameters": [
                    {
                        "description": "查询参数",
@@ -9559,15 +9559,15 @@
                    "description": "上门地址",
                    "type": "string"
                },
                "appointment_time": {
                "appointmentTime": {
                    "description": "预约上门时间",
                    "type": "string"
                },
                "car_fare": {
                "carFare": {
                    "description": "交通费",
                    "type": "number"
                },
                "charge_amount": {
                "chargeAmount": {
                    "description": "收费金额",
                    "type": "number"
                },
@@ -9581,7 +9581,7 @@
                "contact": {
                    "$ref": "#/definitions/model.Contact"
                },
                "contact_id": {
                "contactId": {
                    "description": "联系人id",
                    "type": "integer"
                },
@@ -9592,37 +9592,44 @@
                    "description": "合同id",
                    "type": "integer"
                },
                "expect_time": {
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
                },
                "faq": {
                    "$ref": "#/definitions/model.Faq"
                },
                "id": {
                "faqId": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "order": {
                    "$ref": "#/definitions/model.OrderManage"
                "faultType": {
                    "$ref": "#/definitions/model.FaultType"
                },
                "faultTypeId": {
                    "description": "故障类别id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "orderId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "orderManage": {
                    "$ref": "#/definitions/model.OrderManage"
                },
                "priorityLevel": {
                    "$ref": "#/definitions/model.PriorityLevel"
                },
                "priority_level_id": {
                    "description": "优先级别",
                "priorityLevelId": {
                    "description": "优先级别id",
                    "type": "integer"
                },
                "problem_desc": {
                "problemDesc": {
                    "description": "问题描述",
                    "type": "string"
                },
                "problem_id": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "product": {
                    "$ref": "#/definitions/model.Product"
@@ -9631,7 +9638,7 @@
                    "description": "产品id",
                    "type": "integer"
                },
                "real_time": {
                "realTime": {
                    "description": "实际处理时间",
                    "type": "string"
                },
@@ -9658,7 +9665,7 @@
                    "$ref": "#/definitions/model.ServiceType"
                },
                "serviceTypeId": {
                    "description": "服务方式",
                    "description": "服务方式id",
                    "type": "integer"
                },
                "severity": {
@@ -9668,7 +9675,7 @@
                    "description": "解决方法",
                    "type": "string"
                },
                "solution_remark": {
                "solutionRemark": {
                    "description": "内部备注",
                    "type": "string"
                },
@@ -9680,7 +9687,10 @@
                    "description": "主题",
                    "type": "string"
                },
                "time_spent_id": {
                "timeSpent": {
                    "$ref": "#/definitions/model.TimeSpent"
                },
                "timeSpentId": {
                    "description": "花费时间",
                    "type": "integer"
                }
@@ -10902,15 +10912,15 @@
                    "description": "上门地址",
                    "type": "string"
                },
                "appointment_time": {
                "appointmentTime": {
                    "description": "预约上门时间",
                    "type": "string"
                },
                "car_fare": {
                "carFare": {
                    "description": "交通费",
                    "type": "number"
                },
                "charge_amount": {
                "chargeAmount": {
                    "description": "收费金额",
                    "type": "number"
                },
@@ -10918,7 +10928,7 @@
                    "description": "客户id",
                    "type": "integer"
                },
                "contact_id": {
                "contactId": {
                    "description": "联系人id",
                    "type": "integer"
                },
@@ -10926,31 +10936,35 @@
                    "description": "合同id",
                    "type": "integer"
                },
                "expect_time": {
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
                },
                "faqId": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "faultTypeId": {
                    "description": "故障类别id",
                    "type": "integer"
                },
                "orderId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "priority_level_id": {
                    "description": "优先级别",
                "priorityLevelId": {
                    "description": "优先级别id",
                    "type": "integer"
                },
                "problem_desc": {
                "problemDesc": {
                    "description": "问题描述",
                    "type": "string"
                },
                "problem_id": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "productId": {
                    "description": "产品id",
                    "type": "integer"
                },
                "real_time": {
                "realTime": {
                    "description": "实际处理时间",
                    "type": "string"
                },
@@ -10971,18 +10985,18 @@
                    "type": "string"
                },
                "serviceTypeId": {
                    "description": "服务方式",
                    "description": "服务方式id",
                    "type": "integer"
                },
                "severity": {
                    "description": "严重程度",
                    "description": "严重程度id",
                    "type": "integer"
                },
                "solution": {
                    "description": "解决方法",
                    "type": "string"
                },
                "solution_remark": {
                "solutionRemark": {
                    "description": "内部备注",
                    "type": "string"
                },
@@ -10994,7 +11008,7 @@
                    "description": "主题",
                    "type": "string"
                },
                "time_spent_id": {
                "timeSpentId": {
                    "description": "花费时间",
                    "type": "integer"
                }
@@ -13556,15 +13570,15 @@
                    "description": "上门地址",
                    "type": "string"
                },
                "appointment_time": {
                "appointmentTime": {
                    "description": "预约上门时间",
                    "type": "string"
                },
                "car_fare": {
                "carFare": {
                    "description": "交通费",
                    "type": "number"
                },
                "charge_amount": {
                "chargeAmount": {
                    "description": "收费金额",
                    "type": "number"
                },
@@ -13572,7 +13586,7 @@
                    "description": "客户id",
                    "type": "integer"
                },
                "contact_id": {
                "contactId": {
                    "description": "联系人id",
                    "type": "integer"
                },
@@ -13580,9 +13594,17 @@
                    "description": "合同id",
                    "type": "integer"
                },
                "expect_time": {
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
                },
                "faqId": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "faultTypeId": {
                    "description": "故障类别id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
@@ -13591,23 +13613,19 @@
                    "description": "销售订单id",
                    "type": "integer"
                },
                "priority_level_id": {
                    "description": "优先级别",
                "priorityLevelId": {
                    "description": "优先级别id",
                    "type": "integer"
                },
                "problem_desc": {
                "problemDesc": {
                    "description": "问题描述",
                    "type": "string"
                },
                "problem_id": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "productId": {
                    "description": "产品id",
                    "type": "integer"
                },
                "real_time": {
                "realTime": {
                    "description": "实际处理时间",
                    "type": "string"
                },
@@ -13628,18 +13646,18 @@
                    "type": "string"
                },
                "serviceTypeId": {
                    "description": "服务方式",
                    "description": "服务方式id",
                    "type": "integer"
                },
                "severity": {
                    "description": "严重程度",
                    "description": "严重程度id",
                    "type": "integer"
                },
                "solution": {
                    "description": "解决方法",
                    "type": "string"
                },
                "solution_remark": {
                "solutionRemark": {
                    "description": "内部备注",
                    "type": "string"
                },
@@ -13651,7 +13669,7 @@
                    "description": "主题",
                    "type": "string"
                },
                "time_spent_id": {
                "timeSpentId": {
                    "description": "花费时间",
                    "type": "integer"
                }
docs/swagger.json
@@ -6768,9 +6768,9 @@
                    "application/json"
                ],
                "tags": [
                    "服务类型管理"
                    "服务方式管理"
                ],
                "summary": "添加服务类型",
                "summary": "添加服务方式",
                "parameters": [
                    {
                        "description": "查询参数",
@@ -6798,9 +6798,9 @@
                    "application/json"
                ],
                "tags": [
                    "服务类型管理"
                    "服务方式管理"
                ],
                "summary": "删除服务类型",
                "summary": "删除服务方式",
                "parameters": [
                    {
                        "type": "integer",
@@ -6826,9 +6826,9 @@
                    "application/json"
                ],
                "tags": [
                    "服务类型管理"
                    "服务方式管理"
                ],
                "summary": "获取服务类型列表",
                "summary": "获取服务方式列表",
                "responses": {
                    "200": {
                        "description": "OK",
@@ -6860,9 +6860,9 @@
                    "application/json"
                ],
                "tags": [
                    "服务类型管理"
                    "服务方式管理"
                ],
                "summary": "更新服务类型",
                "summary": "更新服务方式",
                "parameters": [
                    {
                        "description": "查询参数",
@@ -9547,15 +9547,15 @@
                    "description": "上门地址",
                    "type": "string"
                },
                "appointment_time": {
                "appointmentTime": {
                    "description": "预约上门时间",
                    "type": "string"
                },
                "car_fare": {
                "carFare": {
                    "description": "交通费",
                    "type": "number"
                },
                "charge_amount": {
                "chargeAmount": {
                    "description": "收费金额",
                    "type": "number"
                },
@@ -9569,7 +9569,7 @@
                "contact": {
                    "$ref": "#/definitions/model.Contact"
                },
                "contact_id": {
                "contactId": {
                    "description": "联系人id",
                    "type": "integer"
                },
@@ -9580,37 +9580,44 @@
                    "description": "合同id",
                    "type": "integer"
                },
                "expect_time": {
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
                },
                "faq": {
                    "$ref": "#/definitions/model.Faq"
                },
                "id": {
                "faqId": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "order": {
                    "$ref": "#/definitions/model.OrderManage"
                "faultType": {
                    "$ref": "#/definitions/model.FaultType"
                },
                "faultTypeId": {
                    "description": "故障类别id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "orderId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "orderManage": {
                    "$ref": "#/definitions/model.OrderManage"
                },
                "priorityLevel": {
                    "$ref": "#/definitions/model.PriorityLevel"
                },
                "priority_level_id": {
                    "description": "优先级别",
                "priorityLevelId": {
                    "description": "优先级别id",
                    "type": "integer"
                },
                "problem_desc": {
                "problemDesc": {
                    "description": "问题描述",
                    "type": "string"
                },
                "problem_id": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "product": {
                    "$ref": "#/definitions/model.Product"
@@ -9619,7 +9626,7 @@
                    "description": "产品id",
                    "type": "integer"
                },
                "real_time": {
                "realTime": {
                    "description": "实际处理时间",
                    "type": "string"
                },
@@ -9646,7 +9653,7 @@
                    "$ref": "#/definitions/model.ServiceType"
                },
                "serviceTypeId": {
                    "description": "服务方式",
                    "description": "服务方式id",
                    "type": "integer"
                },
                "severity": {
@@ -9656,7 +9663,7 @@
                    "description": "解决方法",
                    "type": "string"
                },
                "solution_remark": {
                "solutionRemark": {
                    "description": "内部备注",
                    "type": "string"
                },
@@ -9668,7 +9675,10 @@
                    "description": "主题",
                    "type": "string"
                },
                "time_spent_id": {
                "timeSpent": {
                    "$ref": "#/definitions/model.TimeSpent"
                },
                "timeSpentId": {
                    "description": "花费时间",
                    "type": "integer"
                }
@@ -10890,15 +10900,15 @@
                    "description": "上门地址",
                    "type": "string"
                },
                "appointment_time": {
                "appointmentTime": {
                    "description": "预约上门时间",
                    "type": "string"
                },
                "car_fare": {
                "carFare": {
                    "description": "交通费",
                    "type": "number"
                },
                "charge_amount": {
                "chargeAmount": {
                    "description": "收费金额",
                    "type": "number"
                },
@@ -10906,7 +10916,7 @@
                    "description": "客户id",
                    "type": "integer"
                },
                "contact_id": {
                "contactId": {
                    "description": "联系人id",
                    "type": "integer"
                },
@@ -10914,31 +10924,35 @@
                    "description": "合同id",
                    "type": "integer"
                },
                "expect_time": {
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
                },
                "faqId": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "faultTypeId": {
                    "description": "故障类别id",
                    "type": "integer"
                },
                "orderId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "priority_level_id": {
                    "description": "优先级别",
                "priorityLevelId": {
                    "description": "优先级别id",
                    "type": "integer"
                },
                "problem_desc": {
                "problemDesc": {
                    "description": "问题描述",
                    "type": "string"
                },
                "problem_id": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "productId": {
                    "description": "产品id",
                    "type": "integer"
                },
                "real_time": {
                "realTime": {
                    "description": "实际处理时间",
                    "type": "string"
                },
@@ -10959,18 +10973,18 @@
                    "type": "string"
                },
                "serviceTypeId": {
                    "description": "服务方式",
                    "description": "服务方式id",
                    "type": "integer"
                },
                "severity": {
                    "description": "严重程度",
                    "description": "严重程度id",
                    "type": "integer"
                },
                "solution": {
                    "description": "解决方法",
                    "type": "string"
                },
                "solution_remark": {
                "solutionRemark": {
                    "description": "内部备注",
                    "type": "string"
                },
@@ -10982,7 +10996,7 @@
                    "description": "主题",
                    "type": "string"
                },
                "time_spent_id": {
                "timeSpentId": {
                    "description": "花费时间",
                    "type": "integer"
                }
@@ -13544,15 +13558,15 @@
                    "description": "上门地址",
                    "type": "string"
                },
                "appointment_time": {
                "appointmentTime": {
                    "description": "预约上门时间",
                    "type": "string"
                },
                "car_fare": {
                "carFare": {
                    "description": "交通费",
                    "type": "number"
                },
                "charge_amount": {
                "chargeAmount": {
                    "description": "收费金额",
                    "type": "number"
                },
@@ -13560,7 +13574,7 @@
                    "description": "客户id",
                    "type": "integer"
                },
                "contact_id": {
                "contactId": {
                    "description": "联系人id",
                    "type": "integer"
                },
@@ -13568,9 +13582,17 @@
                    "description": "合同id",
                    "type": "integer"
                },
                "expect_time": {
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
                },
                "faqId": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "faultTypeId": {
                    "description": "故障类别id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
@@ -13579,23 +13601,19 @@
                    "description": "销售订单id",
                    "type": "integer"
                },
                "priority_level_id": {
                    "description": "优先级别",
                "priorityLevelId": {
                    "description": "优先级别id",
                    "type": "integer"
                },
                "problem_desc": {
                "problemDesc": {
                    "description": "问题描述",
                    "type": "string"
                },
                "problem_id": {
                    "description": "常见问题id",
                    "type": "integer"
                },
                "productId": {
                    "description": "产品id",
                    "type": "integer"
                },
                "real_time": {
                "realTime": {
                    "description": "实际处理时间",
                    "type": "string"
                },
@@ -13616,18 +13634,18 @@
                    "type": "string"
                },
                "serviceTypeId": {
                    "description": "服务方式",
                    "description": "服务方式id",
                    "type": "integer"
                },
                "severity": {
                    "description": "严重程度",
                    "description": "严重程度id",
                    "type": "integer"
                },
                "solution": {
                    "description": "解决方法",
                    "type": "string"
                },
                "solution_remark": {
                "solutionRemark": {
                    "description": "内部备注",
                    "type": "string"
                },
@@ -13639,7 +13657,7 @@
                    "description": "主题",
                    "type": "string"
                },
                "time_spent_id": {
                "timeSpentId": {
                    "description": "花费时间",
                    "type": "integer"
                }
docs/swagger.yaml
@@ -1095,13 +1095,13 @@
      address:
        description: 上门地址
        type: string
      appointment_time:
      appointmentTime:
        description: 预约上门时间
        type: string
      car_fare:
      carFare:
        description: 交通费
        type: number
      charge_amount:
      chargeAmount:
        description: 收费金额
        type: number
      client:
@@ -1111,7 +1111,7 @@
        type: integer
      contact:
        $ref: '#/definitions/model.Contact'
      contact_id:
      contactId:
        description: 联系人id
        type: integer
      contract:
@@ -1119,35 +1119,40 @@
      contractId:
        description: 合同id
        type: integer
      expect_time:
      expectTime:
        description: 希望处理时间
        type: string
      faq:
        $ref: '#/definitions/model.Faq'
      faqId:
        description: 常见问题id
        type: integer
      faultType:
        $ref: '#/definitions/model.FaultType'
      faultTypeId:
        description: 故障类别id
        type: integer
      id:
        type: integer
      order:
        $ref: '#/definitions/model.OrderManage'
      orderId:
        description: 销售订单id
        type: integer
      priority_level_id:
        description: 优先级别
        type: integer
      orderManage:
        $ref: '#/definitions/model.OrderManage'
      priorityLevel:
        $ref: '#/definitions/model.PriorityLevel'
      problem_desc:
      priorityLevelId:
        description: 优先级别id
        type: integer
      problemDesc:
        description: 问题描述
        type: string
      problem_id:
        description: 常见问题id
        type: integer
      product:
        $ref: '#/definitions/model.Product'
      productId:
        description: 产品id
        type: integer
      real_time:
      realTime:
        description: 实际处理时间
        type: string
      remark:
@@ -1167,14 +1172,14 @@
      serviceType:
        $ref: '#/definitions/model.ServiceType'
      serviceTypeId:
        description: 服务方式
        description: 服务方式id
        type: integer
      severity:
        $ref: '#/definitions/model.Severity'
      solution:
        description: 解决方法
        type: string
      solution_remark:
      solutionRemark:
        description: 内部备注
        type: string
      status:
@@ -1183,7 +1188,9 @@
      subject:
        description: 主题
        type: string
      time_spent_id:
      timeSpent:
        $ref: '#/definitions/model.TimeSpent'
      timeSpentId:
        description: 花费时间
        type: integer
    type: object
@@ -2001,43 +2008,46 @@
      address:
        description: 上门地址
        type: string
      appointment_time:
      appointmentTime:
        description: 预约上门时间
        type: string
      car_fare:
      carFare:
        description: 交通费
        type: number
      charge_amount:
      chargeAmount:
        description: 收费金额
        type: number
      clientId:
        description: 客户id
        type: integer
      contact_id:
      contactId:
        description: 联系人id
        type: integer
      contractId:
        description: 合同id
        type: integer
      expect_time:
      expectTime:
        description: 希望处理时间
        type: string
      faqId:
        description: 常见问题id
        type: integer
      faultTypeId:
        description: 故障类别id
        type: integer
      orderId:
        description: 销售订单id
        type: integer
      priority_level_id:
        description: 优先级别
      priorityLevelId:
        description: 优先级别id
        type: integer
      problem_desc:
      problemDesc:
        description: 问题描述
        type: string
      problem_id:
        description: 常见问题id
        type: integer
      productId:
        description: 产品id
        type: integer
      real_time:
      realTime:
        description: 实际处理时间
        type: string
      remark:
@@ -2053,15 +2063,15 @@
        description: 服务单编号
        type: string
      serviceTypeId:
        description: 服务方式
        description: 服务方式id
        type: integer
      severity:
        description: 严重程度
        description: 严重程度id
        type: integer
      solution:
        description: 解决方法
        type: string
      solution_remark:
      solutionRemark:
        description: 内部备注
        type: string
      status:
@@ -2070,7 +2080,7 @@
      subject:
        description: 主题
        type: string
      time_spent_id:
      timeSpentId:
        description: 花费时间
        type: integer
    type: object
@@ -3796,45 +3806,48 @@
      address:
        description: 上门地址
        type: string
      appointment_time:
      appointmentTime:
        description: 预约上门时间
        type: string
      car_fare:
      carFare:
        description: 交通费
        type: number
      charge_amount:
      chargeAmount:
        description: 收费金额
        type: number
      clientId:
        description: 客户id
        type: integer
      contact_id:
      contactId:
        description: 联系人id
        type: integer
      contractId:
        description: 合同id
        type: integer
      expect_time:
      expectTime:
        description: 希望处理时间
        type: string
      faqId:
        description: 常见问题id
        type: integer
      faultTypeId:
        description: 故障类别id
        type: integer
      id:
        type: integer
      orderId:
        description: 销售订单id
        type: integer
      priority_level_id:
        description: 优先级别
      priorityLevelId:
        description: 优先级别id
        type: integer
      problem_desc:
      problemDesc:
        description: 问题描述
        type: string
      problem_id:
        description: 常见问题id
        type: integer
      productId:
        description: 产品id
        type: integer
      real_time:
      realTime:
        description: 实际处理时间
        type: string
      remark:
@@ -3850,15 +3863,15 @@
        description: 服务单编号
        type: string
      serviceTypeId:
        description: 服务方式
        description: 服务方式id
        type: integer
      severity:
        description: 严重程度
        description: 严重程度id
        type: integer
      solution:
        description: 解决方法
        type: string
      solution_remark:
      solutionRemark:
        description: 内部备注
        type: string
      status:
@@ -3867,7 +3880,7 @@
      subject:
        description: 主题
        type: string
      time_spent_id:
      timeSpentId:
        description: 花费时间
        type: integer
    type: object
@@ -8738,9 +8751,9 @@
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 添加服务类型
      summary: 添加服务方式
      tags:
      - 服务类型管理
      - 服务方式管理
  /api/serviceType/delete/{id}:
    delete:
      parameters:
@@ -8756,9 +8769,9 @@
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 删除服务类型
      summary: 删除服务方式
      tags:
      - 服务类型管理
      - 服务方式管理
  /api/serviceType/list:
    get:
      produces:
@@ -8775,9 +8788,9 @@
                    $ref: '#/definitions/model.ServiceType'
                  type: array
              type: object
      summary: 获取服务类型列表
      summary: 获取服务方式列表
      tags:
      - 服务类型管理
      - 服务方式管理
  /api/serviceType/update:
    put:
      parameters:
@@ -8794,9 +8807,9 @@
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 更新服务类型
      summary: 更新服务方式
      tags:
      - 服务类型管理
      - 服务方式管理
  /api/severity/add:
    post:
      parameters:
model/faq.go
@@ -12,18 +12,18 @@
    // Faq 常见问题
    Faq struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name string `json:"name" gorm:"column:name"`
        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
        Orm *gorm.DB
        QueryClass  constvar.FaqQueryClass
        KeywordType constvar.FaqKeywordType
        Keyword     string
        PageNum  int
        PageSize int
    }
)
@@ -117,3 +117,19 @@
    err := db.Find(&records).Error
    return records, total, err
}
// InitDefaultData 初始化数据
func (slf *FaqSearch) InitDefaultData() error {
    var (
        db          = slf.Orm.Table(slf.TableName())
        total int64 = 0
    )
    if err := db.Count(&total).Error; err != nil {
        return err
    }
    if total != 0 {
        return nil
    }
    records := []*Faq{}
    return slf.CreateBatch(records)
}
model/faultType.go
@@ -12,18 +12,18 @@
    // FaultType 故障类别
    FaultType struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name string `json:"name" gorm:"column:name"`
        Name   string    `json:"name" gorm:"column:name"`
    }
    // FaultTypeSearch 故障类别搜索条件
    FaultTypeSearch struct {
        FaultType
        Orm         *gorm.DB
        QueryClass  constvar.FaultTypeQueryClass
        KeywordType constvar.FaultTypeKeywordType
        Keyword     string
        PageNum     int
        PageSize    int
        Orm *gorm.DB
        QueryClass  constvar.FaultTypeQueryClass
        KeywordType constvar.FaultTypeKeywordType
        Keyword     string
        PageNum  int
        PageSize int
    }
)
@@ -117,3 +117,19 @@
    err := db.Find(&records).Error
    return records, total, err
}
// InitDefaultData 初始化数据
func (slf *FaultTypeSearch) InitDefaultData() error {
    var (
        db          = slf.Orm.Table(slf.TableName())
        total int64 = 0
    )
    if err := db.Count(&total).Error; err != nil {
        return err
    }
    if total != 0 {
        return nil
    }
    records := []*FaultType{}
    return slf.CreateBatch(records)
}
model/priorityLevel.go
@@ -12,18 +12,18 @@
    // PriorityLevel 优先级别
    PriorityLevel struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name string `json:"name" gorm:"column:name"`
        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
        Orm *gorm.DB
        QueryClass  constvar.PriorityLevelQueryClass
        KeywordType constvar.PriorityLevelKeywordType
        Keyword     string
        PageNum  int
        PageSize int
    }
)
@@ -130,11 +130,6 @@
    if total != 0 {
        return nil
    }
    records := []*PriorityLevel{
        {Name: "低"},
        {Name: "一般"},
        {Name: "高"},
        {Name: "紧急"},
    }
    records := []*PriorityLevel{}
    return slf.CreateBatch(records)
}
model/request/serviceOrder.go
@@ -5,31 +5,32 @@
)
type AddServiceOrder struct {
    ServiceNumber   string  `gorm:"service_number" json:"serviceNumber"`        // 服务单编号
    ClientId        int     `gorm:"client_id" json:"clientId"`                  // 客户id
    ContractId      int     `gorm:"contract_id" json:"contractId"`              // 合同id
    OrderId         int     `gorm:"order_id" json:"orderId"`                    // 销售订单id
    Subject         string  `gorm:"subject" json:"subject"`                     // 主题
    ProductId       int     `gorm:"product_id" json:"productId"`                // 产品id
    ServiceTypeId   int     `gorm:"service_type_id" json:"serviceTypeId"`       // 服务方式
    ServiceManId    int     `gorm:"service_man_id" json:"serviceManId"`         // 服务人员
    ContactId       int     `gorm:"linkman_id" json:"contact_id"`               // 联系人id
    Address         string  `gorm:"address" json:"address"`                     // 上门地址
    PriorityLevelId int     `gorm:"priority_level_id" json:"priority_level_id"` // 优先级别
    AppointmentTime string  `gorm:"appointment_time" json:"appointment_time"`   // 预约上门时间
    SaleChanceId    int     `gorm:"sale_leads" json:"saleChanceId"`             // 销售机会id
    SeverityId      int     `gorm:"severity_id" json:"severity"`                // 严重程度
    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
    ProblemDesc     string  `gorm:"problem_desc" json:"problem_desc"`           // 问题描述
    Solution        string  `gorm:"solution" json:"solution"`                   // 解决方法
    SolutionRemark  string  `gorm:"solution_remark" json:"solution_remark"`     // 内部备注
    Remark          string  `gorm:"remark" json:"remark"`                       // 备注
    ServiceNumber   string  `gorm:"service_number" json:"serviceNumber"`      // 服务单编号
    ClientId        int     `gorm:"client_id" json:"clientId"`                // 客户id
    ContractId      int     `gorm:"contract_id" json:"contractId"`            // 合同id
    OrderId         int     `gorm:"order_id" json:"orderId"`                  // 销售订单id
    Subject         string  `gorm:"subject" json:"subject"`                   // 主题
    ProductId       int     `gorm:"product_id" json:"productId"`              // 产品id
    ServiceTypeId   int     `gorm:"service_type_id" json:"serviceTypeId"`     // 服务方式id
    ServiceManId    int     `gorm:"service_man_id" json:"serviceManId"`       // 服务人员
    ContactId       int     `gorm:"linkman_id" json:"contactId"`              // 联系人id
    Address         string  `gorm:"address" json:"address"`                   // 上门地址
    PriorityLevelId int     `gorm:"priority_level_id" json:"priorityLevelId"` // 优先级别id
    AppointmentTime string  `gorm:"appointment_time" json:"appointmentTime"`  // 预约上门时间
    SaleChanceId    int     `gorm:"sale_leads" json:"saleChanceId"`           // 销售机会id
    FaultTypeId     int     `gorm:"severity_id" json:"faultTypeId"`           // 故障类别id
    SeverityId      int     `gorm:"severity_id" json:"severity"`              // 严重程度id
    Status          int     `gorm:"status" json:"status"`                     // 处理状态
    ExpectTime      string  `gorm:"expect_time" json:"expectTime"`            // 希望处理时间
    RealTime        string  `gorm:"real_time" json:"realTime"`                // 实际处理时间
    CarFare         float64 `gorm:"car_fare" json:"carFare"`                  // 交通费
    ChargeAmount    float64 `gorm:"charge_amount" json:"chargeAmount"`        // 收费金额
    TimeSpentId     int     `gorm:"time_spent_id" json:"timeSpentId"`         // 花费时间
    FaqId           int     `gorm:"problem_id" json:"faqId"`                  // 常见问题id
    ProblemDesc     string  `gorm:"problem_desc" json:"problemDesc"`          // 问题描述
    Solution        string  `gorm:"solution" json:"solution"`                 // 解决方法
    SolutionRemark  string  `gorm:"solution_remark" json:"solutionRemark"`    // 内部备注
    Remark          string  `gorm:"remark" json:"remark"`                     // 备注
}
type UpdateServiceOrder struct {
model/serviceOrder.go
@@ -22,31 +22,35 @@
        Subject         string        `gorm:"subject" json:"subject"`      // 主题
        ProductId       int           `gorm:"product_id" json:"productId"` // 产品id
        Product         Product       `gorm:"foreignKey:ProductId"`
        ServiceTypeId   int           `gorm:"service_type_id" json:"serviceTypeId"` // 服务方式
        ServiceTypeId   int           `gorm:"service_type_id" json:"serviceTypeId"` // 服务方式id
        ServiceType     ServiceType   `gorm:"foreignKey:ServiceTypeId"`
        ServiceManId    int           `gorm:"service_man_id" json:"serviceManId"` // 服务人员
        ContactId       int           `gorm:"linkman_id" json:"contact_id"`       // 联系人id
        ContactId       int           `gorm:"linkman_id" json:"contactId"`        // 联系人id
        Contact         Contact       `gorm:"foreignKey:ContactId"`
        Address         string        `gorm:"address" json:"address"`                     // 上门地址
        PriorityLevelId int           `gorm:"priority_level_id" json:"priority_level_id"` // 优先级别
        Address         string        `gorm:"address" json:"address"`                   // 上门地址
        PriorityLevelId int           `gorm:"priority_level_id" json:"priorityLevelId"` // 优先级别id
        PriorityLevel   PriorityLevel `gorm:"foreignKey:PriorityLevelId"`
        AppointmentTime string        `gorm:"appointment_time" json:"appointment_time"` // 预约上门时间
        SaleChanceId    int           `gorm:"sale_leads" json:"saleChanceId"`           // 销售机会id
        SaleChance      SaleChance    `gorm:"foreignKey:SaleChanceId"`
        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"`               // 解决方法
        SolutionRemark  string        `gorm:"solution_remark" json:"solution_remark"` // 内部备注
        Remark          string        `gorm:"remark" json:"remark"`                   // 备注
        AppointmentTime string        `gorm:"appointment_time" json:"appointmentTime"` // 预约上门时间
        SaleChanceId    int           `gorm:"sale_leads" json:"saleChanceId"`          // 销售机会id
        SaleChance     SaleChance `gorm:"foreignKey:SaleChanceId"`
        FaultTypeId    int        `gorm:"severity_id" json:"faultTypeId"` // 故障类别id
        FaultType      FaultType  `gorm:"foreignKey:FaultTypeId"`
        SeverityId     int        `gorm:"severity_id" json:"severity"` // 严重程度id
        Severity       Severity   `gorm:"foreignKey:SeverityId"`
        Status         int        `gorm:"status" json:"status"`              // 处理状态
        ExpectTime     string     `gorm:"expect_time" json:"expectTime"`     // 希望处理时间
        RealTime       string     `gorm:"real_time" json:"realTime"`         // 实际处理时间
        CarFare        float64    `gorm:"car_fare" json:"carFare"`           // 交通费
        ChargeAmount   float64    `gorm:"charge_amount" json:"chargeAmount"` // 收费金额
        TimeSpentId    int        `gorm:"time_spent_id" json:"timeSpentId"`  // 花费时间
        TimeSpent      TimeSpent  `gorm:"foreignKey:TimeSpentId"`
        FaqId          int        `gorm:"problem_id" json:"faqId"` // 常见问题id
        Faq            Faq        `gorm:"foreignKey:FaqId"`
        ProblemDesc    string     `gorm:"problem_desc" json:"problemDesc"`       // 问题描述
        Solution       string     `gorm:"solution" json:"solution"`              // 解决方法
        SolutionRemark string     `gorm:"solution_remark" json:"solutionRemark"` // 内部备注
        Remark         string     `gorm:"remark" json:"remark"`                  // 备注
    }
    // ServiceOrderSearch 服务单搜索条件
model/serviceType.go
@@ -9,21 +9,21 @@
)
type (
    // ServiceType 服务类型
    // ServiceType 服务方式
    ServiceType struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name string `json:"name" gorm:"column:name"`
        Name   string    `json:"name" gorm:"column:name"`
    }
    // ServiceTypeSearch 服务类型搜索条件
    // ServiceTypeSearch 服务方式搜索条件
    ServiceTypeSearch struct {
        ServiceType
        Orm         *gorm.DB
        QueryClass  constvar.ServiceTypeQueryClass
        KeywordType constvar.ServiceTypeKeywordType
        Keyword     string
        PageNum     int
        PageSize    int
        Orm *gorm.DB
        QueryClass  constvar.ServiceTypeQueryClass
        KeywordType constvar.ServiceTypeKeywordType
        Keyword     string
        PageNum  int
        PageSize int
    }
)
@@ -130,12 +130,6 @@
    if total != 0 {
        return nil
    }
    records := []*ServiceType{
        {Name: "电话"},
        {Name: "远程"},
        {Name: "送修"},
        {Name: "上门"},
        {Name: "其他"},
    }
    records := []*ServiceType{}
    return slf.CreateBatch(records)
}
model/severity.go
@@ -12,18 +12,18 @@
    // Severity 严重程度
    Severity struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name string `json:"name" gorm:"column:name"`
        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
        Orm *gorm.DB
        QueryClass  constvar.SeverityQueryClass
        KeywordType constvar.SeverityKeywordType
        Keyword     string
        PageNum  int
        PageSize int
    }
)
@@ -130,11 +130,6 @@
    if total != 0 {
        return nil
    }
    records := []*Severity{
        {Name: "轻"},
        {Name: "严重"},
        {Name: "较严重"},
        {Name: "特严重"},
    }
    records := []*Severity{}
    return slf.CreateBatch(records)
}
model/timeSpent.go
@@ -12,18 +12,18 @@
    // TimeSpent 花费时间
    TimeSpent struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name string `json:"name" gorm:"column:name"`
        Name   string    `json:"name" gorm:"column:name"`
    }
    // TimeSpentSearch 花费时间搜索条件
    TimeSpentSearch struct {
        TimeSpent
        Orm         *gorm.DB
        QueryClass  constvar.TimeSpentQueryClass
        KeywordType constvar.TimeSpentKeywordType
        Keyword     string
        PageNum     int
        PageSize    int
        Orm *gorm.DB
        QueryClass  constvar.TimeSpentQueryClass
        KeywordType constvar.TimeSpentKeywordType
        Keyword     string
        PageNum  int
        PageSize int
    }
)
@@ -130,13 +130,6 @@
    if total != 0 {
        return nil
    }
    records := []*TimeSpent{
        {Name: "1小时"},
        {Name: "2小时"},
        {Name: "0.5个工作日"},
        {Name: "1个工作日"},
        {Name: "2个工作日"},
        {Name: "2个工作日以上"},
    }
    records := []*TimeSpent{}
    return slf.CreateBatch(records)
}
router/serviceType.go
@@ -9,9 +9,9 @@
    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)            // 获取服务类型列表
        ServiceTypeRouter.POST("add", ServiceTypeApi.Add)             // 添加服务方式
        ServiceTypeRouter.DELETE("delete/:id", ServiceTypeApi.Delete) // 删除服务方式
        ServiceTypeRouter.PUT("update", ServiceTypeApi.Update)        // 更新服务方式
        ServiceTypeRouter.GET("list", ServiceTypeApi.List)            // 获取服务方式列表
    }
}
service/faq.go
@@ -58,7 +58,7 @@
}
func (FaqService) UpdateFaq(faq *model.Faq) int {
        err := model.NewFaqSearch().Save(faq)
        err := model.NewFaqSearch().SetId(faq.Id).Save(faq)
        if err != nil {
            return ecode.DBErr
        }
service/faultType.go
@@ -58,7 +58,7 @@
}
func (FaultTypeService) UpdateFaultType(faultType *model.FaultType) int {
        err := model.NewFaultTypeSearch().Save(faultType)
        err := model.NewFaultTypeSearch().SetId(faultType.Id).Save(faultType)
        if err != nil {
            return ecode.DBErr
        }
service/priorityLevel.go
@@ -58,7 +58,7 @@
}
func (PriorityLevelService) UpdatePriorityLevel(priorityLevel *model.PriorityLevel) int {
        err := model.NewPriorityLevelSearch().Save(priorityLevel)
        err := model.NewPriorityLevelSearch().SetId(priorityLevel.Id).Save(priorityLevel)
        if err != nil {
            return ecode.DBErr
        }
service/serviceOrder.go
@@ -56,7 +56,7 @@
}
func (ServiceOrderService) UpdateServiceOrder(serviceOrder *model.ServiceOrder) int {
    err := model.NewServiceOrderSearch().Save(serviceOrder)
    err := model.NewServiceOrderSearch().SetId(serviceOrder.Id).Save(serviceOrder)
    if err != nil {
        return ecode.DBErr
    }
service/serviceType.go
@@ -58,7 +58,7 @@
}
func (ServiceTypeService) UpdateServiceType(serviceType *model.ServiceType) int {
        err := model.NewServiceTypeSearch().Save(serviceType)
        err := model.NewServiceTypeSearch().SetId(serviceType.Id).Save(serviceType)
        if err != nil {
            return ecode.DBErr
        }
service/severity.go
@@ -58,7 +58,7 @@
}
func (SeverityService) UpdateSeverity(severity *model.Severity) int {
        err := model.NewSeveritySearch().Save(severity)
        err := model.NewSeveritySearch().SetId(severity.Id).Save(severity)
        if err != nil {
            return ecode.DBErr
        }
service/timeSpent.go
@@ -58,7 +58,7 @@
}
func (TimeSpentService) UpdateTimeSpent(timeSpent *model.TimeSpent) int {
        err := model.NewTimeSpentSearch().Save(timeSpent)
        err := model.NewTimeSpentSearch().SetId(timeSpent.Id).Save(timeSpent)
        if err != nil {
            return ecode.DBErr
        }