//package com.inkasso.management.user.controller;
//
//import com.inkasso.auth.interfaces.Permissions;
//import com.inkasso.auth.interfaces.PermissionAndCheck;
//import com.inkasso.adapter.page.PageResult;
//import com.inkasso.management.user.model.dto.BackendUserDTO;
//import com.inkasso.management.user.model.request.AddBackendUserRequest;
//import com.inkasso.management.user.model.request.EditBackendUserRequest;
//import com.inkasso.management.user.model.request.QueryBackendUserRequest;
//import com.inkasso.management.user.service.BackendUserService;
//import com.inkasso.adapter.exception.ServiceException;
//import com.inkasso.adapter.response.ResponseData;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.PutMapping;
//import org.springframework.web.bind.annotation.DeleteMapping;
//import org.springframework.web.bind.annotation.GetMapping;
//import com.inkasso.adapter.exception.enums.KafubaoExceptionEnum;
//
//
//import java.util.List;
//
///**
// * @author 张超
// * @date  2023-08-24
// */
//@RestController
//@RequestMapping(path = "backenduser")
//@Permissions(name="后端用户",code = "backenduserManage")
//public class BackendUserController {
//
//    @Autowired
//    private BackendUserService backendUserService;
//
//
//
//    @PostMapping(path = "backenduser")
//    @PermissionAndCheck(name="添加后端用户",code="BackendUserController:add")
//    public ResponseData add(@Validated @RequestBody AddBackendUserRequest addBackendUserRequest) {
//
//        backendUserService.addBackendUser(addBackendUserRequest);
//        return ResponseData.success();
//
//    }
//
//    @PutMapping(path = "backenduser")
//    @PermissionAndCheck(name="更新后端用户",code="BackendUserController:update")
//    public ResponseData edit(@Validated @RequestBody EditBackendUserRequest editBackendUserRequest) {
//        backendUserService.editBackendUser(editBackendUserRequest);
//        return ResponseData.success();
//    }
//
//    @GetMapping(path = "backenduser/{id}")
//    @PermissionAndCheck(name = "查询后端用户详细信息", code="BackendUserController:detail")
//    public ResponseData getById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        BackendUserDTO backendUserDTO = backendUserService.getBackendUserDtoById(id);
//        return ResponseData.success(backendUserDTO);
//
//    }
//
//
//    @DeleteMapping(path = "backenduser/{id}")
//    @PermissionAndCheck(name = "删除后端用户", code="BackendUserController:delete")
//    public ResponseData deleteById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        backendUserService.deleteBackendUser(id);
//        return ResponseData.success();
//    }
//}