lhs 4 years ago
parent
commit
0bce30ccd9
7 changed files with 2214 additions and 3 deletions
  1. 32 0
      controller/test.go
  2. 806 2
      docs/docs.go
  3. 805 0
      docs/swagger.json
  4. 542 0
      docs/swagger.yaml
  5. 1 1
      main.go
  6. 13 0
      repository/postgres/test.go
  7. 15 0
      service/test.go

+ 32 - 0
controller/test.go

@@ -0,0 +1,32 @@
+package controller
+
+import (
+	"gframe/service"
+	"net/http"
+)
+
+type Test struct {
+	BaseController
+}
+
+// UserAdd godoc
+// @Summary 会员用户添加
+// @tags Test
+// @Description 会员用户添加
+// @Accept  x-www-form-urlencoded
+// @Produce  json
+// @Param name formData string true "姓名"
+// @Success 200 {object} controller.ResponseBase
+// @Router /Test/UserAdd [post]
+func (t *Test) UserAdd() (err error) {
+
+	name := t.postString("name", true)
+
+	err = service.Test{}.UserAdd(name)
+	if err != nil {
+		return
+	}
+
+	t.Ctx().JSON(http.StatusOK, newResponseBase())
+	return
+}

+ 806 - 2
docs/docs.go

@@ -1,6 +1,5 @@
 // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
-// This file was generated by swaggo/swag at
-// 2021-01-08 16:28:24.8381164 +0800 CST m=+0.073999901
+// This file was generated by swaggo/swag
 
 package docs
 
@@ -90,6 +89,766 @@ var doc = `{
                     }
                 }
             }
+        },
+        "/HrSensors/AddHrSensors": {
+            "post": {
+                "description": "添加商家公共心率设备",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "HrSensors"
+                ],
+                "summary": "添加商家公共心率设备",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商家ID",
+                        "name": "shopId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "心率带Sn",
+                        "name": "sn",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "场馆内编号  01 02",
+                        "name": "venueNo",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/HrSensors/AddPvtHrSensors": {
+            "post": {
+                "description": "添加会员私有心率设备",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "HrSensors"
+                ],
+                "summary": "添加会员私有心率设备",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商家ID",
+                        "name": "shopId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "心率带Sn",
+                        "name": "sn",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userId",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/Test/UserAdd": {
+            "post": {
+                "description": "会员用户添加",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "Test"
+                ],
+                "summary": "会员用户添加",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachAdd": {
+            "post": {
+                "description": "商家教练添加",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "商家教练添加",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "店铺ID",
+                        "name": "shopId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "登陆用户名也是手机号",
+                        "name": "phone",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "密码",
+                        "name": "pwd",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "性别  1:男, 2:女",
+                        "name": "sex",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "备注",
+                        "name": "memo",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachEdit": {
+            "post": {
+                "description": "商家教练基本信息修改",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "商家教练基本信息修改",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "教练ID",
+                        "name": "ssId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "手机号",
+                        "name": "phone",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "密码",
+                        "name": "pwd",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "备注",
+                        "name": "memo",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "性别  1:男, 2:女",
+                        "name": "sex",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachListQuery": {
+            "post": {
+                "description": "会员用户列表(带分页)",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户列表(带分页)",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "手机号",
+                        "name": "phone",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "当前条",
+                        "name": "start",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "每页条数",
+                        "name": "tableMax",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ShopUserInfo"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachSimpleQuery": {
+            "post": {
+                "description": "本店会员用户基本信息查询",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "本店会员用户基本信息查询",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商家ID",
+                        "name": "shopId",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ShopCoachSimpleInfo"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachStatusEdit": {
+            "post": {
+                "description": "商家教练状态修改",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "商家教练状态修改",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "教练ID",
+                        "name": "ssId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "状态  1:启用\t 8:禁用  9:删除",
+                        "name": "status",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserAdd": {
+            "post": {
+                "description": "会员用户添加",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户添加",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "店铺ID",
+                        "name": "shopId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "登陆用户名也是手机号",
+                        "name": "phone",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "性别  1:男, 2:女",
+                        "name": "sex",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "生日",
+                        "name": "birthday",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "身高",
+                        "name": "height",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "体重 ",
+                        "name": "weight",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "静态心率",
+                        "name": "staticHr",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "头像",
+                        "name": "head",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "备注",
+                        "name": "memo",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserEdit": {
+            "post": {
+                "description": "会员用户基本信息修改",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户基本信息修改",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户Id",
+                        "name": "userId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "手机号",
+                        "name": "phone",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "备注",
+                        "name": "memo",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "生日",
+                        "name": "birthday",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "身高",
+                        "name": "height",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "体重",
+                        "name": "weight",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "性别  1:男, 2:女",
+                        "name": "sex",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "静态心率",
+                        "name": "staticHr",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "头像URL",
+                        "name": "head",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserListQuery": {
+            "post": {
+                "description": "会员用户列表(带分页)",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户列表(带分页)",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "手机号",
+                        "name": "phone",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "当前条",
+                        "name": "start",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "每页条数",
+                        "name": "tableMax",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ShopUserInfo"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserSimpleQuery": {
+            "post": {
+                "description": "本店会员用户基本信息查询",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "本店会员用户基本信息查询",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商家ID",
+                        "name": "shopId",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ShopUserSimpleInfo"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserStatusEdit": {
+            "post": {
+                "description": "会员用户状态修改",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户状态修改",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "状态  1:启用\t 8:禁用  9:删除",
+                        "name": "status",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
         }
     },
     "definitions": {
@@ -103,6 +862,51 @@ var doc = `{
                     "type": "string"
                 }
             }
