|
@@ -0,0 +1,67 @@
|
|
1
|
+package new_mobile_api_controllers
|
|
2
|
+
|
|
3
|
+import (
|
|
4
|
+ "XT_New/controllers"
|
|
5
|
+ "XT_New/enums"
|
|
6
|
+ "XT_New/service"
|
|
7
|
+ "fmt"
|
|
8
|
+)
|
|
9
|
+
|
|
10
|
+type CommonApiController struct {
|
|
11
|
+ controllers.BaseAuthAPIController
|
|
12
|
+}
|
|
13
|
+
|
|
14
|
+func (this *CommonApiController) GetInspectionMajor() {
|
|
15
|
+
|
|
16
|
+ major, err := service.GetInspectionMajor(0)
|
|
17
|
+ if err != nil {
|
|
18
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
19
|
+ return
|
|
20
|
+ }
|
|
21
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
22
|
+ "inspection": major,
|
|
23
|
+ })
|
|
24
|
+}
|
|
25
|
+
|
|
26
|
+func (this *CommonApiController) GetInspectionMinor() {
|
|
27
|
+ id, _ := this.GetInt64("id")
|
|
28
|
+ fmt.Println("id", id)
|
|
29
|
+ minor, err := service.GetInspectionMinor(id)
|
|
30
|
+ if err != nil {
|
|
31
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
32
|
+ return
|
|
33
|
+ }
|
|
34
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
35
|
+ "inspection": minor,
|
|
36
|
+ })
|
|
37
|
+}
|
|
38
|
+
|
|
39
|
+func (this *CommonApiController) GetInspectionRange() {
|
|
40
|
+ id, _ := this.GetInt64("id")
|
|
41
|
+ fmt.Println("id", id)
|
|
42
|
+ inspectionRange, err := service.GetInspectionRange(id)
|
|
43
|
+ if err != nil {
|
|
44
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
45
|
+ return
|
|
46
|
+ }
|
|
47
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
48
|
+ "inspectionRange": inspectionRange,
|
|
49
|
+ })
|
|
50
|
+}
|
|
51
|
+
|
|
52
|
+func (this *CommonApiController) SaveInspection() {
|
|
53
|
+ fmt.Println("触发-------------------0")
|
|
54
|
+ //dataBody := make(map[string]interface{}, 0)
|
|
55
|
+ //err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
56
|
+ //fmt.Println("err",err)
|
|
57
|
+ //inspectionmajor := int64(dataBody["inspectionMajor"].(float64))
|
|
58
|
+ //fmt.Println("大项",inspectionmajor)
|
|
59
|
+ //inspectionMinor := int64(dataBody["inspectionMinor"].(float64))
|
|
60
|
+ //fmt.Println("小项",inspectionMinor)
|
|
61
|
+ //minrange := dataBody["min_range"].(string)
|
|
62
|
+ //fmt.Println("minragne",minrange)
|
|
63
|
+ //largerange := dataBody["large_range"].(string)
|
|
64
|
+ //fmt.Println("largerange",largerange)
|
|
65
|
+ //sort := dataBody["sort"].(string)
|
|
66
|
+ //fmt.Println("sort",sort)
|
|
67
|
+}
|