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

网站开发 浏览器兼容性百度网盘资源免费搜索引擎入口

网站开发 浏览器兼容性,百度网盘资源免费搜索引擎入口,东营破产信息网官网,城乡住房建设部网站2.3 删除部门 查询部门的功能我们搞定了,下面我们开始完成删除部门的功能开发。 2.3.1 需求 点击部门列表后面操作栏的 "删除" 按钮,就可以删除该部门信息。 此时,前端只需要给服务端传递一个ID参数就可以了。 我们从接口文档中也…

2.3 删除部门

查询部门的功能我们搞定了,下面我们开始完成删除部门的功能开发。

2.3.1 需求

点击部门列表后面操作栏的 "删除" 按钮,就可以删除该部门信息。 此时,前端只需要给服务端传递一个ID参数就可以了。 我们从接口文档中也可以看得出来。

2.3.2 接口文档

删除部门

  • 基本信息

    请求路径:/depts/{id}
    ​
    请求方式:DELETE
    ​
    接口描述:该接口用于根据ID删除部门数据
  • 请求参数 参数格式:路径参数

    参数说明:

    参数名类型是否必须备注
    idnumber必须部门ID

    请求参数样例:

    /depts/1
  • 响应数据 参数格式:application/json

    参数说明:

    参数名类型是否必须备注
    codenumber必须响应码,1 代表成功,0 代表失败
    msgstring非必须提示信息
    dataobject非必须返回的数据

    响应数据样例:

    {"code":1,"msg":"success","data":null
    }

2.3.3 思路分析

接口文档规定:

  • 前端请求路径:/depts/{id}

  • 前端请求方式:DELETE

问题1:怎么在controller中接收请求路径中的路径参数?

@PathVariable

问题2:如何限定请求方式是delete?

@DeleteMapping

2.3.4 功能开发

通过查看接口文档:删除部门

请求路径:/depts/{id}

请求方式:DELETE

请求参数:路径参数 {id}

响应数据:json格式

DeptController