+        },
+        "controller.ShopCoachSimpleInfo": {
+            "type": "object",
+            "properties": {
+                "code": {
+                    "type": "integer"
+                },
+                "memo": {
+                    "type": "string"
+                },
+                "rs": {
+                    "type": "string"
+                }
+            }
+        },
+        "controller.ShopUserInfo": {
+            "type": "object",
+            "properties": {
+                "code": {
+                    "type": "integer"
+                },
+                "memo": {
+                    "type": "string"
+                },
+                "pageCount": {
+                    "type": "integer"
+                },
+                "rs": {
+                    "type": "string"
+                }
+            }
+        },
+        "controller.ShopUserSimpleInfo": {
+            "type": "object",
+            "properties": {
+                "code": {
+                    "type": "integer"
+                },
+                "memo": {
+                    "type": "string"
+                },
+                "rs": {
+                    "type": "string"
+                }
+            }
         }
     },
     "securityDefinitions": {

+ 805 - 0
docs/swagger.json

@@ -73,6 +73,766 @@
                     }
                 }
             }
+        },
+        "/HrSensors/AddHrSensors": {
+            "post": {
+                "description": "添加商家公共心率设备",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "HrSensors"
+                ],
+                "summary": "添加商家公共心率设备",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商家ID",
+                        "name": "shopId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "心率带Sn",
+                        "name": "sn",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "场馆内编号  01 02",
+                        "name": "venueNo",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/HrSensors/AddPvtHrSensors": {
+            "post": {
+                "description": "添加会员私有心率设备",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "HrSensors"
+                ],
+                "summary": "添加会员私有心率设备",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商家ID",
+                        "name": "shopId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "心率带Sn",
+                        "name": "sn",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userId",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/Test/UserAdd": {
+            "post": {
+                "description": "会员用户添加",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "Test"
+                ],
+                "summary": "会员用户添加",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachAdd": {
+            "post": {
+                "description": "商家教练添加",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "商家教练添加",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "店铺ID",
+                        "name": "shopId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "登陆用户名也是手机号",
+                        "name": "phone",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "密码",
+                        "name": "pwd",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "性别  1:男, 2:女",
+                        "name": "sex",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "备注",
+                        "name": "memo",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachEdit": {
+            "post": {
+                "description": "商家教练基本信息修改",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "商家教练基本信息修改",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "教练ID",
+                        "name": "ssId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "手机号",
+                        "name": "phone",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "密码",
+                        "name": "pwd",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "备注",
+                        "name": "memo",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "性别  1:男, 2:女",
+                        "name": "sex",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachListQuery": {
+            "post": {
+                "description": "会员用户列表(带分页)",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户列表(带分页)",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "手机号",
+                        "name": "phone",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "当前条",
+                        "name": "start",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "每页条数",
+                        "name": "tableMax",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ShopUserInfo"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachSimpleQuery": {
+            "post": {
+                "description": "本店会员用户基本信息查询",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "本店会员用户基本信息查询",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商家ID",
+                        "name": "shopId",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ShopCoachSimpleInfo"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopCoachStatusEdit": {
+            "post": {
+                "description": "商家教练状态修改",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "商家教练状态修改",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "教练ID",
+                        "name": "ssId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "状态  1:启用\t 8:禁用  9:删除",
+                        "name": "status",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserAdd": {
+            "post": {
+                "description": "会员用户添加",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户添加",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "店铺ID",
+                        "name": "shopId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "登陆用户名也是手机号",
+                        "name": "phone",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "性别  1:男, 2:女",
+                        "name": "sex",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "生日",
+                        "name": "birthday",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "身高",
+                        "name": "height",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "体重 ",
+                        "name": "weight",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "静态心率",
+                        "name": "staticHr",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "头像",
+                        "name": "head",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "备注",
+                        "name": "memo",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserEdit": {
+            "post": {
+                "description": "会员用户基本信息修改",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户基本信息修改",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户Id",
+                        "name": "userId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "手机号",
+                        "name": "phone",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "备注",
+                        "name": "memo",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "生日",
+                        "name": "birthday",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "身高",
+                        "name": "height",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "体重",
+                        "name": "weight",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "性别  1:男, 2:女",
+                        "name": "sex",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "静态心率",
+                        "name": "staticHr",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "头像URL",
+                        "name": "head",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserListQuery": {
+            "post": {
+                "description": "会员用户列表(带分页)",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户列表(带分页)",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "手机号",
+                        "name": "phone",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "姓名",
+                        "name": "name",
+                        "in": "formData"
+                    },
+                    {
+                        "type": "string",
+                        "description": "当前条",
+                        "name": "start",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "每页条数",
+                        "name": "tableMax",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ShopUserInfo"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserSimpleQuery": {
+            "post": {
+                "description": "本店会员用户基本信息查询",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "本店会员用户基本信息查询",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商家ID",
+                        "name": "shopId",
+                        "in": "formData"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ShopUserSimpleInfo"
+                        }
+                    }
+                }
+            }
+        },
+        "/User/ShopUserStatusEdit": {
+            "post": {
+                "description": "会员用户状态修改",
+                "consumes": [
+                    "application/x-www-form-urlencoded"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "User"
+                ],
+                "summary": "会员用户状态修改",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "Token",
+                        "name": "token",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userId",
+                        "in": "formData",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "状态  1:启用\t 8:禁用  9:删除",
+                        "name": "status",
+                        "in": "formData",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/controller.ResponseBase"
+                        }
+                    }
+                }
+            }
         }
     },
     "definitions": {
@@ -86,6 +846,51 @@
                     "type": "string"
                 }
             }
+        },
+        "controller.ShopCoachSimpleInfo": {
+            "type": "object",
+            "properties": {
+                "code": {
+                    "type": "integer"
+                },
+                "memo": {
+                    "type": "string"
+                },
+                "rs": {
+                    "type": "string"
+                }
+            }
+        },
+        "controller.ShopUserInfo": {
+            "type": "object",
+            "properties": {
+                "code": {
+                    "type": "integer"
+                },
+                "memo": {
+                    "type": "string"
+                },
+                "pageCount": {
+                    "type": "integer"
+                },
+                "rs": {
+                    "type": "string"
+                }
+            }
+        },
+        "controller.ShopUserSimpleInfo": {
+            "type": "object",
+            "properties": {
+                "code": {
+                    "type": "integer"
+                },
+                "memo": {
+                    "type": "string"
+                },
+                "rs": {
+                    "type": "string"
+                }
+            }
         }
     },
     "securityDefinitions": {

+ 542 - 0
docs/swagger.yaml

@@ -7,6 +7,35 @@ definitions:
       memo:
         type: string
     type: object
+  controller.ShopCoachSimpleInfo:
+    properties:
+      code:
+        type: integer
+      memo:
+        type: string
+      rs:
+        type: string
+    type: object
+  controller.ShopUserInfo:
+    properties:
+      code:
+        type: integer
+      memo:
+        type: string
+      pageCount:
+        type: integer
+      rs:
+        type: string
+    type: object
+  controller.ShopUserSimpleInfo:
+    properties:
+      code:
+        type: integer
+      memo:
+        type: string
+      rs:
+        type: string
+    type: object
 info:
   contact:
     email: support@swagger.io
@@ -58,6 +87,519 @@ paths:
       summary: 用户添加
       tags:
       - Auth
+  /HrSensors/AddHrSensors:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 添加商家公共心率设备
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 商家ID
+        in: formData
+        name: shopId
+        required: true
+        type: integer
+      - description: 心率带Sn
+        in: formData
+        name: sn
+        required: true
+        type: integer
+      - description: 场馆内编号  01 02
+        in: formData
+        name: venueNo
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 添加商家公共心率设备
+      tags:
+      - HrSensors
+  /HrSensors/AddPvtHrSensors:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 添加会员私有心率设备
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 商家ID
+        in: formData
+        name: shopId
+        required: true
+        type: integer
+      - description: 心率带Sn
+        in: formData
+        name: sn
+        required: true
+        type: integer
+      - description: 用户ID
+        in: formData
+        name: userId
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 添加会员私有心率设备
+      tags:
+      - HrSensors
+  /Test/UserAdd:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 会员用户添加
+      parameters:
+      - description: 姓名
+        in: formData
+        name: name
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 会员用户添加
+      tags:
+      - Test
+  /User/ShopCoachAdd:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 商家教练添加
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 店铺ID
+        in: formData
+        name: shopId
+        required: true
+        type: integer
+      - description: 登陆用户名也是手机号
+        in: formData
+        name: phone
+        required: true
+        type: string
+      - description: 姓名
+        in: formData
+        name: name
+        required: true
+        type: string
+      - description: 密码
+        in: formData
+        name: pwd
+        required: true
+        type: string
+      - description: 性别  1:男, 2:女
+        in: formData
+        name: sex
+        required: true
+        type: integer
+      - description: 备注
+        in: formData
+        name: memo
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 商家教练添加
+      tags:
+      - User
+  /User/ShopCoachEdit:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 商家教练基本信息修改
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 教练ID
+        in: formData
+        name: ssId
+        required: true
+        type: integer
+      - description: 手机号
+        in: formData
+        name: phone
+        type: string
+      - description: 密码
+        in: formData
+        name: pwd
+        type: string
+      - description: 姓名
+        in: formData
+        name: name
+        type: string
+      - description: 备注
+        in: formData
+        name: memo
+        type: string
+      - description: 性别  1:男, 2:女
+        in: formData
+        name: sex
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 商家教练基本信息修改
+      tags:
+      - User
+  /User/ShopCoachListQuery:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 会员用户列表(带分页)
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 手机号
+        in: formData
+        name: phone
+        type: string
+      - description: 姓名
+        in: formData
+        name: name
+        type: string
+      - description: 当前条
+        in: formData
+        name: start
+        required: true
+        type: string
+      - description: 每页条数
+        in: formData
+        name: tableMax
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ShopUserInfo'
+      summary: 会员用户列表(带分页)
+      tags:
+      - User
+  /User/ShopCoachSimpleQuery:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 本店会员用户基本信息查询
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 商家ID
+        in: formData
+        name: shopId
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ShopCoachSimpleInfo'
+      summary: 本店会员用户基本信息查询
+      tags:
+      - User
+  /User/ShopCoachStatusEdit:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 商家教练状态修改
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 教练ID
+        in: formData
+        name: ssId
+        required: true
+        type: integer
+      - description: "状态  1:启用\t 8:禁用  9:删除"
+        in: formData
+        name: status
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 商家教练状态修改
+      tags:
+      - User
+  /User/ShopUserAdd:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 会员用户添加
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 店铺ID
+        in: formData
+        name: shopId
+        required: true
+        type: integer
+      - description: 登陆用户名也是手机号
+        in: formData
+        name: phone
+        required: true
+        type: string
+      - description: 姓名
+        in: formData
+        name: name
+        required: true
+        type: string
+      - description: 性别  1:男, 2:女
+        in: formData
+        name: sex
+        required: true
+        type: integer
+      - description: 生日
+        in: formData
+        name: birthday
+        required: true
+        type: string
+      - description: 身高
+        in: formData
+        name: height
+        required: true
+        type: integer
+      - description: '体重 '
+        in: formData
+        name: weight
+        required: true
+        type: string
+      - description: 静态心率
+        in: formData
+        name: staticHr
+        type: integer
+      - description: 头像
+        in: formData
+        name: head
+        type: string
+      - description: 备注
+        in: formData
+        name: memo
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 会员用户添加
+      tags:
+      - User
+  /User/ShopUserEdit:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 会员用户基本信息修改
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 用户Id
+        in: formData
+        name: userId
+        required: true
+        type: integer
+      - description: 手机号
+        in: formData
+        name: phone
+        type: string
+      - description: 姓名
+        in: formData
+        name: name
+        type: string
+      - description: 备注
+        in: formData
+        name: memo
+        type: string
+      - description: 生日
+        in: formData
+        name: birthday
+        required: true
+        type: string
+      - description: 身高
+        in: formData
+        name: height
+        required: true
+        type: integer
+      - description: 体重
+        in: formData
+        name: weight
+        required: true
+        type: string
+      - description: 性别  1:男, 2:女
+        in: formData
+        name: sex
+        required: true
+        type: integer
+      - description: 静态心率
+        in: formData
+        name: staticHr
+        type: integer
+      - description: 头像URL
+        in: formData
+        name: head
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 会员用户基本信息修改
+      tags:
+      - User
+  /User/ShopUserListQuery:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 会员用户列表(带分页)
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 手机号
+        in: formData
+        name: phone
+        type: string
+      - description: 姓名
+        in: formData
+        name: name
+        type: string
+      - description: 当前条
+        in: formData
+        name: start
+        required: true
+        type: string
+      - description: 每页条数
+        in: formData
+        name: tableMax
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ShopUserInfo'
+      summary: 会员用户列表(带分页)
+      tags:
+      - User
+  /User/ShopUserSimpleQuery:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 本店会员用户基本信息查询
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 商家ID
+        in: formData
+        name: shopId
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ShopUserSimpleInfo'
+      summary: 本店会员用户基本信息查询
+      tags:
+      - User
+  /User/ShopUserStatusEdit:
+    post:
+      consumes:
+      - application/x-www-form-urlencoded
+      description: 会员用户状态修改
+      parameters:
+      - description: Token
+        in: formData
+        name: token
+        required: true
+        type: string
+      - description: 用户ID
+        in: formData
+        name: userId
+        required: true
+        type: integer
+      - description: "状态  1:启用\t 8:禁用  9:删除"
+        in: formData
+        name: status
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/controller.ResponseBase'
+      summary: 会员用户状态修改
+      tags:
+      - User
 securityDefinitions:
   ApiKeyAuth:
     in: header

+ 1 - 1
main.go

@@ -87,7 +87,7 @@ func main() {
 		middleware.Session(),
 	)
 	r.AutoRegisterController("/v1", &controller.Auth{})
-
+	r.AutoRegisterController("/v1", &controller.Test{})
 	//debug模式下启用swag文档
 	if global.Project.Debug {
 		gin.SetMode(gin.DebugMode)

+ 13 - 0
repository/postgres/test.go

@@ -0,0 +1,13 @@
+package postgres
+
+type Test struct {
+	base
+}
+
+func (t Test) UserAdd(name string) {
+
+	sql := `insert into t_user ( name,create_at) VALUES ($1,now())`
+
+	panicExec(t.writeDB().Exec(t.ctx(), sql,
+		name))
+}

+ 15 - 0
service/test.go

@@ -0,0 +1,15 @@
+package service
+
+import (
+	db "gframe/repository/postgres"
+)
+
+type Test struct {
+	base
+}
+
+func (t Test) UserAdd(name string) (err error) {
+
+	db.Test{}.UserAdd(name)
+	return
+}