Explorar o código

修改海商需求

zhou.xiaoning %!s(int64=4) %!d(string=hai) anos
pai
achega
929d5850f2
Modificáronse 6 ficheiros con 131 adicións e 19 borrados
  1. 5 3
      controllers/user/user.go
  2. 41 2
      docs/docs.go
  3. 41 2
      docs/swagger.json
  4. 31 2
      docs/swagger.yaml
  5. 3 2
      models/account.go
  6. 10 8
      models/common.go

+ 5 - 3
controllers/user/user.go

@@ -330,8 +330,9 @@ func QueryMessageBoard(c *gin.Context) {
 
 // AddMessageBoardReq 添加用户留言板信息请求参数
 type AddMessageBoardReq struct {
-	UserID  int    `form:"userID" binding:"required"`
-	Message string `form:"message" binding:"required"`
+	UserID     int    `form:"userID" binding:"required"`
+	Message    string `form:"message" binding:"required"`
+	ContactNum string `form:"contactNum" binding:"required"`
 }
 
 // AddMessageBoard 添加用户留言板信息
@@ -340,6 +341,7 @@ type AddMessageBoardReq struct {
 // @Security ApiKeyAuth
 // @Param userID query int true "用户ID"
 // @Param message query string true "留言信息"
+// @Param contactNum query string true "联系电话"
 // @Success 200 {object} app.Response
 // @Failure 500 {object} app.Response
 // @Router /User/AddMessageBoard [post]
@@ -355,7 +357,7 @@ func AddMessageBoard(c *gin.Context) {
 		return
 	}
 
-	if errCode := models.InsertMessageBoard(req.UserID, req.Message); errCode != 0 {
+	if errCode := models.InsertMessageBoard(req.UserID, req.Message, req.ContactNum); errCode != 0 {
 		// 执行失败
 		logger.GetLogger().Errorf("AddMessageBoard failed: %s", e.GetMsg(errCode))
 		appG.Response(http.StatusBadRequest, errCode, nil)

+ 41 - 2
docs/docs.go

@@ -5692,6 +5692,13 @@ var doc = `{
                         "name": "message",
                         "in": "query",
                         "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "联系电话",
+                        "name": "contactNum",
+                        "in": "query",
+                        "required": true
                     }
                 ],
                 "responses": {
@@ -14094,6 +14101,10 @@ var doc = `{
                 "messageboardid"
             ],
             "properties": {
+                "contactnum": {
+                    "description": "联系电话",
+                    "type": "string"
+                },
                 "createtime": {
                     "description": "创建时间",
                     "type": "string"
@@ -14727,16 +14738,36 @@ var doc = `{
                 "configid"
             ],
             "properties": {
+                "areauserid": {
+                    "description": "所属机构ID",
+                    "type": "integer"
+                },
                 "configid": {
                     "description": "配置ID(SEQ_SZDZ2_IMAGECONFIG)",
                     "type": "integer"
                 },
+                "createdate": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
                 "imagepath": {
                     "description": "图片",
                     "type": "string"
                 },
                 "imagetype": {
-                    "description": "类型 - 1:App首页轮播 2:我的",
+                    "description": "类型 - 1:首页轮播(移动) 2:我的(移动)",
+                    "type": "integer"
+                },
+                "isshow": {
+                    "description": "是否展示 - 0:不展示 1:展示",
+                    "type": "integer"
+                },
+                "modifierid": {
+                    "description": "操作人",
                     "type": "integer"
                 },
                 "sort": {
@@ -14747,9 +14778,17 @@ var doc = `{
                     "description": "标题",
                     "type": "string"
                 },
+                "updatedate": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
                 "url": {
-                    "description": "链接",
+                    "description": "链接(地址或商品ID)",
                     "type": "string"
+                },
+                "urltype": {
+                    "description": "链接类型 - 1:直接地址 2:商品ID",
+                    "type": "integer"
                 }
             }
         },

+ 41 - 2
docs/swagger.json

@@ -5676,6 +5676,13 @@
                         "name": "message",
                         "in": "query",
                         "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "联系电话",
+                        "name": "contactNum",
+                        "in": "query",
+                        "required": true
                     }
                 ],
                 "responses": {
@@ -14078,6 +14085,10 @@
                 "messageboardid"
             ],
             "properties": {
+                "contactnum": {
+                    "description": "联系电话",
+                    "type": "string"
+                },
                 "createtime": {
                     "description": "创建时间",
                     "type": "string"
@@ -14711,16 +14722,36 @@
                 "configid"
             ],
             "properties": {
+                "areauserid": {
+                    "description": "所属机构ID",
+                    "type": "integer"
+                },
                 "configid": {
                     "description": "配置ID(SEQ_SZDZ2_IMAGECONFIG)",
                     "type": "integer"
                 },
+                "createdate": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
                 "imagepath": {
                     "description": "图片",
                     "type": "string"
                 },
                 "imagetype": {
-                    "description": "类型 - 1:App首页轮播 2:我的",
+                    "description": "类型 - 1:首页轮播(移动) 2:我的(移动)",
+                    "type": "integer"
+                },
+                "isshow": {
+                    "description": "是否展示 - 0:不展示 1:展示",
+                    "type": "integer"
+                },
+                "modifierid": {
+                    "description": "操作人",
                     "type": "integer"
                 },
                 "sort": {
@@ -14731,9 +14762,17 @@
                     "description": "标题",
                     "type": "string"
                 },
+                "updatedate": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
                 "url": {
-                    "description": "链接",
+                    "description": "链接(地址或商品ID)",
                     "type": "string"
+                },
+                "urltype": {
+                    "description": "链接类型 - 1:直接地址 2:商品ID",
+                    "type": "integer"
                 }
             }
         },

+ 31 - 2
docs/swagger.yaml

@@ -5923,6 +5923,9 @@ definitions:
     type: object
   models.Messageboard:
     properties:
+      contactnum:
+        description: 联系电话
+        type: string
       createtime:
         description: 创建时间
         type: string
@@ -6389,14 +6392,29 @@ definitions:
     type: object
   models.Szdz2imageconfig:
     properties:
+      areauserid:
+        description: 所属机构ID
+        type: integer
       configid:
         description: 配置ID(SEQ_SZDZ2_IMAGECONFIG)
         type: integer
+      createdate:
+        description: 创建时间
+        type: string
+      creatorid:
+        description: 创建人
+        type: integer
       imagepath:
         description: 图片
         type: string
       imagetype:
-        description: 类型 - 1:App首页轮播 2:我的
+        description: 类型 - 1:首页轮播(移动) 2:我的(移动)
+        type: integer
+      isshow:
+        description: 是否展示 - 0:不展示 1:展示
+        type: integer
+      modifierid:
+        description: 操作人
         type: integer
       sort:
         description: 排序
@@ -6404,9 +6422,15 @@ definitions:
       title:
         description: 标题
         type: string
+      updatedate:
+        description: 修改时间
+        type: string
       url:
-        description: 链接
+        description: 链接(地址或商品ID)
         type: string
+      urltype:
+        description: 链接类型 - 1:直接地址 2:商品ID
+        type: integer
     required:
     - configid
     type: object
@@ -12434,6 +12458,11 @@ paths:
         name: message
         required: true
         type: string
+      - description: 联系电话
+        in: query
+        name: contactNum
+        required: true
+        type: string
       produces:
       - application/json
       responses:

+ 3 - 2
models/account.go

@@ -353,6 +353,7 @@ type Messageboard struct {
 	Userid         int64     `json:"userid"  xorm:"'USERID'"`                                    // 用户ID
 	Message        string    `json:"message"  xorm:"'MESSAGE'"`                                  // 留言信息
 	Createtime     time.Time `json:"createtime"  xorm:"'CREATETIME'"`                            // 创建时间
+	Contactnum     string    `json:"contactnum"  xorm:"'CONTACTNUM'"`                            // 联系电话
 }
 
 // TableName is MESSAGEBOARD
@@ -649,7 +650,7 @@ func GetMessageBoard(userID int) ([]Messageboard, error) {
 }
 
 // InsertMessageBoard 新增用户留言板信息
-func InsertMessageBoard(userID int, message string) int {
+func InsertMessageBoard(userID int, message, contactNum string) int {
 	engine := db.GetEngine()
 
 	// 一天最多只能新增3条留言
@@ -663,7 +664,7 @@ func InsertMessageBoard(userID int, message string) int {
 	}
 
 	// 由于XORM对ORACLE支持不行,有时间字段更新的直接使用SQL语句执行
-	sql := fmt.Sprintf("insert into MESSAGEBOARD (MESSAGEBOARDID, USERID, MESSAGE, CREATETIME) values (SEQ_MessageBoard.nextval, %d, '%s', (select sysdate from dual))", userID, message)
+	sql := fmt.Sprintf("insert into MESSAGEBOARD (MESSAGEBOARDID, USERID, MESSAGE, CONTACTNUM ,CREATETIME) values (SEQ_MessageBoard.nextval, %d, '%s', '%s', (select sysdate from dual))", userID, message, contactNum)
 	if _, err := engine.Exec(sql); err != nil {
 		return e.ERROR_OPERATION_FAILED
 	}

+ 10 - 8
models/common.go

@@ -166,19 +166,21 @@ func (Division) TableName() string {
 	return "DIVISION"
 }
 
-// Szdz2imageconfig 广告配置表
+// Szdz2imageconfig 终端图片配置  - 通用功能
 type Szdz2imageconfig struct {
 	Configid   int64     `json:"configid"  xorm:"'CONFIGID'" binding:"required"` // 配置ID(SEQ_SZDZ2_IMAGECONFIG)
-	Imagetype  int32     `json:"imagetype"  xorm:"'IMAGETYPE'"`                  // 类型 - 1:App首页轮播 2:我的
+	Imagetype  int32     `json:"imagetype"  xorm:"'IMAGETYPE'"`                  // 类型 - 1:首页轮播(移动) 2:我的(移动)
 	Title      string    `json:"title"  xorm:"'TITLE'"`                          // 标题
 	Imagepath  string    `json:"imagepath"  xorm:"'IMAGEPATH'"`                  // 图片
-	URL        string    `json:"url"  xorm:"'URL'"`                              // 链接
+	URL        string    `json:"url"  xorm:"'URL'"`                              // 链接(地址或商品ID)
 	Sort       int64     `json:"sort"  xorm:"'SORT'"`                            // 排序
-	Isshow     int32     `json:"-"  xorm:"'ISSHOW'"`                             // 是否展示 - 0:不展示 1:展示
-	Createdate time.Time `json:"-"  xorm:"'CREATEDATE'"`                         // 创建时间
-	Creatorid  int64     `json:"-"  xorm:"'CREATORID'"`                          // 创建人
-	Updatedate time.Time `json:"-"  xorm:"'UPDATEDATE'"`                         // 修改时间
-	Modifierid int64     `json:"-"  xorm:"'MODIFIERID'"`                         // 操作人
+	Isshow     int32     `json:"isshow"  xorm:"'ISSHOW'"`                        // 是否展示 - 0:不展示 1:展示
+	Createdate time.Time `json:"createdate"  xorm:"'CREATEDATE'"`                // 创建时间
+	Creatorid  int64     `json:"creatorid"  xorm:"'CREATORID'"`                  // 创建人
+	Updatedate time.Time `json:"updatedate"  xorm:"'UPDATEDATE'"`                // 修改时间
+	Modifierid int64     `json:"modifierid"  xorm:"'MODIFIERID'"`                // 操作人
+	Areauserid int64     `json:"areauserid"  xorm:"'AREAUSERID'"`                // 所属机构ID
+	Urltype    int32     `json:"urltype"  xorm:"'URLTYPE'"`                      // 链接类型 - 1:直接地址 2:商品ID
 }
 
 // TableName is SZDZ2_IMAGECONFIG