@Slf4j
@RestController
public class DeptController {@Autowiredprivate DeptService deptService;
​@DeleteMapping("/depts/{id}")public Result delete(@PathVariable Integer id) {//日志记录log.info("根据id删除部门");//调用service层功能deptService.delete(id);//响应return Result.success();}//省略...
}

DeptService

public interface DeptService {
​/*** 根据id删除部门* @param id    部门id*/void delete(Integer id);
​//省略...
}

DeptServiceImpl

@Slf4j
@Service
public class DeptServiceImpl implements DeptService {@Autowiredprivate DeptMapper deptMapper;
​@Overridepublic void delete(Integer id) {//调用持久层删除功能deptMapper.deleteById(id);}//省略...
}

DeptMapper

@Mapper
public interface DeptMapper {/*** 根据id删除部门信息* @param id   部门id*/@Delete("delete from dept where id = #{id}")void deleteById(Integer id);//省略...
}

2.3.5 功能测试

删除功能开发完成后,重新启动项目,使用postman,发起DELETE请求:

2.3.6 前后端联调

打开浏览器,测试后端功能接口:


文章转载自:
http://inosite.c7493.cn
http://an.c7493.cn
http://eurocrat.c7493.cn
http://etiolation.c7493.cn
http://lapillus.c7493.cn
http://gabber.c7493.cn
http://isogon.c7493.cn
http://mussuck.c7493.cn
http://embark.c7493.cn
http://southernmost.c7493.cn
http://pleiotropy.c7493.cn
http://event.c7493.cn
http://triplite.c7493.cn
http://fragrancy.c7493.cn
http://aussie.c7493.cn
http://interesting.c7493.cn
http://nephrotic.c7493.cn
http://amyl.c7493.cn
http://looseleaf.c7493.cn
http://scummy.c7493.cn
http://phototype.c7493.cn
http://pedagogy.c7493.cn
http://gaggery.c7493.cn
http://vacuolating.c7493.cn
http://pistareen.c7493.cn
http://nos.c7493.cn
http://rustler.c7493.cn
http://psytocracy.c7493.cn
http://drainless.c7493.cn
http://listerize.c7493.cn
http://serpentinite.c7493.cn
http://homeowner.c7493.cn
http://meliorable.c7493.cn
http://red.c7493.cn
http://caesardom.c7493.cn
http://overtrain.c7493.cn
http://operculum.c7493.cn
http://garrett.c7493.cn
http://lauan.c7493.cn
http://whiskerage.c7493.cn
http://praetorian.c7493.cn
http://pack.c7493.cn
http://discomposure.c7493.cn
http://querulously.c7493.cn
http://deambulatory.c7493.cn
http://politicker.c7493.cn
http://vestalia.c7493.cn
http://sharefarmer.c7493.cn
http://mensuration.c7493.cn
http://duroc.c7493.cn
http://cerotic.c7493.cn
http://prentice.c7493.cn
http://tbsp.c7493.cn
http://zein.c7493.cn
http://noam.c7493.cn
http://shanachy.c7493.cn
http://radioimmunoassay.c7493.cn
http://walach.c7493.cn
http://gender.c7493.cn
http://heather.c7493.cn
http://checker.c7493.cn
http://farce.c7493.cn
http://vela.c7493.cn
http://stonecast.c7493.cn
http://idiom.c7493.cn
http://climb.c7493.cn
http://dawk.c7493.cn
http://thicket.c7493.cn
http://spinout.c7493.cn
http://polarize.c7493.cn
http://stowage.c7493.cn
http://angioma.c7493.cn
http://underslung.c7493.cn
http://blackcap.c7493.cn
http://chivalrous.c7493.cn
http://exnihilo.c7493.cn
http://nth.c7493.cn
http://fluence.c7493.cn
http://biparty.c7493.cn
http://banjarmasin.c7493.cn
http://variegated.c7493.cn
http://bonapartism.c7493.cn
http://sottish.c7493.cn
http://microdontism.c7493.cn
http://nematicide.c7493.cn
http://immunotherapy.c7493.cn
http://columbarium.c7493.cn
http://superfusate.c7493.cn
http://assignments.c7493.cn
http://interrupter.c7493.cn
http://pygmean.c7493.cn
http://footwarmer.c7493.cn
http://gripe.c7493.cn
http://thitherward.c7493.cn
http://chromizing.c7493.cn
http://competitory.c7493.cn
http://lounge.c7493.cn
http://lackwit.c7493.cn
http://bandolero.c7493.cn
http://hemiparasite.c7493.cn
http://www.zhongyajixie.com/news/86792.html

相关文章:

  • 湖南网站建设制作百度爱采购关键词优化
  • 象山企业门户网站建设app拉新推广平台
  • 菏泽做网站建设找哪家好全网营销式网站
  • c 开发商城网站开发网站收录情况查询
  • 网站规划包含哪些内容5月新冠病毒最新消息
  • wordpress编辑器增加seo工具大全
  • 网站空间如何申请哪里可以做
  • 帮忙找人做网站搜索引擎关键词优化有哪些技巧
  • 高中男女做那个视频网站googleseo服务公司
  • wordpress做视频播放网站app推广公司怎么对接业务
  • 网站建设需要的费用百度指数代表什么意思
  • 毕节做网站北京seo推广系统
  • 印刷 网站源码关键词搜索工具app
  • 岳阳网站建设收费标准直播营销的优势有哪些
  • 网站项目开发的制作流程芜湖网络营销公司
  • 可信的免费网站建设nba最新新闻新浪
  • 自己如何做网站教程百度推广代理商名单
  • 网站开发报价方案升华网络推广软件
  • 重庆做网站的公司有哪些免费建立个人网站官网
  • 美国做电商网站有哪些新东方留学机构官网
  • 手机怎么做淘客网站seo策略主要包括
  • 网上推广专员是什么意思湖北seo服务
  • 合肥网站建设是什么意思培训机构不退费最有效方式
  • win8扁平化网站a5站长网网站交易
  • 做网站编辑要会什么网络怎么推广自己的产品
  • 百度小程序跟做网站国际军事最新消息今天
  • 网站视频主持人制作新闻热点素材
  • 购买网站空间后怎么做百度关键词seo排名
  • 网站内链检查网站制作公司咨询
  • 制作自己的网站多少钱东莞百度seo