工作中遇到的问题

@PostMapping
映射一个POST请求

Spring MVC新特性
提供了对Restful风格的支持

@GetMapping,处理get请求
@PostMapping,处理post请求
@PutMapping,处理put请求
@DeleteMapping,处理delete请求

@PostMapping(value = "/user/login")

等价于

@RequestMapping(value = "/user/login",method = RequestMethod.POST)



@ApiOperation

1.首先@ApiOperation注解不是Spring自带的,它是是swagger里的

2.注解@ApiOperation是用来构建Api文档的

3.@ApiOperation(value = “接口说明”, httpMethod = “接口请求方式”, response =
“接口返回参数类型”, notes = “接口发布说明”;其他参数可参考源码;


判断是否为空尽量使用null == 而不是 ==null

StringUtils.isEmpty判断是否为空.

 

在使用spring boot的时候,配置了一个yml文件,修改启动本地测试在启动项上Edit Configurations,修改VM options = -Dspring.profiles.active=local

 

vue 

            </el-form-item>
            <el-form-item label="人工最大回访量:" prop="artificialProportion" v-if="handlerForm.isShowArtificial" style="width: 350px;margin-left: 100px;">
                <el-input type="number" :value="handlerForm.artificialProportion"
                          v-model="handlerForm.artificialProportion" style="width: 100px;"
                          :disabled="handlerForm.artificialIntervalAll==1"></el-input>
                <el-checkbox value="handlerForm.artificialIntervalAll" v-model="handlerForm.artificialIntervalAll" style="width:30px">人工全部回流</el-checkbox>
            </el-form-item>
            <el-form-item label="智能最大回访量:" prop="intelligentProportion" v-if="handlerForm.isShowIntelligent" style="width: 350px;margin-left: 100px;">
                <el-input type="number" :value="handlerForm.intelligentProportion"
                          v-model="handlerForm.intelligentProportion" style="width: 100px;"
                          :disabled="handlerForm.intelligentIntervalAll==1"></el-input>
                <el-checkbox value="handlerForm.intelligentIntervalAll" v-model="handlerForm.intelligentIntervalAll" style="width:30px">智能全部回流</el-checkbox>
            </el-form-item>

 

由于不允许在.xml中使用now()来获取updatetime和creattime

使用DateUtils.getNowDateTime()在controler层来设置updatetime,

修改.xml中的now为

update_time = #{updateTime}



JSONArray转换时,将其中为空的字段去掉了
JSONArray jsonArray =JSONArray.parseArray(JSON.toJSONString(jsonMobile.get("list")));
加上序列化的条件解决
JSONArray jsonArray =JSONArray.parseArray(JSON.toJSONString(jsonMobile.get("list"), SerializerFeature.WRITE_MAP_NULL_FEATURES));
posted @ 2019-10-14 15:44  ricky0001  阅读(156)  评论(0编辑  收藏  举报