增加新增部门接口

This commit is contained in:
chixiao
2019-06-15 23:11:09 +08:00
parent e7c9464804
commit 8f4433bf79
13 changed files with 329 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
package cn.iocoder.mall.admin.application.controller.admins;
import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.admin.api.DeptmentService;
import cn.iocoder.mall.admin.api.bo.deptment.DeptmentBO;
import cn.iocoder.mall.admin.api.dto.depetment.DeptmentAddDTO;
import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.common.framework.vo.CommonResult.success;
/**
* Description:
*
* @author: zhenxianyimeng
* @date: 2019-06-14
* @time: 19:07
*/
@RestController
@RequestMapping("admins/dept")
@Api("部门模块")
public class DeptmentController {
@Autowired
private DeptmentService deptmentService;
@PostMapping("add")
@ApiOperation(value = "新增部门", notes = "选择部门名称,父级部门")
public CommonResult<DeptmentBO> add(@RequestBody DeptmentAddDTO deptmentAddDTO){
return success(deptmentService.addDeptment(
AdminSecurityContextHolder.getContext().getAdminId(), deptmentAddDTO));
}
}

View File

@@ -0,0 +1,14 @@
package cn.iocoder.mall.admin.application.vo.deptment;
import cn.iocoder.mall.admin.api.bo.deptment.DeptmentBO;
/**
* Description:
*
* @author: zhenxianyimeng
* @date: 2019-06-15
* @time: 16:57
*/
public class DeptmentVO extends DeptmentBO {
}