ソースを参照

访客表新增driver_name(司机名称)字段

codingliang 1 年間 前
コミット
b66f786854

+ 4 - 0
doc/update_0619.sql

@@ -0,0 +1,4 @@
+-- 访客表新增司机名称字段
+alter table welcome_visitor
+    add driver_name varchar(32) not null comment '司机名称' after name;
+

+ 4 - 4
src/main/java/com/template/api/WelcomeVisitorControllerAPI.java

@@ -12,9 +12,9 @@ import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestAttribute;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -29,15 +29,15 @@ public interface WelcomeVisitorControllerAPI {
 
 
     @PostMapping
     @PostMapping
     @ApiOperation(value = "新增访客记录")
     @ApiOperation(value = "新增访客记录")
-    CommonResult addVisitor(@RequestParam String studentCard, @Validated @RequestBody WelcomeVisitorRequest visitorRequest);
+    CommonResult addVisitor(@RequestAttribute String studentCard, @Validated @RequestBody WelcomeVisitorRequest visitorRequest);
 
 
     @GetMapping
     @GetMapping
     @ApiOperation(value = "获取当前用户访客记录")
     @ApiOperation(value = "获取当前用户访客记录")
-    CommonResult<WelcomeVisitorVO> getByCurUser(@RequestParam String studentCard);
+    CommonResult<WelcomeVisitorVO> getByCurUser(@RequestAttribute String studentCard);
 
 
     @DeleteMapping
     @DeleteMapping
     @ApiOperation(value = "删除当前用户的访客记录")
     @ApiOperation(value = "删除当前用户的访客记录")
-    CommonResult deleteByCurUser(@RequestParam String studentCard);
+    CommonResult deleteByCurUser(@RequestAttribute String studentCard);
 
 
     @GetMapping("admin/page")
     @GetMapping("admin/page")
     @ApiOperation(value = "访客记录分页")
     @ApiOperation(value = "访客记录分页")

+ 5 - 2
src/main/java/com/template/model/pojo/WelcomeVisitor.java

@@ -1,15 +1,15 @@
 package com.template.model.pojo;
 package com.template.model.pojo;
 
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.Version;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
-import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
 
 
+import java.io.Serializable;
+
 /**
 /**
  * <p>
  * <p>
  *
  *
@@ -36,6 +36,9 @@ public class WelcomeVisitor implements Serializable {
     @ApiModelProperty(value = "访客姓名")
     @ApiModelProperty(value = "访客姓名")
     private String name;
     private String name;
 
 
+    @ApiModelProperty(value = "司机姓名")
+    private String driverName;
+
     @ApiModelProperty(value = "访客手机号")
     @ApiModelProperty(value = "访客手机号")
     private String phone;
     private String phone;
 
 

+ 4 - 0
src/main/java/com/template/model/request/WelcomeVisitorRequest.java

@@ -29,6 +29,10 @@ public class WelcomeVisitorRequest implements Serializable {
     @NotBlank(message = "访客姓名不能为空")
     @NotBlank(message = "访客姓名不能为空")
     private String name;
     private String name;
 
 
+    @ApiModelProperty(value = "司机姓名")
+    @NotBlank(message = "司机姓名不能为空")
+    private String driverName;
+
     @ApiModelProperty(value = "访客手机号")
     @ApiModelProperty(value = "访客手机号")
     @NotBlank(message = "访客手机号不能为空")
     @NotBlank(message = "访客手机号不能为空")
     @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
     @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")

+ 4 - 0
src/main/java/com/template/model/vo/WelcomeVisitorVO.java

@@ -25,6 +25,10 @@ public class WelcomeVisitorVO implements Serializable {
     @ExcelProperty("访客姓名")
     @ExcelProperty("访客姓名")
     private String name;
     private String name;
 
 
+    @ApiModelProperty(value = "司机姓名")
+    @ExcelProperty("司机姓名")
+    private String driverName;
+
     @ApiModelProperty(value = "访客手机号")
     @ApiModelProperty(value = "访客手机号")
     @ExcelProperty("访客手机号")
     @ExcelProperty("访客手机号")
     private String phone;
     private String phone;