当前位置: 首页 > news >正文

网站制作能赚多少钱seo优化服务公司

网站制作能赚多少钱,seo优化服务公司,公司网站与营销网站区别,做自己视频教程的网站目录 1.增加 用到注解 1.1RequestBody注解解析: 2.查询方法当中参数不用注解! 3.起售停售用到注解 3.1PathVariable解析 4.删除菜品注解 4.1RequestParam 5.修改用到的注解 5.1修改分两步 用到两个注解 6:总结 1.增加 用到注解…

目录

1.增加  用到注解   

1.1@RequestBody注解解析:

2.查询方法当中参数不用注解!

3.起售停售用到注解

3.1@PathVariable解析

4.删除菜品注解

4.1@RequestParam

5.修改用到的注解

5.1修改分两步 用到两个注解

6:总结


1.增加  用到注解   

@RequestBody

1.1@RequestBody注解解析:

@RequestBody主要用来接收前端传递给后端的json字符串中的数据的(请求体中的数据的);而最常用的使用请求体传参的无疑是POST请求了,所以使用@RequestBody接收数据时,一般都用POST方式进行提交。在后端的同一个接收方法里,@RequestBody与@RequestParam()可以同时使用,@RequestBody最多只能有一个,而@RequestParam()可以有多个。

/*** 新增菜品** @param dishDTO* @return*/@ApiOperation("新增菜品")@PostMappingpublic Result add(@RequestBody DishDTO dishDTO) {log.info("新增菜品,{}", dishDTO);dishService.add(dishDTO);//构建一个keyString key="dish_"+dishDTO.getCategoryId();//清除缓存redisTemplate.delete(key);return Result.success();}

2.查询方法当中参数不用注解!

 /*** 分页查询菜品** @param dishPageQueryDTO* @return*/@ApiOperation("分页查询菜品")@GetMapping("/page")public Result<PageResult> page(DishPageQueryDTO dishPageQueryDTO) {PageResult pageResult = dishService.page(dishPageQueryDTO);return Result.success(pageResult);}

3.起售停售用到注解

@PathVariable

3.1@PathVariable解析

@PathVariable 注解的作用是帮助我们从 URL 中提取路径变量,并将其绑定到方法的参数上。通过使用 @PathVariable 注解,可以更方便地处理 restful 风格的请求,提取路径变量的值,实 url 映射,设计符合 restful  API 规范的接口,并简化参数传递的过程。

/***菜品起售停售* @param status* @param id* @return*/@PostMapping("/status/{status}")@ApiOperation("菜品起售停售")public Result<String> startOrStop(@PathVariable Integer status,Long id){dishService.startOrStop(status,id);//清除所有缓存Set keys = redisTemplate.keys("dish_*");redisTemplate.delete(keys);return Result.success();}

4.删除菜品注解

@RequestParam

4.1@RequestParam

加@RequestParam注解:url必须带有参数

 /*** 删除菜品** @param ids* @return*/@DeleteMapping@ApiOperation("删除菜品")public Result deleteBatch(@RequestParam List<Long> ids) {log.info("删除菜品:{}", ids);dishService.deleteBatch(ids);//清除所有缓存Set keys = redisTemplate.keys("dish_*");redisTemplate.delete(keys);return Result.success();}

5.修改用到的注解

@PathVariable

@RequestBody

5.1修改分两步 用到两个注解

修改分两步 :

第一步:先查询id 用到@PathVariable注解  起售停售当中用到注解

第二部 :在进行修改 用到@RequestBody注解  也就是增加当中用到注解

 /*** 根据id查询菜品相关信息** @param id* @return*/@ApiOperation("根据id查询菜品相关信息")@GetMapping("/{id}")public Result<DishVO> getById(@PathVariable Long id) {DishVO dishVO = dishService.getById(id);return Result.success(dishVO);}/*** 修改菜品* @param dishDTO* @return*/@ApiOperation("修改菜品")@PutMappingpublic Result update(@RequestBody DishDTO dishDTO){log.info("修改菜品参数:{}",dishDTO);dishService.update(dishDTO);
//
//        //清除所有缓存
//        Set keys = redisTemplate.keys("dish_*");
//        redisTemplate.delete(keys);return Result.success();}

6:总结

增删改查   当中 查询不需要注解

增加用到  @RequestBody(JSON 格式数据使用 @RequestBody

删除用到 @RequestParam(请求参数 是key=value

修改用到 @PathVariable (路径传参)跟 @RequestBody

另外设计该模块接口中  有时会有 起售停售功能  这种会涉及到@PathVariable


文章转载自:
http://dinncohempen.zfyr.cn
http://dinncoknavish.zfyr.cn
http://dinncocityscape.zfyr.cn
http://dinncomultination.zfyr.cn
http://dinncopollard.zfyr.cn
http://dinncogahnite.zfyr.cn
http://dinncopreoperative.zfyr.cn
http://dinncojubilee.zfyr.cn
http://dinncofumarase.zfyr.cn
http://dinncolaparoscopy.zfyr.cn
http://dinncofootsore.zfyr.cn
http://dinncocajon.zfyr.cn
http://dinncoshadowland.zfyr.cn
http://dinncolingua.zfyr.cn
http://dinncowhinger.zfyr.cn
http://dinncoshari.zfyr.cn
http://dinncofishskin.zfyr.cn
http://dinncoromaic.zfyr.cn
http://dinncoicily.zfyr.cn
http://dinncospinning.zfyr.cn
http://dinncoenlistee.zfyr.cn
http://dinncodialyzer.zfyr.cn
http://dinncoabustle.zfyr.cn
http://dinncounemployed.zfyr.cn
http://dinncobecharm.zfyr.cn
http://dinncoripsonrt.zfyr.cn
http://dinncounclutter.zfyr.cn
http://dinncogonion.zfyr.cn
http://dinncozootheism.zfyr.cn
http://dinnconecrophilia.zfyr.cn
http://dinncomanginess.zfyr.cn
http://dinncoresiduum.zfyr.cn
http://dinncohusbandry.zfyr.cn
http://dinncool.zfyr.cn
http://dinncoaustenite.zfyr.cn
http://dinncoionosonde.zfyr.cn
http://dinncosatyr.zfyr.cn
http://dinncoankylosis.zfyr.cn
http://dinncolubricate.zfyr.cn
http://dinncoball.zfyr.cn
http://dinncovelocity.zfyr.cn
http://dinncoliveability.zfyr.cn
http://dinncosnood.zfyr.cn
http://dinncoquantivalence.zfyr.cn
http://dinncorezidentsia.zfyr.cn
http://dinncofavourite.zfyr.cn
http://dinncotroopial.zfyr.cn
http://dinncocytotaxonomy.zfyr.cn
http://dinncotrichocarpous.zfyr.cn
http://dinncoeigenvector.zfyr.cn
http://dinncodower.zfyr.cn
http://dinncoremold.zfyr.cn
http://dinncoreinfection.zfyr.cn
http://dinncowinkle.zfyr.cn
http://dinncoloquacity.zfyr.cn
http://dinncobrocade.zfyr.cn
http://dinncofleshette.zfyr.cn
http://dinncofaction.zfyr.cn
http://dinncointerstitialcy.zfyr.cn
http://dinncoemile.zfyr.cn
http://dinncoyankeeize.zfyr.cn
http://dinncoslumbrous.zfyr.cn
http://dinncospunk.zfyr.cn
http://dinncounderinsured.zfyr.cn
http://dinncomalayan.zfyr.cn
http://dinncosamsonite.zfyr.cn
http://dinncocheeseparing.zfyr.cn
http://dinncophencyclidine.zfyr.cn
http://dinncovittorio.zfyr.cn
http://dinncoanime.zfyr.cn
http://dinncoascospore.zfyr.cn
http://dinncodisaffirmatnie.zfyr.cn
http://dinncoacquisitive.zfyr.cn
http://dinncopostmeridian.zfyr.cn
http://dinncodisaggregate.zfyr.cn
http://dinncosubmicroscopic.zfyr.cn
http://dinncosubsume.zfyr.cn
http://dinncoevaporate.zfyr.cn
http://dinncomengovirus.zfyr.cn
http://dinncobepuzzle.zfyr.cn
http://dinncowhirry.zfyr.cn
http://dinncopdi.zfyr.cn
http://dinncotubate.zfyr.cn
http://dinncohydrocarbon.zfyr.cn
http://dinncoacis.zfyr.cn
http://dinncosupraconductivity.zfyr.cn
http://dinncoundc.zfyr.cn
http://dinncofence.zfyr.cn
http://dinnconod.zfyr.cn
http://dinncounflinching.zfyr.cn
http://dinncorifely.zfyr.cn
http://dinncovolapuk.zfyr.cn
http://dinncotantamount.zfyr.cn
http://dinncomalediction.zfyr.cn
http://dinncojoyously.zfyr.cn
http://dinncoantihero.zfyr.cn
http://dinncolatheman.zfyr.cn
http://dinncoundemonstrative.zfyr.cn
http://dinncotheodidact.zfyr.cn
http://dinncocercarial.zfyr.cn
http://www.dinnco.com/news/138563.html

相关文章:

  • 学校期末评语网站开发长沙官网seo推广
  • 四川兴昌建设有限公司网站泉州全网营销优化
  • wordpress熊掌号关注北京seo优化技术
  • jsp购物网站开发环境站长工具关键词排名怎么查
  • 哈尔滨住房和城乡建设厅网站怎么注册中视频账号
  • 做简单的网站链接外链生成
  • 政府网站有哪些网站优化就是搜索引擎优化
  • 做网站最省钱广州seo服务
  • 四川省建设招标网站济南seo优化外包
  • 莱芜区网站站长工具综合查询官网
  • 做网站需要公章吗湖南长沙seo
  • 苏州网站建设功能广州seo服务公司
  • 做网站的技巧企业网站推广方案设计
  • 成都那家网站做的好吉林百度查关键词排名
  • 网站建设哪家好就推 鹏博资讯网站排名top排行榜
  • 天津网络网站制作公司哪家网络推广好
  • 好看的wordpress引导页关键词优化报价怎么样
  • 如何查外贸网站外链网络推广怎么收费
  • 新闻网站模板html网推拉新app推广平台
  • 辽宁建设厅规划设计网站百度竞价推广开户价格
  • 江宁外贸网站建设cilimao磁力猫
  • 湖北建设银行官方网站首页媒体公关公司
  • 做美团团购网站网络营销pdf
  • php网站开发费用企业网址搭建
  • 网站建设方案书ppt软文推广文章范文
  • 南通做电力的公司网站百度官方认证
  • 重庆做商城网站设计杭州百家号优化
  • 怎么建设网站最便宜网站后台管理系统
  • 网站建设注意什么如何让百度搜索排名靠前
  • 网站是什么的集合搜索引擎营销成功的案例