1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- package new_mobile_api_controllers
-
- import (
- "XT_New/controllers"
- "XT_New/enums"
- "XT_New/service"
- "fmt"
- )
-
- type CommonApiController struct {
- controllers.BaseAuthAPIController
- }
-
- func (this *CommonApiController) GetInspectionMajor() {
-
- major, err := service.GetInspectionMajor(0)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": major,
- })
- }
-
- func (this *CommonApiController) GetInspectionMinor() {
- id, _ := this.GetInt64("id")
- fmt.Println("id", id)
- minor, err := service.GetInspectionMinor(id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": minor,
- })
- }
-
- func (this *CommonApiController) GetInspectionRange() {
- id, _ := this.GetInt64("id")
- fmt.Println("id", id)
- inspectionRange, err := service.GetInspectionRange(id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspectionRange": inspectionRange,
- })
- }
-
- func (this *CommonApiController) SaveInspection() {
- fmt.Println("触发-------------------0")
- //dataBody := make(map[string]interface{}, 0)
- //err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- //fmt.Println("err",err)
- //inspectionmajor := int64(dataBody["inspectionMajor"].(float64))
- //fmt.Println("大项",inspectionmajor)
- //inspectionMinor := int64(dataBody["inspectionMinor"].(float64))
- //fmt.Println("小项",inspectionMinor)
- //minrange := dataBody["min_range"].(string)
- //fmt.Println("minragne",minrange)
- //largerange := dataBody["large_range"].(string)
- //fmt.Println("largerange",largerange)
- //sort := dataBody["sort"].(string)
- //fmt.Println("sort",sort)
- }
|